Pro Oracle Database 11g Administration (9 page)

Read Pro Oracle Database 11g Administration Online

Authors: Darl Kuhn

Tags: #Oracle DBA

BOOK: Pro Oracle Database 11g Administration
8.17Mb size Format: txt, pdf, ePub

# groupadd dba

If you don’t have access to a root account, then you need to get your system administrator to run the previous commands. If you have a company requirement that a group be set up with the same group ID on different servers, then use the -g option. This example explicitly sets the group ID to 505:

# groupadd -g 505 dba

You can verify that the group was added successfully by inspecting the contents of the /etc/group file. Here is a typical entry created in the /etc/group file:

dba:x:501:

5

CHAPTER 1 ■ INSTALLING THE ORACLE BINARIES

If for any reason you need to remove a group, use the groupdel command. If you need to modify a group, use the groupmod command.

Next, use the useradd command to add operating system users. This command requires root access.

The following command creates an operating system account named oracle, with the primary group being dba and the oinstall group specified as a supplementary group:

# useradd -g dba -G oinstall oracle

If you don’t have access to a root account, then you need your system administrator to run the useradd command. If you have a company requirement that a user be set up with the same user ID

across multiple servers, then use the -u option. This example explicitly sets the user ID to 500:

# useradd -u 500 -g dba -G oinstall oracle

You can verify user account information by viewing the /etc/passwd file. Here is what you can expect to see after running the useradd command:

oracle:x:500:500::/home/oracle:/bin/bash

You can also use the id command to display the operating system user and group information: $ id

uid=500(oracle) gid=500(dba) groups=500(dba)

On most Linux systems, the default value for the HOME variable is /home/oracle, and the default shell is the Bash shell. You can display the value of HOME and SHELL as follows: $ echo $HOME

$ echo $SHELL

If you need to modify a user, use the usermod command. If you need to remove an operating system user, use the userdel command. You need root privileges to run the userdel command. This example removes the oracle user from the server:

# userdel oracle

Step 2. Ensure That the Operating System Is Adequately

Configured

The tasks associated with this step vary somewhat for each database release and operating system. You must refer to the Oracle installation manual for the database release and operating system vendor to get the exact requirements. To perform this step, you’re required to verify and configure operating system components such as the following:

Memory and swap space

System architecture (processor)

Free disk space (Oracle now takes almost 5GB of space to install)

Operating system version and kernel

Operating system software (required packages and patches)

Run the following command to confirm the size of memory on a Linux server: $ grep MemTotal /proc/meminfo

To verify the amount of memory and swap space, run the following command: 6

CHAPTER 1 ■ INSTALLING THE ORACLE BINARIES

$ free -t

To verify the amount of space in the /tmp directory, enter this command: $ df -h /tmp

To display the amount of free disk space, execute this command:

$ df -h

To verify the operating system version, enter this command:

$ cat /proc/version

To verify kernel information, run the following command:

$ uname -r

To determine whether the required packages are installed, execute the following and provide the required package name:

$ rpm -q

Again, database server requirements vary quite a bit by operating system and database version. You can download the specific installation manual from Oracle’s web site at www.oracle.com/documentation.


Note
The OUI displays any deficiencies in operating system software and hardware. Running the installer is covered in the “Step 5” section.

Step 3. Obtain the Oracle Installation Software

Usually, the easiest way to obtain the Oracle software is to download it from the Oracle software web site: www.oracle.com/technology/software. Navigate to the software download page, and download the Oracle database version that is appropriate for the type of operating system and hardware on which you want to install it (Linux, Solaris, Windows, and so on).

Step 4. Unzip the Files

Before you unzip the files, I recommend that you create a standard directory where you can place the Oracle installation media. You should do this for a couple of reasons: When you come back to a box a week, month, or year later, you’ll want to be able to easily find the installation media.

Standard directory structures help you organize and understand quickly what has or hasn’t been installed on the box.

Create a standard set of directories to contain the files used to install the Oracle software. I like to store the installation media in a directory such as /ora01/orainst and then create a subdirectory there for each version of the Oracle software that is installed on the box: $ mkdir -p /ora01/orainst/10.2.0.1

$ mkdir -p /ora01/orainst/10.2.0.4

7

CHAPTER 1 ■ INSTALLING THE ORACLE BINARIES

$ mkdir -p /ora01/orainst/11.2.0.1

Now, move the installation files to the appropriate directory, and unzip them there: $ mv linux_11gR2_database_1of2.zip /ora01/orainst/11.2.0.1

$ mv linux_11gR2_database_2of2.zip /ora01/orainst/11.2.0.1

Use the unzip command for unbundling zipped files. The Oracle Database 11
g
release 2 software is unzipped as shown:

$ unzip linux_11gR2_database_1of2.zip

$ unzip linux_11gR2_database_2of2.zip

On some installations of Oracle, you may find that the distribution file is provided as a compressed cpio file. You can uncompress and unbundle the file with one command as follows: $ cat 10gr2_db_sol.cpio.gz | gunzip | cpio -idvm

Step 5. Configure the Response File, and Run the Installer

You can run the OUI in one of two modes: graphical or silent. Typically, DBAs use the graphical installer.

However, I strongly prefer using the silent install option for the following reasons: Silent installs don’t require the availability of X Window System software.

You avoid performance issues with remote graphical installs that can be extremely slow when trying to paint screens locally.

Silent installs can be scripted and automated. This means every install can be performed with the same consistent standards regardless of which team member is performing the install (I even have the SA install the Oracle binaries this way).

The key to performing a silent install is to use a response file. After unzipping the Oracle software, find the sample response files that Oracle provides:

$ find . -name "*.rsp"

Depending on the version of Oracle and the operating system platform, the names and number of response files that you find may be quite different. The next two subsections show two scenarios: an Oracle Database 10
g
release 2 and an Oracle Database 11
g
release 2 silent install.

Oracle Database 10g Scenario

A variety of default response files ship with the Oracle installation software. These files vary somewhat depending on the database version and operating system. For example, here are the response files provided in an Oracle Database 10
g
release 2 (Solaris) environment: 8

CHAPTER 1 ■ INSTALLING THE ORACLE BINARIES

$ find . -name "*.rsp"

./response/emca.rsp

./response/custom.rsp

./response/enterprise.rsp

./response/dbca.rsp

./response/netca.rsp

./response/standard.rsp

./install/response/se.rsp

./install/response/pe.rsp

./install/response/ee.rsp

./inst.rsp

Copy the enterprise.rsp file to the current working directory, and give it a different name (so that you always have the original to reference):

$ cp response/enterprise.rsp inst.rsp

Edit the inst.rsp file with an operating system utility such as vi, and provide values for the response file variables. Here are the minimal values you need to provide for a typical Oracle Database 10
g
installation:

RESPONSEFILE_VERSION=2.2.1.0.0

# install group, I use dba, many others use oinstall

UNIX_GROUP_NAME=dba

FROM_LOCATION="/ora01/orainst/10.2.0.1/stage/products.xml"

n_configurationOption=3

s_nameForDBAGrp=dba

s_nameForOPERGrp=dba

ORACLE_HOME=/ora01/app/oracle/product/10.2.0.4/db_1

ORACLE_HOME_NAME=OHOME10


Note
Refer to the Oracle Universal Installer Guide available on Oracle’s OTN web site for a complete description of all response-file variables.

I don’t modify any other response-file values in this scenario. I leave them blank or leave them with the defaults already specified. Now, run the runInstaller utility in silent mode, providing a full directory path to the response file location:

$ ./runInstaller -ignoreSysPrereqs -force -silent \

-responseFile /ora01/orainst/10.2.0.1/inst.rsp


Note
On Windows, the setup.exe command is equivalent to the Linux/Unix runInstaller command.

9

CHAPTER 1 ■ INSTALLING THE ORACLE BINARIES

The installer displays quite a bit of output. If all system checks pass, it takes a few minutes to install the Oracle software. After it successfully completes, you should see this message: The following configuration scripts /ora01/app/oracle/product/10.2.0.4/db_1/root.sh need to be executed as root for configuring the system.

Log in as root, and run root.sh:

# /ora01/app/oracle/product/10.2.0.4/db_1/root.sh

I usually accept the defaults. After root.sh runs, you should have a good installation of the Oracle software and can create a database (database creation is covered in Chapter 2).

Oracle Database 11g Scenario

Here are the response files provided with an Oracle Database 11
g
release 2 on a Linux server: $ find . -name "*.rsp"

./response/db_install.rsp

./response/dbca.rsp

./response/netca.rsp

Copy one of the response files so that you can modify it. This example copies the db_install.rsp file to the current working directory and names the file inst.rsp:

$ cp response/db_install.rsp inst.rsp

Keep in mind that the format of response files can differ quite a bit depending on the Oracle database version. For example, there are major differences from Oracle Database 11
g
release 1 to Oracle Database 11
g
release 2. When you install a new release, you have to inspect the response file and determine which parameters must be set. Here is a partial listing of an Oracle Database 11
g
release 2

response file (the first two lines of the following file should be on one line, but is placed on two lines in this book to fit on one page):

oracle.install.responseFileVersion=

/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=ora03

UNIX_GROUP_NAME=dba

oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=dba

INVENTORY_LOCATION=/ora01/orainst/11.2.0.1/database/stage/products.xml SELECTED_LANGUAGES=en

ORACLE_HOME=/oracle/app/oracle/product/11.2.0/db_1

ORACLE_BASE=/oracle/app/oracle

DECLINE_SECURITY_UPDATES=true

oracle.install.db.InstallEdition=EE

oracle.install.db.isCustomInstall=true

Be sure to modify the appropriate parameters for your environment. If you’re unsure what to set the ORACLE_HOME and ORACLE_BASE values to, see the this chapter’s first section, “Understanding the Optimal Flexible Architecture,” which has a description of the OFA standard directories.

There are sometimes idiosyncrasies to these parameters that are specific to a release. For example, in Oracle Database 11
g
release 2, if you don’t want to specify your My Oracle Support (MOS) login information, then you need to set the following:

10

CHAPTER 1 ■ INSTALLING THE ORACLE BINARIES

DECLINE_SECURITY_UPDATES=true

If you don’t set DECLINE_SECURITY_UPDATES to TRUE, then you’re expected to provide your MOS login information. If you don’t do so, the installation won’t succeed.

After you’ve configured your response file, you can run the Oracle installer in silent mode. Notice that you have to put the entire directory path for the location of your response file: $ ./runInstaller -ignoreSysPrereqs -force -silent -responseFile \

/ora01/orainst/11.2.0.1/database/inst.rsp

The previous command is entered on two lines. The first line is continued to the second line via the

\ (backward slash) character.

If you encounter errors with the installation process, you can view the associated log file. Each time you attempt to run the installer, it creates a log file with a unique name that includes a timestamp. The log file is created in the oraInventory/logs directory. You can stream the output to your screen as the OUI writes to it:

$ tail -f

The log file is named something like:

installActions2009-04-25_11–42-51AM.log

If everything runs successfully, in the output, you’re notified that you need to run the root.sh script as the root user:

#Root scripts to run

/oracle/app/oracle/product/11.2.0/db_1/root.sh

Run the root.sh script as the root operating system user. After you do that, you should be able to create an Oracle database (database creation is covered in Chapter 2).


Note
On Linux/Unix platforms, the root.sh script contains commands that must be run as the root user. This script needs to modify the owner and permissions of some of the Oracle executables (such as the nmo executable).

Some versions of root.sh prompt you as to whether you want to accept the default values. Usually, it’s suitable to accept the default values.

Step 6. Troubleshoot Any Issues

Other books

Read To Me by Nona Raines
Sapphire Crescent by Reid, Thomas M.
The Man with the Lead Stomach by Jean-FranCois Parot
The Virgin Diet by JJ Virgin
The Catcher's Mask by Matt Christopher, Bert Dodson
Quotable Quotes by Editors of Reader's Digest