Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1092
  • Last Modified:

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
0
missymadi
Asked:
missymadi
2 Solutions
 
sdstuberCommented:
connect sys/password@PMD as sysdba

or

connect / as sysdba

with PMD set as your ORACLE_SID
0
 
missymadiAuthor Commented:
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.
0
 
schwertnerCommented:
Try encosing with '  or  "
start /wait sqlplus 'SYS/Test12 as sysdba@CDSPROD' @C:\IAScript\ORACLEIA.sql

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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

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

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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now