Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging into Oracle from a script

Status
Not open for further replies.

Vic88

MIS
May 29, 2000
76
JM
I am trying to create a script that can automatically backup an oracle 9i database.

I create an batch file with the command D:\oracle9i\bin\sqlplusw.exe @h:\test.sql

Test.sql contains the command
connect connect username/password

whenever I execute the batch file sqlplus is started and the following error message is generated



SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_string>] | /


How can I get around this problem ?

Vic88
 
sqlplus -restrict 3 /nolog << EOF
connect sys/yourpw as sysdba
$dowhat
EOF

 
I modified my original script to look like this



D:\oracle9i\bin\sqlplusw.exe /nolog @h:\test.sql

It worked.


Thanks for the insight.

Vic88
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top