This chapter describes different ways to start or shut down Oracle Database 11g. It contains the following topics:
Before you start Oracle Database 11g, ensure that both an instance and a database exist on the local system. If you did not install Oracle Database 11g, then consult the database administrator (DBA).
This section contains the following topics:
Section 2.1.2, "Starting Oracle Database 11g by Using SQL*Plus"
Section 2.1.3, "Starting Oracle Database 11g Remotely by Using SQL*Plus from an HP OpenVMS Client"
Note:
If you restarted the HP OpenVMS system, for example, due to a system failure, then you should read this section.After restarting HP OpenVMS and before starting Oracle Database 11g, you must run the ORAUSER.COM
file. In this command, you must specify the full directory path. For example:
$ @DISK$A31:[MYROOT]ORAUSER.COM
When the DBA runs this file and the logical name ORA_AUTO_INSORACLE
is defined as TRUE, a check is performed to determine if INSORACLE
must be run. If required, INSORACLE
is run. INSORACLE
installs the shared global sections that make a sharable ORACLE
image known to the system.
The following images are installed:
libclntsh.so
libskgxp11.so
libskgxn2.so
liborashr11.so
libcorenls11.so
oracle.exe
ora_java_vms_shr.exe
Note:
By default,ORA_AUTO_INSORACLE
is not defined as TRUE and ORAUSER
will not attempt to run INSORACLE
.You can start an instance of Oracle Database 11g using SQL*Plus. Refer to the instructions in this document on setting up SQL*Plus. Refer to the generic (platform-independent) Oracle Database documentation for instructions on using SQL*Plus.
You can choose to complete startup tasks separately when monitoring instance performance, for example. Alternatively, you can start an instance and then open a database after making some modifications.
When starting up Oracle Database 11g, you start the current instance. The current Oracle Database 11g instance is identified by the value of the logical name ORACLE_SID
. For example, if the value of ORACLE_SID
is currently V9
, then the current instance is the instance with the SID V9
. If you have not reassigned the ORACLE_SID
logical name, then the value of ORACLE_SID
is the SID
specified during installation. To change the current instance before starting Oracle Database 11g with SQL*Plus, you should run the ORAUSER.COM
file with the appropriate SID
as parameter.
If ORACLE_SID
is undefined or incorrect, then the following error message is displayed:
ORA-07582, spstp: ORA_SID has an illegal value.
When the current Oracle Database 11g instance is started, the SGA is created and initialized with the startup parameters set in the distributed parameter file, INIT.ORA
, in the ORA_DB
directory. When using SQL*Plus, you can use another startup file that sets different parameter values by including the PFILE
option with the STARTUP
command to identify an alternative parameter file. If the file is not in the current default directory, then you must include the directory location of the file:
SQL> STARTUP PFILE=INITsid.ORA
To start Oracle Database 11g, you must have the process rights identifier ORA_DBA
or ORA_
sid
_DBA
assigned to the user account in the HP OpenVMS rights database. In addition, you must run the COM file that makes the logical name assignments required to run Oracle Database 11g.
Before starting up Oracle Database 11g, run the ORAUSER.COM
file to set the instance.
After running the ORAUSER.COM
file, run SQL*Plus and run the appropriate STARTUP
commands, as documented in Oracle Database Administrator's Guide. You can run the single SQL*Plus command, STARTUP
, or run the three separate SQL*Plus commands documented in Oracle Database Administrator's Guide to start Oracle Database 11g Enterprise Edition.
The SQL*Plus command STARTUP
starts the current Oracle instance, creating the SGA in HP OpenVMS shared memory and creating the detached processes. It then mounts the database and opens it.
You can use SQL*Plus on an HP OpenVMS client to start an Oracle Database 11g database instance on a remote HP OpenVMS system.
The following steps must be performed on the remote system where the database resides:
Create a password file using ORAPWD
. The password file can be either exclusive or shared. For this example, assume that an exclusive password file is used. The syntax for ORAPWD
is as follows:
$ ORAPWD FILE=fname PASSWORD=password ENTRIES=users
Define a system logical name to point to the location of the password file. For example:
For an exclusive password file:
$ DEFINE/SYSTEM/EXEC ORA_sid_PWFILE - @DISK:[directory]fname
For a shared password file:
$ DEFINE/SYSTEM/EXEC ORA_PWFILE -
@DISK:[directory]fname
Edit INIT
sid
.ORA
and add the following line:
For an exclusive password file:
REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE
For a shared password file:
REMOTE_LOGIN_PASSWORDFILE = SHARED
Stop and restart the database instance.
Copy INIT
sid
.ORA
from the server to any directory on the client.
Start the SQLNET
listener on the local system. The SQLNET
listener must be configured to service connections specified by the TNSNAMES.ORA
entry, which is defined in the following section.
The following steps must be performed on the client system from which the database is to be started:
Ensure that there is a TNSNAMES.ORA
entry for the SID
on the remote system where the database resides.
Define the process logical name ORA_DFLT_HOSTSTR
to the Oracle Network Alias
for the remote system. For example:
$ DEFINE ORA_DFLT_HOSTSTR Oracle_Net_Alias
Define the process logical name that points to the complete file specification for the INIT
file copied in Step 5 of the preceding section. For example:
$ DEFINE ORA_PARAMS - ddcn:[directory]INIT.ORA
Start SQL*PLUS
, and run the commands as follows. When prompted for the password, enter the password you specified in Step 1 of the preceding section when the password file was created.
$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.4.0 - Production on Sat May 23 05:26:12 2015 Copyright (c) 1982, 2015, Oracle. All Rights Reserved. Connected to an idle instance. SQL> startup pfile=<pfile location> ORACLE instance started. Total System Global Area 1603887104 bytes Fixed Size 2213848 bytes Variable Size 469768232 bytes Database Buffers 1124073472 bytes Redo Buffers 7831552 bytes Database mounted. Database opened. SQL>
At this point, the remote database is up and running.
The following steps must be performed on the remote system where the database resides.
Perform the steps listed under Section 2.1.3.1, "Steps to Perform on a Remote System Database".
The following steps must be performed on the client system from which the database is to be started:
Ensure that there is a TNSNAMES.ORA
entry for the SID
on the remote system where the database resides.
Start SQL*Plus on your Microsoft Windows Client System.
When prompted for the password, enter the password specified in Step 1 of the preceding procedure when the password file was created. Assume the TNSNAMES.ORA
alias for the remote database is net_V11_alias
.
SQL> connect @net_V11_alias Password: SQL> startup pfile=<parameter_file> ORACLE instance started. Total System Global Area 555189984 bytes Fixed Size 730848 bytes Variable Size 520093696 bytes Database Buffers 33554432 bytes Redo Buffers 811008 bytes Database mounted. Database opened. SQL> exit
At this point, the remote database is up and running.
This section describes the following methods for shutting down Oracle Database 11g:
Section 2.2.1, "Shutting Down Oracle Database 11g Using SQL*Plus"
Section 2.2.2, "Stopping Oracle User Processes Before Database Shutdown"
After all instances on a node have been shut down, you can remove the sharable images.
You can shut down an instance of Oracle Database 11g by using SQL*Plus. Refer to Chapter 4, "Administering SQL*Plus" for instructions on setting up SQL*Plus. Then, refer to the generic (platform-independent) Oracle Database documentation for instructions on using SQL*Plus.
The SHUTDOWN IMMEDIATE
command may not work if you have persisting connections in the environment. For example, if you run processes associated with monitoring tools such as Oracle Enterprise Manager Agent. In that case, it is advisable to terminate the connections from the operating system level by running the following command:
$ STOP/ID=pid
Use the procedure below to identify which processes can be stopped.
For example, from a separate SQL*Plus session, run the following query:
SQL> SELECT sid,serial#,process FROM v$session WHERE type!='background'AND program!='Oracle';
Suppose the processes that are listed in the following table are the ones that are currently running.
SID | Serial | Process |
---|---|---|
1 | 1 | 20C0018B |
2 | 1 | 20C0018C |
3 | 1 | 20C0018D |
4 | 1 | 20C0018E |
5 | 1 | 20C0018F |
6 | 1 | 20C002DD |
Then, you can run commands similar to the following to stop these processes:
SQL>HOST STOP/ID=20C0018B SQL>HOST STOP/ID=20C0018C,
This section describes how to stop and start Oracle Net listener.
To stop an Oracle Net listener:
Set up the Oracle environment for the Oracle home by running ORAUSER.COM
with the required sid
parameter.
Note:
Do not relocateORAUSER.COM
during the installation. It must reside at the top level of the Oracle installation directory.Stop the Oracle Net listener by running the following command:
$ LSNRCTL STOP listenername
Note:
If the name of the listener is the default nameLISTENER
, then you do not have to specify the name in this command.Restarting Oracle Net Listener
To start an Oracle Net listener:
Set up the Oracle environment for the Oracle home by running ORAUSER.COM
with the appropriate sid
parameter.
Note:
Do not relocateORAUSER.COM
during the installation. It must reside at the top level of the Oracle installation directory.Restart the Oracle Net listener using the following command:
$ LSNRCTL START listenername
Note:
If the name of the listener is the default nameLISTENER
, then you do not have to specify the name in this command.If you are using Oracle Enterprise Manager Grid Control to manage multiple Oracle products from a central location, then you must have an Oracle Management Agent installed on each host system. Typically, an Oracle Management Agent is installed in its own Oracle home directory.
This section describes how to stop and start an Oracle Management Agent.
Stopping Oracle Management Agent
To stop an Oracle Management Agent:
Set up the Oracle environment for the Oracle home by running ORAUSER.COM
with the required sid
parameter.
Note:
Do not relocateORAUSER.COM
during the installation. It must reside at the top level of the Oracle installation directory.Enter the following command:
$ EMCTL STOP AGENT
Starting Oracle Management Agent
To start Oracle Management Agent:
Set up the Oracle environment for the Oracle home by running ORAUSER.COM
with the appropriate sid
parameter.
Note:
Do not relocateORAUSER.COM
during the installation. It must reside at the top level of the Oracle installation directory.Enter the following command:
$ EMCTL START AGENT