Solved

Shutdown a Oracle 9i DB

Posted on 2004-09-28
9
10,447 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
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 34

Assisted Solution

by:johnsone
johnsone earned 20 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
 
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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 45 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 20 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 40 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now