• No results found

Introduction to Oracle processes for UNIX systems

There are two types of processes associated with running an Oracle database: Oracle listener and database instance. Both types must be running on the system when running Teamcenter.

Process Description

Oracle listener The Oracle listener (tnslsnr) process monitors database connections from remote clients. This is a SQL*Net V2/Net process and is required for Teamcenter to connect. Under SQL*Net V2/Net, several listeners may run on the same system, each listening for connect requests to particular databases. Even if Teamcenter is run on the Oracle server, it is necessary to start this process because all Teamcenter database requests use the remote connect mechanism.

Database instance Database processes are associated with a particular Oracle database instance. There are six processes associated with each database instance when it is first started. The processes are:

ora_pmon_SID

Process monitor; performs Oracle process recovery when a user process fails.

ora_dbw0_SID

Database writer process; writes dirty Oracle buffers to disk.

ora_ckpt_SID

Checkpoint process; updates the headers of all Oracle data files to record the details of the checkpoint.

ora_smon_SID

System monitor process; performs Oracle instance recovery at instance startup.

ora_reco_SID

Oracle recovery process; process used with distributed database configuration that automatically resolves failures involving distributed transactions.

Process Description

Log writer process; writes the Oracle redo log buffer to a redo log file on disk.

SID represents the database instance system identifier. Starting these processes on an Oracle database server is referred to as initializing a database instance. Use one of the following methods to initialize a database instance:To start all database instances flagged in the oratab file, use the Oracle dbstart

utility. Only those instances marked with a Y flag are started.

• To start a single database instance defined by theORACLE_SIDenvironment variable, use the Oracle SQL*Plus utility.

All databases instances present on the system should be listed in the oratab configuration file. This file is located in the /var/opt/oracle directory on Solaris systems and in the /etc directory on all other platforms. Each instance should be listed on a separate line and conform to the following format:

ORACLE_SID:ORACLE_HOME:FLAG

ORACLE_SID is the system identifier of the instance (for example, tceng), ORACLE_HOME is the Oracle home directory associated with that instance (for example, /u01/app/oracle/product/oracle-version), and FLAG is Y or N. These flags are used by the Oracle dbstart and dbshut utilities to determine which instances to start or stop.

Caution Never shut down a database instance by killing database processes or by

restarting the system. Oracle databases require orderly shutdowns to ensure that all necessary database transactions are completed. Failure to observe this may result in the corruption of the database. Manual termination of processes also prevents the Oracle Relational Database Management System (RDBMS) from releasing memory that is no longer needed, and could require additional database recovery procedures at the next database startup.

There are two methods for shutting down a database instance:

Use the Oracle dbshut utility to shut down all database instances flagged in the

oratab file. Only those instances marked with a Y flag are stopped.

• Use the Oracle SQL*Plus utility to stop a single database instance defined by theORACLE_SIDenvironment variable.

Manually start Oracle processes

Start the Oracle listener process

This example shows the startup of a listener process called LISTENER. More than one listener process can be run on a system. Each listener should be defined in a configuration file called listener.ora.

1. Log on to the operating system as oracle, or switch user to oracle by typing su -

oracle followed by the oracle password.

2. Manually set the Oracle environment by typing one of the following commands:

export ORACLE_HOME=/u01/app/oracle/product/oracle-version export PATH=$PATH:$ORACLE_HOME/bin

3. Start tnslsnr by typing the following command:

$ORACLE_HOME/bin/lsnrctl start LISTENER

4. Verify that tnslsnr is running by typing the following command:

ps -ef | grep tnslsnr

The following process information is displayed:

oracle 1833 1 80 date time tnslsnr -inherit LISTENER

Replace date and time with the operating system date and time that tnslsnr was started.

Initialize all flagged database instances using dbstart

1. Log on to the operating system as oracle, or switch user to oracle by typing the following command, followed by the oracle password:

su - oracle

2. Manually set the Oracle environment by typing one of the following commands:

export ORACLE_HOME=/u01/app/oracle/product/oracle-version export PATH=$PATH:$ORACLE_HOME/bin

3. Start all Oracle database instances flagged in the oratab file by typing the following command:

$ORACLE_HOME/bin/dbstart

4. Verify that the database processes are running by typing the following command:

ps -ef | grep ora

The following process information is displayed for each database instance:

oracle 1830 1 80 date time ora_dbw0_tceng oracle 1831 1 80 date time ora_pmon_tceng oracle 1832 1 80 date time ora_lgwr_tceng oracle 1833 1 80 date time ora_smon_tceng oracle 1832 1 80 date time ora_reco_tceng oracle 1833 1 80 date time ora_ckpt_tceng

Replace date and time with the operating system date and time that the database process was started. This example shows the background database processes associated with an Oracle instance called tceng.

Initialize a database instance using SQL*Plus utility

1. Log on to the operating system as oracle, or switch user to oracle by typing the following command, followed by the oracle password:

su - oracle

2. Manually set the Oracle environment by typing one of the following sets of commands:

export ORACLE_HOME=/u01/app/oracle/product/oracle-version export ORACLE_SID=tceng

3. Set the shared library path environment variable to include the Oracle lib directory: AIX: export LIBPATH=${LIBPATH}:${ORACLE_HOME}/lib HP-UX: export SHLIB_PATH=${SHLIB_PATH}:${ORACLE_HOME}/lib Solaris: export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib

4. Start the Oracle SQL*Plus utility:

$ORACLE_HOME/bin/sqlplus

The system displays a message similar to the following:

. . .

Oraclever Enterprise Edition Release oracle-version - Production With the Partitioning option

(c) JServer Release oracle-version - Production

5. At the SQLPLUS prompt, type the following command:

connect / as sysdba

The following system message is displayed:

Connected.

6. At the SQLPLUS prompt, type the following command:

startup

The following system message is displayed:

ORACLE instance started.

Total System Global Area 35069936 bytes Fixed Size 69916 bytes

Variable Size 30314496 bytes Database Buffers 4505600 bytes Redo Buffers 180224 bytes Database mounted.

Database opened.

7. The Oracle database is initialized. Exit the Oracle SQL*Plus utility by entering the following at the SQLPLUS prompt:

exit

Manually stop Oracle processes

Stop the Oracle listener

This example shows the shutdown of a listener process called LISTENER. More than one listener process may be run on a system and each listener should be defined in a configuration file called listener.ora.

1. Log on to the operating system as oracle, or switch user to oracle by entering

su - oracle followed by the oracle password.

2. Manually set the Oracle environment by typing one of the following commands:

export ORACLE_HOME=/u01/app/oracle/product/oracle-version export PATH=$PATH:$ORACLE_HOME/bin

The commands assume that Oracle is installed in the

u01/app/oracle/product/oracle-version; directory. Your location may be

different.

3. Stop tnslsnr by typing the following command:

$ORACLE_HOME/bin/lsnrctl stop listener

4. Verify that the tnslsnr process is no longer running by entering the following command:

ps -ef | grep -v grep | grep tnslsnr

There should be no output returned by this command. Shut down all flagged database instances using dbshut

1. Log on to the operating system as oracle, or switch user to oracle by entering the following command, followed by the oracle password:

su - oracle

2. Manually set the Oracle environment by entering one of the following commands:

export ORACLE_HOME=/u01/app/oracle/product/oracle-version export PATH=$PATH:$ORACLE_HOME/bin

3. Stop all Oracle database instances flagged in the oratab file:

$ORACLE_HOME/bin/dbshut

4. Verify that the database processes are no longer running:

ps -ef | grep -v grep | grep ora

There should be no output returned by this command. Shut down a database instance using SQL*Plus

1. Log on to the operating system as oracle, or switch user to oracle by typing the following command, followed by the oracle password:

su - oracle

2. Manually set the Oracle environment by typing one of the following commands:

export ORACLE_HOME=/u01/app/oracle/product/oracle-version export ORACLE_SID=tceng

3. Set the shared library path environment variable to include the Oracle lib directory: AIX: export LIBPATH=${LIBPATH}:${ORACLE_HOME}/lib HP-UX: export SHLIB_PATH=${SHLIB_PATH}:${ORACLE_HOME}/lib Solaris: export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib

4. Start the Oracle SQL*Plus utility:

5. The system displays a message similar to the following:

. . .

Oraclever Enterprise Edition Release oracle-version - Production JServer Release oracle-version - Production

6. At the SQLPLUS prompt, type the following command:

connect / as sysdba

The following system message is displayed:

Connected.

7. At the SQLPLUS prompt, type the following command:

shutdown immediate

The following system message is displayed:

Database closed. Database dismounted. ORACLE instance shut down.

8. The Oracle database is shut down. Exit the SQL*Plus utility by typing the following command at the SQLPLUS prompt:

exit

Automate Oracle processes startup and shutdown

Automate Oracle processes startup

Most system administrators find it helpful to automatically start and stop the Oracle processes when starting and stopping the system, respectively. This ensures a graceful and orderly shutdown of Oracle processes.

Automatic startup of Oracle server and database processes is achieved by scripting startup commands so that they are started automatically each time the system is restarted. There are two methods of doing this:

Modify an existing system run control (rc) script to include the startup commands.

Create a new system rc script using sample scripts provided by Siemens PLM Software.

Because the Siemens PLM Software-provided sample scripts are highly

platform-specific, sample startup scripts, oracle.daemon, have been included. The following is a sample startup script provided and the system directories where it must be located on each supported platform:

AIX: /etc/oracle.daemon HP-UX: /sbin/init.d/oracle.daemon Solaris: /etc/init.d/oracle.daemon

In addition to the oracle.daemon script, a numbered symbolic link to this file must be created in the default run control directory of SVR4 platforms:

AIX:

Edit the /etc/rc script by adding the following line to the local customization section to run the oracle.daemon script.

/etc/oracle.daemon

HP-UX:

/sbin/rc2.d/S99oracle.daemon

Solaris:

/etc/rc2.d/S99oracle.daemon

Automate Oracle processes shutdown

Automatic shutdown of Oracle server and database processes is achieved by scripting shutdown commands so that they are run automatically each time the system is shutdown. There are two methods of doing this:

Modify an existing system run control (rc) script to include the shutdown commands

Create a new system rc script using sample scripts provided by Siemens PLM Software

Because the sample scripts are highly platform-specific, sample shutdown scripts,

oracle.daemon, have been included. The following is a sample shutdown script

provided and the system directories where it must be located on each supported platform:

HP-UX:

/sbin/init.d/oracle.daemon

Solaris:

/etc/init.d/oracle.daemon

In addition to the oracle.daemon script, a numbered symbolic link to this file must be created in the default run control directory of SVR4 platforms:

HP-UX:

/sbin/rc2.d/K10oracle.daemon

Solaris:

/etc/rc0.d/K10oracle.daemon

Note There is no available procedure for automating shutdown of Oracle processes