Oracle9i Administrator's Reference Release 1 (9.0.1) for Alpha OpenVMS Part Number A90868-01 |
|
This chapter describes different ways to start up or shut down the Oracle9i. These methods include using ORACLEINS, using STARTUP and SHUTDOWN files, or using SQL*Plus.
This chapter contains the following topics:
Before you can start the Oracle9i, both an instance and a database must exist on your local system. If you did not install the Oracle9i, consult the person who did.
This section presents the following topics:
If you rebooted your Alpha OpenVMS system (for example, due to a system crash), you should read this section. If not, you can skip this section.
After rebooting Alpha OpenVMS, you must perform the following steps before starting the Oracle9i:
$ @DISK$A31:[MYROOT.UTIL]ORAUSER.COM
This file installs the shared global sections that make a shareable ORACLE image known to the system.
The following images are installed:
Each of these images must have proper protection when you run INSORACLE. The account where you run INSORACLE.COM must have CMKRNL privilege.
You must perform Step 2 under the following conditions:
To start Oracle9i using ORACLEINS, do the following steps:
$ @ORA_DB:ORAUSER_<dbname>.COM <sid> <setup_nodename>
Currently known database SIDs:
[list of known SIDs]
Press [RETURN] to quit with no action.
NOTE: The SID can be a maximum of 6 characters in length.
What is the SID for the instance to startup?
You can also use command files to start Oracle9i. The file you execute depends on whether you are running in exclusive or in parallel mode. Run the following STARTUP command file for the instance you want to start:
$ @ORA_DB:STARTUP_<dbname>.COM <sid> <setup_nodename>
This file is located in the database-specific directory identified by the logical name ORA_DB. When you start up the instance, be sure to specify the SID of the instance and its setup node.
You can also start an instance of Oracle9i using SQL*Plus. See the instructions in this manual on setting up SQL*Plus on your Alpha OpenVMS platform. Refer to the generic (platform-independent) Oracle Server documentation for instructions on using SQL*Plus.
You might choose to complete startup tasks separately when monitoring instance performance, for example, or you might want to start an instance and open a database after making some modifications.
When starting up the Oracle9i, you start up the current instance. The current Oracle9i instance is identified by the value of the logical name ORA_SID. For example, if the value of ORA_SID is currently V9, the current instance is the instance with the SID V9. If you have not reassigned the ORA_SID logical name, the value of ORA_SID is the SID specified during installation. To change the current instance before starting the Oracle9i with SQL*Plus, you should run the ORAUSER_<dbname>.COM file for the instance in question.
If ORA_SID is undefined or incorrect, you receive the following error:
ORA-07582, spstp: ORA_SID has an illegal value.
When the current Oracle9i 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, you must include the directory location of the file:
Sql> STARTUP PFILE=ORA_DB:INIT2.ORA
To start Oracle9i, you must have the process rights identifier ORA_DBA or ORA_<sid>_DBA assigned to your user account in the Alpha OpenVMS rights database and you must run the .COM file that makes the logical name assignments required to run Oracle9i.
Before starting up Oracle9i, run the ORAUSER_<dbname>.COM file to set the desired instance.
After running the above .COM file, run SQL*Plus and execute the appropriate STARTUP command(s), as documented in the Oracle9i Server Administrator's Guide. You can issue the single SQL*Plus command, STARTUP, or execute the three separate SQL*Plus commands documented in the Oracle9i Server Administrator's Guide to start the Oracle9i Enterprise Edition.
The SQL*Plus command STARTUP starts the current ORACLE instance, creating the SGA in Alpha OpenVMS shared memory and creating the detached processes. It then mounts the database and opens it.
You can use SQL*Plus on an OpenVMS client to start up an Oracle9i database instance on a remote Alpha OpenVMS system.
The following steps must be performed on the remote system where the database resides:
$ ORAPWD FILE=<fname> PASSWORD=<password> ENTRIES=<users>
If using an exclusive password file:
$ DEFINE/SYSTEM/EXEC ORA_<sid>_PWFILE -
ddcn:[directory]<fname>
$ DEFINE/SYSTEM/EXEC ORA_PWFILE -
ddcn:[directory]<fname>
ORA_DB:<nodename>_<sid>_INIT.ORA
and add the following line:
If using an exclusive password file:
REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE
REMOTE_LOGIN_PASSWORDFILE = SHARED
ORA_DB:<nodename>_<sid>_INIT.ORA
and ORA_DB:INIT.ORA
from the server to any directory on the client.
The following steps must be performed on the client system from which the database is to be started:
TNSNAMES.ORA
entry for the SID
on the remote system where the database resides.
ORA_DFLT_HOSTSTR
to the Oracle Net V9 ALIAS
for the remote system. For example:
$ DEFINE ORA_DFLT_HOSTSTR <Oracle Net V9 alias>
INIT
file copied in Step 5 above. For example:
$ DEFINE ORA_PARAMS -
ddcn:[directory]<nodename>_<sid>_INIT.ORA
_<sid>_INIT.ORA
and INIT.ORA
files and modify any IFILE
parameters to point to the local directory on the client where these files are located.
SQL*PLUS
and issue the commands as follows. When prompted for the password, enter the password specified in Step 1 above (server side) when the password file was created.
$
sqlplus "/ as sysdba"
SQL*Plus: Release 9.0.1.0.0 - Production on Mon Sep 17 04:36:26 2001
(c) Copyright 2001 Oracle Corporation. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 134830664 bytes
Fixed Size 432712 bytes
Variable Size 83886080 bytes
Database Buffers 50331648 bytes
Redo Buffers 180224 bytes
Database mounted.
Database opened.
SQL>
The following steps must be performed on the remote system where the database resides:
$ ORAPWD FILE=<fname> PASSWORD=<password> ENTRIES=<users>
If using an exclusive password file:
$ DEFINE/SYSTEM/EXEC ORA_<sid>_PWFILE -
ddcn:[directory]<fname>
$ DEFINE/SYSTEM/EXEC ORA_PWFILE -
ddcn:[directory]<fname>
ORA_DB:<nodename>_<sid>_INIT.ORA
and add the following line:
If using an exclusive password file:
REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE
REMOTE_LOGIN_PASSWORDFILE = SHARED
ORA_DB:<nodename>_<sid>_INIT.ORA
and ORA_DB:INIT.ORA from the server to any directory on the client.
The following steps must be performed on the client system from which the database is to be started:
TNSNAMES.ORA
entry for the SID
on the remote system where the database resides.
_<sid>_INIT.ORA
, INIT.ORA
files that were copied from the server and change all the IFILE
parameters to point to the local DOS path to which these files were copied.
\ORAWIN\BIN
for Windows 3.x, \ORAWIN95\BIN
for Windows95, and \ORANT\BIN
for Windows NT. When prompted for the password, enter the password specified in Step 1 above (server side) when the password file was created. net9_V9_ALIAS
is the TNSNAMES.ORA
alias for the remote database.
Oracle SQLPLUS Release 9.0.1.0 - Production
i
(c) Copyright 2001, Oracle Corporation. All Rights Reserved.
Oracle9Enterprise Edition Release 1 (9.0.1) - Production
PL/SQL Release 1 (9.0.1) - Production
SQL> connect @<net9_V9_alias>
Password:
SQL> startup pfile=<DOS path to <node>_<sid>_INIT.ORA>
ORACLE instance started.
Total System Global Area 11381296 bytes
Fixed Size 59952 bytes
Variable Size 10969088 bytes
Database Buffers 204800 bytes
Redo Buffers 147456 bytes
Database mounted.
Database opened.
SQL> exit
SQL> complete.
To start Oracle9i automatically whenever you start Alpha OpenVMS, submit the Oracle9i start procedure as a batch job from the system startup file. This batch job must:
ORAUSER.COM
file to define the logical names and symbols referenced by Oracle9i
ORA_RDBMS:INSORACLE.COM
to install the global sections required by Oracle9i
$ @ORA_DB:STARTUP_<dbname>.COM
or
$ @ORA_DB:STARTUP_<dbname>.COM
A sample startup file that starts two Oracle9i systems automatically after a system reboot is shown below:
$! STARTORAV9.COM
$! This script shows how one might start two Oracle
$! database instances at system boot time
$!----------------------------------------------------------$! Get the name of the node.
$!
$ NODENAME = F$GETSYI("NODENAME")
$!
$! Acquire CMKRNL privilege to install ORACLE
$! IMAGES. Exit with error if you are not so
$! authorized.
$!
$ SET PROCESS/PRIVILEGES=CMKRNL
$ IF (F$PRIVILEGE("CMKRNL") .EQS. "FALSE") THEN EXIT 2
$!
$! Define symbols specific to this release of ORACLE
$! code by running the appropriate ORAUSER.COM:
$!
$ @DISK$ORACLE:[ORACLE.V9.UTIL]ORAUSER.COM
$!
$! Install shared images:
$!
$ INSORACLE ! Install shared ORACLE image
$!
$! Start a database instance.
$!
$ INSTSID = "PROD1" ! Define SID
$ DB_NAME = "PROD" ! Define database name
$ GOSUB START_DATABASE
$!
$! Start a second database instance.
$!
$ INSTSID = "PROD2" ! Define sid
$ DB_NAME = "TEST" ! Define database name
$ GOSUB START_DATABASE
$ EXIT
$!
$! Invoke the database-specific startup script. Assumes
$! that ORA_DB for each database is under ORA_ROOT.
$! This need not be the case.
$!
$START_DATABASE:
$ @ORA_ROOT:[DB_'DB_NAME']STARTUP_'DB_NAME'.COM - 'INSTSID' 'NODENAME'
$ RETURN
In this sample startup file, the systems share the same copy of Oracle9i code. The example assumes that the Oracle9i root directory is DISK$ORACLE:[ORACLE.V9]
.
Run this file as a batch job under the Oracle9i account as part of the standard system startup procedure. Keep this file in the Oracle9i account login directory.
For example, if the Oracle9i account resides in DISK$ORACLE:[ORACLE]
, and the startup script is named STARTORAV9.COM
, then you would start this script at boot time by adding the following lines to SYS$MANAGER:SYSTARTUP_VMS.COM
:
$ filspc = "DISK$ORACLE:[ORACLE]STARTORAV8"
$ submit-
/user=Oracle9-
/after="+00:05:00"-
/log='filspc'.log-
'filspc'
To shut down Oracle9i, you can use one of these methods:
After all instances on a node have been shut down, you must de-install the shareable images. See the following section for information on de-installing images:
This section describes the three methods of shutting down Oracle9i and then tells how to deinstall shareable images.
SHUTDOWN IMMEDIATE will hang, if you issue the command ALTER SYSTEM KILL SESSION <session> immediately followed by a HOST STOP/ID=<pid> on the processes associated with those Oracle sessions. When you issue an ALTER SYSTEM KILL SESSION command, it marks the process for deletion by PMON. If you then kill the process before PMON can get to it, confusions results and a clean process deletion does not occur. The deleted process appears to still be connected. Thus, the SHUTDOWN IMMEDIATE hangs and the partially dead process can't respond to the logoff command issued by the SHUTDOWN. For example:
Process 1:
SQLPLUS> startup
SQLPLUS> select sid,serial#,process from v$session;
SID | SERIAL# | PROCESS |
1 |
1 |
|
2 |
1 |
|
3 |
1 |
|
4 |
1 |
|
5 |
1 |
|
6 |
1 |
|
6 rows selected.
Process 2 with OS-process id 20C00470:
$ sqlplus <un>/<pw>
Process 1:
select sid,serial#,process from v$session;
SID | SERIAL# | PROCESS |
1 |
1 |
|
2 |
1 |
|
3 |
1 |
|
4 |
1 |
|
5 |
1 |
|
6 |
1 |
|
8 |
11 |
|
7 rows selected.
SQL> alter system kill session '8, 11';
Statement processed.
SQL> host stop/id=20C00470
SQL> shutdown immediate
... shutdown hangs ...
The solution is to use either ALTER SESSION KILL SESSION or HOST STOP/ID=. Don't use both. A pause before the SHUTDOWN so than PMON can clean up can also be a good idea.
To shut down Oracle9i using ORACLEINS:
$ @ORA_DB:ORAUSER_<dbname>.COM <sid> <setup_nodename>
Currently known database SIDs: [list of known SIDs] Press [RETURN] to quit with no action. NOTE: The SID can be a maximum of 6 characters in length. What is the SID for the instance you want to shut down?
To shut down the currently running ORACLE instance, use the following command file:
$ @ORA_DB:SHUTDOWN_<dbname>.COM <sid> <setup_nodename>
This file is located in the database-specific directory identified by the logical name ORA_DB. When you shut down the instance, be sure to specify the SID of the instance and its setup node.
A sample shutdown file that shuts down two Oracle9i systems automatically is shown below:
$!
$! NAME: STOPORAV9.COM
$! Note that this script will hang if users are still
$! connected to the databases unless you modify the
$! shutdown scripts to issue SHUTDOWN IMMEDIATE commands.
$!----------------------------------------------------------
$!
$! Get the name of the node:
$!
$ NODENAME = F$GETSYI("NODENAME")
$!
$! Acquire CMKRNL privilege to remove the Oracle
$! shareable images. Exit with error if you are not so
$! authorized.
$!
$ SET PROCESS/PRIVILEGES=CMKRNL
$ IF (F$PRIVILEGE("CMKRNL") .EQS. "FALSE") then exit 2
$!
$! Define symbols and logicals specific to this release
$! of the Oracle code by running ORAUSER.COM
$!
$!
$ @DISK$ORACLE:[ORACLE.V9.UTIL]ORAUSER.COM
$!
$! Shut down a database instance
$!
$ INSTSID = "PROD1" ! Define SID
$ DB_NAME = "PROD" ! Define Database Name
$ GOSUB DO_SHUTDOWN
$!
$! Shut down a second database instance
$!
$ INSTSID = "PROD2" ! Define SID
$ DB_NAME = "TEST" ! Define Database Name
$! De-install Oracle shareables
$ GOSUB DO_SHUTDOWN
$!
$!
$! $ REMORACLE
$ EXIT
$!
$ DO_SHUTDOWN:
$ @ORA_ROOT:[DB_'DB_NAME']SHUTDOWN_'DB_NAME'.COM 'INSTSID'-
'NODENAME'
$ RETURN
You can shut down an instance of Oracle9i using SQL*Plus. See Chapter 8, "Administering SQL*Plus" in this manual for instructions on setting up SQL*Plus on your Alpha OpenVMS platform. Then, refer to the generic (platform-independent) Oracle Server documentation for instructions on using SQL*Plus.
After shutting down all Oracle9i instances on a node, remove the shareable images by issuing the following command:
$ REMORACLE
|
![]() Copyright © 2001 Oracle Corporation. All Rights Reserved. | | Ad Choices. |
|