Link to home
Start Free TrialLog in
Avatar of missymadi
missymadi

asked on

Logon to Oracle 10g instance as sysdba

Experts,

    I am working with Oracle 10g and I have a script that runs and should attach as sys / as sysdba but I'm getting an error:
SQL> connect sys / as sysdba@PMD
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon>  ::= <username>[/<password>][@<connect_identifier>] | /
SQL>

The initial sql script is started by a batch file where I need to connect to one db instance, where I use,  start /wait sqlplus SYS/Test12 as sysdba@CDSPROD @C:\IAScript\ORACLEIA.sql
then an sql script is run and attaches to two more instances but I need to attach to all of them as sys as /dba in order for the settings to take effect.

I can't seem to get the syntax down to connect to the db instance and run as sys - which I need because the settings that are being changed need elevated permissions.


Thanks, Missymadi
ASKER CERTIFIED SOLUTION
Avatar of Sean Stuber
Sean Stuber

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of missymadi
missymadi

ASKER

I also having trouble with this one

start /wait sqlplus SYS/Test12 as sysdba@CDSPROD @C:\IAScript\ORACLEIA.sql

is there something I'm missing in this command? It doesn't seem to be connecting as SYS.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sqlplus SYS/Test12@CDSPROD as sysdba @C:\IAScript\ORACLEIA.sql

the syntax should be sqlplus sys/<password>@<sid> as sysdba
isn't that what I posted originally?
I used sdstuber's example and it worked fine.

EX: connect sys/password@PMD as sysdba
if my post helped, why not accept it as the answer?  #24263326
if my post helped, why not accept it as the answer?  #24263326