?
Solved

Shutdown a Oracle 9i DB

Posted on 2004-09-28
9
Medium Priority
?
10,488 Views
Last Modified: 2011-08-18
Hi,

how can I shutdown an oracle 9i db in sqlplus and/or in dbastudio?

I tried this so far:
---
oracle@svr-ora9i:/etc/init.d> sqlplus /NOLOG

SQL*Plus: Release 9.2.0.1.0 - Production on Tue Sep 28 14:20:58 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

SQL> connect sys/secret@db5 as sysdba
Connected.
SQL> shutdown
ORA-00106: cannot startup/shutdown database when connected to a dispatcher
---

Regards,
pb
0
Comment
Question by:psychicblue
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12170449
try the following:

(login as Oracle on server)
sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown
0
 
LVL 12

Expert Comment

by:geotiger
ID: 12170476
You need to add the immediate (or abort) if you do not want to wait:

SQL> connect sys/secret@db5 as sysdba
Connected.
SQL> shutdown immediate
0
 
LVL 35

Assisted Solution

by:johnsone
johnsone earned 80 total points
ID: 12170489
Assuming you are on the machine that the database is on, then when you connect do not specify the @db5.

If you are not on the machine, then you will need to create a dedicated server connection in order to shut down the database.  It appears that you are running shared server, so to connect in dedicated, you need to add

(SERVER=DEDICATED)

in your tnsnames.ora file in the CONNECT_DATA section.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 11

Expert Comment

by:cjjclifford
ID: 12170805
"shutdown abort" should only be done as a last resort, as the database will perform a recovery on the next startup... If "shutdown abort" is performed, generally its a good idea to "startup" followed immediately with "shutdown" to make sure the shutdown is a clean one...
0
 

Author Comment

by:psychicblue
ID: 12170914
If I use this method provided by cjjclifford

---
(login as Oracle on server)
sqlplus /nolog
SQL> connect / as sysdba
SQL> shutdown
---

how will oracle know, what db to shut down? There are about six dbs running on this machine?
0
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12170999
export ORACLE_SID=xyz
0
 
LVL 11

Accepted Solution

by:
cjjclifford earned 180 total points
ID: 12171008
before doing the "sqlplus /nolog" do the following:
(assuming bash/sh/ksh)
export ORACLE_SID=xyz
0
 
LVL 12

Assisted Solution

by:geotiger
geotiger earned 80 total points
ID: 12173286
See the startup and shutdown script that I posted in this thread:

http://www.experts-exchange.com/Databases/Oracle/Q_21146865.html
0
 
LVL 8

Assisted Solution

by:baonguyen1
baonguyen1 earned 160 total points
ID: 12176172
If you are on the machine that host the database so what you need to do is set the SID environment variable to the SID database as the above posts. If you use the connection string connect you should add SERVER=DEDICATED instead of SERVER=SHARED in the TNSNAMES.ORA and it should work. To startup/shutdown a database, you must connect via a dedicated server process and not a shared process:

How to force a dedicated connection from a client when running Oracle Names:
=================================================
 
Normally, if a client is running multi-threaded server and you want to force a  
connection to be dedicated you would add the SERVER=DEDICATED parameter to the  
tnsnames file:  
 
<service name> =  
  (DESCRIPTION =  
    (ADDRESS_LIST =  
        (ADDRESS =  
          (COMMUNITY = <community>)  
          (PROTOCOL = <protocol>)  
          (Host = <server>)  
          (Port = 1526)  
  )  
    )  
    (CONNECT_DATA =  
     (SID = <sid>)  
       (SERVER=DEDICATED)           <---  
    )  
 
If the client is running Oracle Names they don't have a tnsnames.ora file to  
put the (SERVER=DEDICATED) parameter into.  
 
Instead of reconfiguring Oracle Names to put this parameter in, you can add  
the (USE_DEDICATED_SERVER=ON) parameter to the sqlnet.ora file on the client.  
 
AUTOMATIC_IPC = ON  
SQLNET.EXPIRE_TIME = 10    
USE_DEDICATED_SERVER=ON               <---  
NAMES.DIRECTORY_PATH = (ONAMES)  
NAMES.DEFAULT_DOMAIN = World    
NAMES.PREFERRED_SERVERS =  
        (ADDRESS_LIST =  
          (ADDRESS =  
            (PROTOCOL = TCP)  
            (HOST = GALAXY)  
            (PORT = 1527)  
          )            
        )  
 
 
Other sulutions include:
 
Use the Net8 Assistant or Netmgr to alter the Oracle Names data.  New  
services names can be explicitly set to use SERVER=DEDICATED.  Service names  
stored in Names that do not have SERVER=DEDICATED set can be dumped to a  
TNSNAMES.ORA file with the NAMESCTL dump_tnsnames command on version 8.1.5  
and higher.  The TNSNAMES file can be altered with the Net8 Assistant or  
Netmgr and then re-uploaded into Oracle Names.
 
0

Featured Post

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question