1. Trang chủ
  2. » Công Nghệ Thông Tin

Oracle9i Installation Guide phần 7 ppsx

24 636 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 24
Dung lượng 189,52 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Automating Database Startup and Shutdown for HP, Linux and Solaris Optional Oracle Corporation recommends that you configure your system to automatically start Oracle databases when your

Trang 1

Configuration Tasks to Perform as the root User

rwxr-xr-x

and execute privileges and all users should have read and execute privileges to this directory

the following executables:

$ORACLE_HOME/bin/dbsnmp

$ORACLE_

HOME/bin/oradism

6751rws-r-s x

The 6 sets the setuid bit and the setgidbit so the executables run as the oracleuser and OSDBA group, regardless of who executes them

All other executables 755

rwxr-xr-x

and execute privileges and all users should have read and execute privileges to this directory

rwxr-xr-x

and execute privileges and all other users should have read and execute privileges to this directory

All files under

$ORACLE_HOME/lib/

644rw-r r

and execute privileges and the other users should have read-only privileges to these files

rwxr-x x

group have restricted access to files in the directory The other users have execute privileges

Product subdirectories such as

$ORACLE_HOME/sqlplus

or

$ORACLE_HOME/rdbms

751rwxr-x x

group have restricted access to log files.The other users have execute privileges

write privileges and the other users should have read-only privileges to these files

Table 4–1 Access Permissions on Oracle Directories and Files (Cont.)

Directories/Files Permissions Comments

Trang 2

Configuration Tasks to Perform as the root User

Changing Group Membership of the Apache User

After installing the Oracle9i database, the APACHE account access to the

oraInventory directory needs to be removed in order to ensure database security Perform the following tasks:

1. Create a new group to which no other group or user has access

2. Assign ownership of this group to Apache

3. Change the APACHE account primary Group Identifier (GID) from the one that has ownership of the oraInventory directory (typically ORAINVENTORY) to the new group name

Automating Database Startup and Shutdown for HP, Linux and Solaris (Optional)

Oracle Corporation recommends that you configure your system to automatically start Oracle databases when your system starts up, and to shut down Oracle databases when your system shuts down Automatic database startup and shutdown protects against improper shutdown of the database

The dbstart and dbshut scripts are located in the $ORACLE_HOME/bin directory and can be used to automate database startup and shutdown The dbstart and dbshut scripts reference the same entries in the oratab file, so the scripts must apply to the same set of databases For example, you cannot have the dbstartscript automatically start up databases sid1, sid2, and sid3, and the dbshutscript shut down only databases sid1 and sid2 You can, however, specify that the dbshut script shut down a set of databases while the dbstart script is not used at

$ORACLE_HOME/network/trace

777rwxrwxrwxor

730rwx-wx -

ORAINVENTORY group have access to trace files when 730 is used in the production environment 777 allows broad access to view and create trace files during development

All files under product admindirectories, like

$ORACLE_HOME/rdbms

$ORACLE_HOME/sqlplus/admin

644-rw-r r

SQL scripts should typically be run as the SYS user

Table 4–1 Access Permissions on Oracle Directories and Files (Cont.)

Directories/Files Permissions Comments

Trang 3

Configuration Tasks to Perform as the root User

all To do this, include a dbshut entry in the system shutdown file but omit the dbstart entry from the system startup files

Perform the following tasks to set up the dbstart and dbshut scripts so that they are called at system startup This process must be completed for every new

database that you want to configure for automated startup and shutdown

1. Edit the /var/opt/oracle/oratab file for Solaris and /etc/oratab file for

For Oracle Real Application Clusters installation, this entry appears in the following format:

DB_NAME:ORACLE_HOME:{Y|N}

In the preceding command, DB_NAME is the cluster database name Y or N

specifies whether you want the dbstart and dbshut scripts to start up and shut down the database

2. In the /etc/init.d directory, create a dbora script similar to the following, if

it does not already exist Be sure to give the full path of the dbstart utility

#!/bin/sh

# Set ORA_HOME to be equivalent to the $ORACLE_HOME

# from which you wish to execute dbstart and dbshut;

#

# Set ORA_OWNER to the user id of the owner of the

# Oracle database in ORA_HOME

ORA_HOME=/u01/app/oracle/product/9.2.0.1.0

ORA_OWNER=oracle

if [! -f $ORA_HOME/bin/dbstart]

See Also: init command in your UNIX system documentation

for more information on system startup and shutdown procedures

Trang 4

Configuration Tasks to Perform as the root User

then echo "Oracle startup: cannot start"

exitficase "$1" in ’start’) # Start the Oracle databases:

# The following command assumes that the oracle login # will not prompt the user for any values

su - $ORA_OWNER -c $ORA_HOME/bin/dbstart &

;;

’stop’) # Stop the Oracle databases:

# The following command assumes that the oracle login # will not prompt the user for any values

su - $ORA_OWNER -c $ORA_HOME/bin/dbshut &

Automating Database Startup and Shutdown for AIX (Optional)

Oracle Corporation recommends that you configure your system to automatically start Oracle databases when your system starts up, and to shut down Oracle databases when your system shuts down Automatic database startup and shutdown protects against improper shutdown of the database

Automating Database Startup

Perform the following tasks to set up the dbstart and dbshut scripts so that they are called at system startup This process must be completed for every new

database that you want to configure for automated startup:

1. Edit the /etc/oratab file

Trang 5

Configuration Tasks to Perform as the root User

Database entries in the oratab file appears in the following format:

2. For each database that you want to start up, find the ORACLE_SID entry identified by the sid in the first field Change the last field for each to Y

3. Add the dbstart script to the /etc/inittab file:

# mkitab "oradb:2:wait:/bin/su oradb -c|/$ORACLE_HOMES/bin/dbstart"

In the preceding command, oradb is the identifier of the oracle user for which you want to start the database

Automating Database Shutdown

Automate database and system shutdown by creating a script, shut, to start dbshut and the system executable /etc/shutdown Complete the following steps

to create the script:

1. If you have not already done so, edit the database entries of your

/etc/oratab file to enable dbstart and dbshut, as described in step 1 of the dbstart instructions

2. As root, create the shut shell script:

# chmod u+x shut

3. Execute the following command to run the shut script and shut down the database:

Trang 6

Configuration Tasks to Perform as the root User

# /etc/shut -h nowThis closes Oracle databases and shuts down the system with the specified options

Automating Database Startup and Shutdown for Tru64 (Optional)

This process must be completed for every new database that you want to configure for automated startup and shutdown Perform the following tasks to start up and shut down listeners and set up the dbstart and dbshut scripts so that they are called at system startup:

1. Log in as root user

2. Edit the /etc/oratab file

Database entries in the /etc/oratab file appear in the following format:

In the preceding command, DB_NAME is the cluster database name Y or N

specifies whether you want the dbstart and dbshut scripts to start up and shut down the database

3. For each database that you want to start up, find the ORACLE_SID entry identified by the sid in the first field Change the last field for each to Y

4. Change directory to /sbin/init.d

5. Create a file named oracle, and use chmod to set the privileges to 750

6. Add the following contents to the /sbin/init.d/oracle file:

Note: This script assumes that a password is not set for the listener If a password is set, the listener will not be stopped

The ORACLE_HOME and ORACLE variables are examples Use information as appropriate for your installation

Trang 7

Configuration Tasks to Perform as the root User

# change the value of ORACLE to the login name of the

# oracle owner at your site

echo "starting Oracle Net listener"

$ORACLE_HOME/bin/lsnrctl start >> $LOG 2>&1 &

fi

echo "starting Oracle databases"

$ORACLE_HOME/bin/dbstart >> $LOG 2>&1

echo "stopping Oracle Net listener"

$ORACLE_HOME/bin/lsnrctl stop >> $LOG 2>&1

Trang 8

Configuration Tasks to Perform as the oracle User

fi echo "stopping Oracle databases"

$ORACLE_HOME/bin/dbshut >> $LOG 2>&1

;;

*) echo "usage: $0 {start|stop}"

exit

;;

esac

#exit

7. Change the.rhosts file in the oracle user login home directory to allow root login access to the account

Configuration Tasks to Perform as the oracle User

Perform the following tasks as the oracle user:

❏ Updating UNIX Account Startup Files

❏ Setting Environment Variables

❏ Initializing the oraenv Script

❏ Backing Up the root.sh Script

❏ Setting Initialization Parameters

Updating UNIX Account Startup Files

Update the startup files of the oracle user and the UNIX accounts of oracleusers

Trang 9

Configuration Tasks to Perform as the oracle User

Setting Environment Variables

Set the following environment variables in the.profile or.login file of the oracle user before using Oracle9i products The settings that you use here should

correspond to the settings used during installation as described in "Set Environment Variables" on page 2-36 The syntax for setting environment variables is as follows.For the Bourne or Korn shell:

variable_name=value; export variable_name

For the C shell:

setenv variable_name value

Table 4–2 describes the Environment Variable Settings

Caution: Do not define environment variables with names that are identical to those used for Oracle processes such as CKPT, PMON, and DBWR

Table 4–2 Environment Variable Settings

Environment Variable Recommended Setting

ORACLE_HOME Set the ORACLE_HOME variable to specify the directory

containing the Oracle software for a particular release The OFA recommended value is:

$ORACLE_BASE/product/release

For example, ORACLE_BASE variable is:

/u01/app/oracle, then the ORACLE_HOME variable would be:

/u01/app/oracle/product/9.2.0.1.0CLASSPATH Set the CLASSPATH variable to ensure Java functionality The

CLASSPATH variable is different for various products

CLASSPATH must include the following:

$ORACLE_HOME/jlib/<product jar file>:

$ORACLE_HOME/product/jlib/product_jar_file

See Also: Oracle9i Java documentation for more information

on setting the CLASSPATH variable

Trang 10

Configuration Tasks to Perform as the oracle User

LD_LIBRARY_PATH Set the LD_LIBRARY_PATH variable as $ORACLE_HOME/lib

for HP, Linux, Tru64, and Solaris 32-bit

Set the LD_LIBRARY_PATH variable as

LD_LIBRARY_PATH_64 Set the LD_LIBRARY_PATH_64 variable as

SHLIB_PATH Set the SHLIB_PATH variable as $ORACLE_HOME/lib32 for

HP

LIBPATH Set the LIBPATH variable as $ORACLE_HOME/lib32:

ORACLE_SID Set the ORACLE_SID variable to specify the name of the

Oracle Server instance name Oracle Corporation recommends restricting it to no more than four characters to avoid filename problems on different operating systems, as the sid is incorporated in many files If you do not remember the value you entered when you were prompted by the Oracle Universal Installer, you can find it listed in the installActions.logfile located in the oraInventory_location/ logs directory The oraInventory_location directory is defined in the

and Tru64

Table 4–2 Environment Variable Settings (Cont.)

Environment Variable Recommended Setting

Trang 11

Configuration Tasks to Perform as the oracle User

PATH Make sure the new $ORACLE_HOME/bin directory is included

in the PATH setting

AIX Path is $ORACLE_HOME/bin,/etc,

HP Path is $ORACLE_HOME/bin,/usr/bin,/etc,

Linux Path is $ORACLE_HOME/bin,/usr/bin,/bin,

Solaris Path is $ORACLE_HOME/bin,/usr/ccs/bin,

Tru64 Path is $ORACLE_HOME/bin,/usr/bin,/etc,

See Also:Chapter 2, "Pre-Installation Requirements" for more information on other PATH requirements

TNS_ADMIN TNS_ADMIN specifies the directory containing the Oracle Net

Services configuration files

Oracle Net Services configuration files are typically, but not always located in the $ORACLE_HOME/admin/networkdirectory Depending on the file, Oracle Net uses a different search order to locate the file

The search order for the sqlnet.ora and ldap.ora files is as follows:

1. The directory specified by the TNS_ADMIN environment variable, if set

directory for AIX, HP, Linux, and Tru64

Table 4–2 Environment Variable Settings (Cont.)

Environment Variable Recommended Setting

Trang 12

Configuration Tasks to Perform as the oracle User

Initializing the oraenv Script

You can use the oraenv script to set a common environment for Oracle software users

Single-Instance System

On a single-instance system, set the ORACLE_SID environment variable in the profile or.login file of the oracle user account Enter the following commands to initialize the oraenv file at login

For the Bourne or Korn shell:

ORAENV_ASK=NO /usr/local/bin/oraenvFor the C shell:

set ORAENV_ASK = NOsource /usr/local/bin/coraenvunset ORAENV_ASK

TWO_TASK Set the TWO_TASK variable to the default connect identifier to

use in the connect string The default connect identifier does not need to be specified in the connect string For example, if the TWO_TASK environment variable is set to sales, you can connect to a database using the CONNECT

username/password command rather than the CONNECT

username/password@sales command

See Also: Oracle9i Net Services Administrator’s Reference and Oracle9i Administrator’s Reference Release 2 (9.2.0.1.0) for UNIX Systems: AIX-Based Systems, Compaq Tru64 UNIX, HP 9000 Series HP-UX, Linux Intel, and Sun Solaris for more information on

connect identifiers

Note: The C shell uses the settings in coraenv file instead of the oraenv file

Table 4–2 Environment Variable Settings (Cont.)

Environment Variable Recommended Setting

Trang 13

Configuration Tasks to Perform as the oracle User

Multiple-Instance System

On a multiple-instance System, include a list of instance names and commands necessary to initialize the oraenv script at the end of the startup file of the oracleuser account

Table 4–3 shows the required Bourne or Korn shell commands for initializing the oraenv script on UNIX platforms

Table 4–4 describes the C shell commands for initializing the oraenv script on UNIX platforms

Table 4–3 Bourne/Korn Commands to Initialize the oraenv Script on Multiple-Instance Systems

Platforms Bourne or Korn Shell

echo "The SIDs on this machine are:"

cat /var/opt/oracle/oratab | awk -F: ’{print $1}’ |\ grep -v "#"

ORAENV_ASK="YES"

/usr/local/bin/oraenvAIX, HP, Linux and Tru64 #!/bin/sh

echo "The SIDs on this machine are:"

cat /etc/oratab | awk -F: ’{print $1}’ | grep -v "#"ORAENV_ASK="YES"

echo "The SIDs on this machine are:"

cat /var/opt/oracle/oratab | awk -F: ’{print $1}’ |\ grep -v "#"

set ORAENV_ASK="YES"

source /usr/local/bin/coraenvAIX, HP, Linux and Tru64 #!/usr/bin/csh

echo "The SIDs on this machine are:"

cat /etc/oratab | awk -F: ’{print $1}’ | grep -v "#"set ORAENV_ASK="YES"

source /usr/local/bin/coraenv

Ngày đăng: 07/08/2014, 11:22

TỪ KHÓA LIÊN QUAN