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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

accessing oracle db via sqlplus to run migrate command

Status
Not open for further replies.

droodle

Technical User
Nov 10, 2005
75
AU

help i need to run to commands on my oracle db and am missing a link

to connect i type

d:\sqlplus username\password

SQL> at this point i need to get into migrate mode but can't remember.

currently i get ...

Connected to:
Oracle9i Enterprise Edition Release 9.2.0.3.0 - Production
With the OLAP and Oracle Data Mining options
JServer Release 9.2.0.3.0 - Production

SQL> startup migrate
ORA-01031: insufficient privileges
SQL>

i then need to run ...

SQL>START D:\oracle\Oracle.9.2\rdbms\admin\catpatch.sql

then

SQL>START D:\oracle\Oracle.9.2\rdbms\admin\catalog.sql
 
Droodle,

If you plan to "startup" or "shutdown" the database (from the local server), you must be a member of your machine's "DBA" group (and thus membered), then you can use this connection to SQL*Plus:
Code:
d:\sqlplus /nolog
SQL> connect / as sysdba
If you are a member of the DBA group, then the above commands will connect you successfully (without the "ORA-01031: insufficient privileges" response) and you should be able to run successfully "startup" and "shutdown" commands.


Let us know your findings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 

thanks for help so far ...

so it will let me connect / as sysdba if the db is running but won't let me run startup migrate

SQL> connect / as sysdba
ERROR:
ORA-12560: TNS:protocol adapter error


SQL> connect / as sysdba
Connected.
SQL> startup migrate
ORA-01081: cannot start already-running ORACLE - shut it down first
SQL>
SQL>
 
Droodle,

When you receive that error, then you should ensure that there are three system variables properly set. If you are on Windows, then navigate: Start -> Control Panel -> System -> Advanced -> Environment Variables -> System Variables, then ensure that these three variables exist and have appropriate settings:
Code:
Variable        Value
--------------- -----------------------------
LOCAL           <your Oracle instance name>
ORACLE_HOME     <your ORACLE_HOME path>
ORACLE_SID      <your Oracle instance name>
Once you have ensured these settings, then try the earlier commands and let us know your findings.

[santa]Mufasa
(aka Dave of Sandy, Utah, USA)
[I provide low-cost, remote Database Administration services: www.dasages.com]
 

i am trying to do this which uses a wrapper but that is failing so i need to do this by connecting directly to the db

nhStopDb immediate
$NH_HOME/bin/sys/nhisql -sysdba 'startup migrate'
$NH_HOME/bin/sys/nhisql -sysdba 'select status from v$instance;'

If the output is "OPEN MIGRATE" then continue...

$NH_HOME/bin/sys/nhisql -sysdba '@$ORACLE_HOME/rdbms/admin/catpatch'
$NH_HOME/bin/sys/nhisql -sysdba '@$ORACLE_HOME/rdbms/admin/catalog'
$NH_HOME/bin/sys/nhisql -sysdba 'alter table sys.mon_mods$ add ( drop_segments number default 0 );'

but all i get is this after i've stopped the db ....

D:\>cd ehealth60\bin\sys\nhisql -sysdba 'startup migrate'
The system cannot find the path specified.

D:\>d:\ehealth60\bin\sys\nhisql -sysdba 'startup migrate'
ERROR:
ORA-12560: TNS:protocol adapter error
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_string>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}]
where <logon> ::= <username>[/<password>][@<connect_string>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

D:\>


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top