Oracle9i Administrator's Reference
Release 1 (9.0.1) for Alpha OpenVMS

Part Number A90868-01


Contents

Index

Go to previous page Go to next page

4
Starting Up and Shutting Down Oracle9i

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:

Starting Up the Oracle9i

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:

Before Start Up

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:

  1. Run an ORAUSER.COM file, specifying the full directory path. For example:

    $ @DISK$A31:[MYROOT.UTIL]ORAUSER.COM

  2. Run the ORA_RDBMS:INSORACLE.COM file.

    This file installs the shared global sections that make a shareable ORACLE image known to the system.

    The following images are installed:

    • ORACLIENT_<image_id>.EXE

    • ORACLIENT64_<image_id>.EXE

    • ORACLE.EXE


Note:

Running INSORACLE.COM might cause problems with any currently running instance that uses the shareable images that these command files install (for example, the database might go down). Take this into account if you create an instance-specific automatic startup procedure that invokes the INSORACLE file. 


Starting Oracle9i via ORACLEINS

To start Oracle9i using ORACLEINS, do the following steps:

  1. Run the database-specific ORAUSER file using the following syntax:

    $ @ORA_DB:ORAUSER_<dbname>.COM <sid> <setup_nodename>

  1. Run ORACLEINS:

    $ ORACLEINS

  1. Select option 3, "Reconfigure existing products, manage the database, or load demo tables," from the Oracle Installation Startup Menu.

  2. Press [RETURN] when prompted to specify the root directory.

  3. Press [RETURN] when prompted to specify the device where you mounted the distribution medium.

  4. Select option 2, "Instance Creation, Startup, and Shutdown Menu" from the Main Menu.

  5. Select option 2, "Startup an Existing Instance," from the Instance Creation, Startup, and Shutdown Menu. The following message is displayed:

  1. Type the SID of the instance that you want to start and press [RETURN]. The instance identified by this SID is started and the database associated with this instance is opened in exclusive mode.

Starting Oracle9i via STARTUP Files

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.

Starting Oracle9i via SQL*Plus

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.

Identifying the Current Instance

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. 

Specifying Startup Parameters

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 

Starting the Server using SQL*Plus

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.

Starting Oracle9i Remotely via SQL*Plus from an OpenVMS Client

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:

  1. Create a password file using ORAPWD. The password file can be either exclusive or shared. For this example, we will assume an exclusive password file. The syntax for ORAPWD is as follows:

    $ ORAPWD FILE=<fname> PASSWORD=<password> ENTRIES=<users>

  1. Define a system logical name to point to the location of the password file. For example:

    If using an exclusive password file:

    $ DEFINE/SYSTEM/EXEC ORA_<sid>_PWFILE -  
      ddcn:[directory]<fname>
    

      If using a shared password file:

      $ DEFINE/SYSTEM/EXEC ORA_PWFILE - 
        ddcn:[directory]<fname>
      

    1. Edit ORA_DB:<nodename>_<sid>_INIT.ORA and add the following line:

      If using an exclusive password file:

      REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE
      

        If using a shared password file:

        REMOTE_LOGIN_PASSWORDFILE = SHARED
        

      1. Stop and restart the database instance.

      2. Copy 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:

      1. Ensure that there is a TNSNAMES.ORA entry for the SID on the remote system where the database resides.

      2. Define the process logical name ORA_DFLT_HOSTSTR to the Oracle Net V9 ALIAS for the remote system. For example:

        $ DEFINE ORA_DFLT_HOSTSTR <Oracle Net V9 alias>
        

      1. Define the process logical name that points to the complete file specification for the INIT file copied in Step 5 above. For example:

        $ DEFINE ORA_PARAMS - 
          ddcn:[directory]<nodename>_<sid>_INIT.ORA
        

      1. Edit the <nodename>_<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.

      2. Invoke 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>
        

      1. At this point, the remote database is up and running.

      Starting Oracle9i Remotely via SQL*Plus from a Windows PC Client

      The following steps must be performed on the remote system where the database resides:

      1. Create a password file using ORAPWD. The password file can be either exclusive or shared. For this example, we will assume an exclusive password file. The syntax for ORAPWD is as follows:

        $ ORAPWD FILE=<fname> PASSWORD=<password> ENTRIES=<users>
        

      1. Define a system logical name to point to the location of the password file. For example:

        If using an exclusive password file:

        $ DEFINE/SYSTEM/EXEC ORA_<sid>_PWFILE -  
          ddcn:[directory]<fname>
        

          If using a shared password file:

          $ DEFINE/SYSTEM/EXEC ORA_PWFILE - 
            ddcn:[directory]<fname>
          

        1. Edit ORA_DB:<nodename>_<sid>_INIT.ORA and add the following line:

          If using an exclusive password file:

          REMOTE_LOGIN_PASSWORDFILE = EXCLUSIVE
          

            If using a shared password file:

            REMOTE_LOGIN_PASSWORDFILE = SHARED
            

          1. Stop and restart the database instance.

          2. Copy 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:

          1. Ensure that there is a TNSNAMES.ORA entry for the SID on the remote system where the database resides.

          2. Edit the <nodename>_<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.

          3. Invoke SQL*Plus from File Manager (Windows 3.x) or Windows Explorer (Windows95/98/2000/NT). It should be located in the following directory: \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
            (c) Copyright 2001, Oracle Corporation. All Rights Reserved.
            Oracle9
            i Enterprise 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.

          1. At this point, the remote database is up and running.

          Starting Oracle9i Automatically

          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:

          • Execute the ORAUSER.COM file to define the logical names and symbols referenced by Oracle9i

          • Run as the operating system DBA account user

          • Run ORA_RDBMS:INSORACLE.COM to install the global sections required by Oracle9i

          • Execute one of the startup command files to start Oracle9i:

            $ @ORA_DB:STARTUP_<dbname>.COM  
            

          or

          $ @ORA_DB:STARTUP_<dbname>.COM  
          

          Sample Startup File

          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'

          Shutting Down the Oracle9i

          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.

          Stopping Oracle Users Before Database Shutdown

          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 

          20C0018B 

          20C0018C 

          20C0018D 

          20C0018E 

          20C0018F 

          20C002DD 

          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 

          20C0018B 

          20C0018

          20C0018D 

          20C0018E 

          20C0018F 

          20C002DD 

          11 

          20C00470 

          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.

          Shutting Down Oracle9i using ORACLEINS

          To shut down Oracle9i using ORACLEINS:

          1. Using SQLPLUS, ensure that there are no open sessions.

          2. Run the database-specific ORAUSER file:

            $ @ORA_DB:ORAUSER_<dbname>.COM <sid> <setup_nodename>  
            

          1. Run ORACLEINS:

            $ ORACLEINS  
            

          1. Select option 3, "Reconfigure existing products, manage the database, or load demo tables," from the ORACLE Installation Startup Menu.

          2. Press [RETURN] when prompted to specify the root directory.

          3. Press [RETURN] when prompted to specify the location of the savesets.

          4. Select option 2, "Instance Creation, Startup, and Shutdown Menu" from the Main Menu.

          5. Select option 4, "Shutdown an Existing Instance," from the Instance Creation, Startup, and Shutdown Menu. The following message is displayed:

            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?  
            

          1. Type the SID of the instance that you want to stop and press [RETURN]. The ORACLEINS utility will now do an orderly shutdown of the specified instance.

          Shutting Down Oracle9i using the SHUTDOWN File

          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.

          Sample Shutdown File

          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
          $ GOSUB DO_SHUTDOWN
          $!
          $!
          $! De-install Oracle shareables
          $! $ REMORACLE
          $ EXIT
          $!
          $ DO_SHUTDOWN:
          $ @ORA_ROOT:[DB_'DB_NAME']SHUTDOWN_'DB_NAME'.COM 'INSTSID'-
          'NODENAME'
          $ RETURN

          Shutting Down Oracle9i using SQL*Plus

          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.

          De-installing Shareable Images

          After shutting down all Oracle9i instances on a node, remove the shareable images by issuing the following command:

          $ REMORACLE


Go to previous page Go to next page
Oracle
Copyright © 2001 Oracle Corporation.

All Rights Reserved. | | Ad Choices.


Contents

Index