1.

Solve : Oracle SQL Plus Automation?

Answer»

Hello everybody,

I am new to scripting, I would appreciate any help.

What I need to do is to create a batch file that launches 3 Oracle services, then to connect to SQL PLUS. Till here, everything goes fine, but when SQL Plus starts, the execution GETS stuck and I don't know how to automate the work INSIDE it. What I want to do is to issue the command "startup" to start the database from inside SQL Plus, then issue the command "exit" to get out from SqlPlus, then start a program that connects to the database. Here is my UNFINISHED script:

net start OracleOraDb10g_home1TNSListener
net start OracleServiceDatabaseName
net start OracleDBConsoleDatabaseName
sqlplus Username/[emailprotected] as SYSDBA
?? How to work inside SqlPlus and get out to continue ??
C:\Test.exe

Thanks in advance for any reply.

Joe.Put the SQL Plus items you want to process into a single file, mystuff.sql and add it to the command line for SQL Plus

sqlplus Username/[emailprotected] as SYSDBA @c:\mystuff.sql

Since you are also starting your database just 2 lines earlier you will need some sort of PAUSE in there to allow the database time to mount.Thank you very much.

Joe.



Discussion

No Comment Found