Install Oracle under red hat

Source: Internet
Author: User

Abstract: This article describes how to install the oracle9.2.0 database in the RedHat Linux9 environment.

Keyword: oracle9i RedHat Linux9 Kernel Parameter environment variable

Oracle817 is always used in the RedHat linux7.1 environment. Sort out the system a few days ago and upgrade it as a whole. Install Oracle9i in the RedHat Linux9 environment. It took several days to find a lot of materials and posts on the internet, sort them out, and finally install oracle9.2.0 (Oracle9i Enterprise Edition Release on redhat9 ). Record the installation process for future reference.

I. Basic information:
My machine Configuration:
CPU: P4 1.5g
Memory: 256 MB
Hard Disk: 40 GB

Hard Disk Partition:
Windows partition C, D, E, a total of 25 GB.
Linux swap: 1.5 GB
Linux ext2: 12 GB

Operating System: radhat9 (Linux kernel 2.4.20-8)

According to the article on how to install oracle on the Internet, Oracle requires at least two times the memory size for Linux swap partitions, that is, M. Of course, the larger the size, the better. When I first used oracle817 in linux7.1, the size of my swap partition was 512 MB. During this installation of Oracle9i, I found that when the database creation stage was reached, the error "out of momery" is prompted, and the installation process is forced to stop. It is estimated that swap is a little small. There is no way to re-partition the disk space and increase the swap partition to 1.5 GB, the installation was successful and safe. Pai_^

Linux requires at least 7 GB of file partitions. Because the requirements for installing oracle in Linux are demanding, I chose to install all the commands when installing RedHat Linux9, in this way, the system does not need to install the package in the later Oracle9i installation, saving a lot of trouble, this method was learned when oracle817 was installed under RedHat linux7.1 (I also recommend that you install all the articles on the Internet ). The installation of RedHat Linux9 requires about 4g space, while the Oracle9i database requires about 2 GB space ~ 2.5 GB space), so the total is about 7 GB.

The above data is for reference only. In a word, the larger the partition space for Linux, the better, the more favorable the Oracle operation. Pai_^

Ii. preparations:

1. Obtain Oracle 9i
Oracle920_for_linux is my site (Tsinghua FTP Server), spent a night to download, a total of 3 compressed files, names are:

Lnx_920_disk1.cpio.gz is 527 MB (553,607,967 bytes)
Lnx_920_disk2.cpio.gz is 561 MB (588,799,187 bytes)
Lnx_920_disk3.cpio.gz is 421 MB (442,089,854 bytes)

The total size of the three files is 1.47 GB (1,584,497,008 bytes ).

2. Remarks
The article on the internet is generally described as a consideration of compatibility. Before installation, you must install or replace some RPM packages on the RedHat system and determine the dependency between the RPM packages,

For example:

In my opinion, as long as you have selected all the RedHat Linux9 installation options, do not install or replace these RPM packages. (I do not know if this is the case, but at least I did not install or replace these RPM packages on my own machine. Another article said that the free download of red hat9 on the Internet is an incomplete version. It does not own the glibc installation package of the corresponding version and needs to be installed and replaced by glibc, maybe the RedHat Linux9 I downloaded is "completely", so I didn't perform any operations on glibc either. * _ ^ Of course, it should be discussed separately when installing in RedHat linux7x ).

In addition, when installing Oracle9i in some articles, you need to select the JDK version for installation, directly install Oracle9i (because the Oracle Installation program requires JDK support, it is estimated that RedHat Linux9 selects the "Install all" method, and development has been installed. This may be a bit confusing to those who have installed Oracle8i in redhat7x *_*).

Iii. configuration operations:

Since it saves a lot of annoying pre-installation operations, we will perform some substantive operations below. Starting from here, we will officially enter the Oracle9i installation process.

1. Set kernel parameters to adjust traffic signals and shared memory:
Oracle9i uses Linux shared memory, swap zone and other resources for work. If the kernel parameter settings of the system cannot meet the requirements of Oracle, various problems may occur during installation or use, therefore, we recommend that you configure or modify the kernel parameters of these systems.

Open the/etc/sysctl. conf file, write the following data to the end of sysctl. conf, and save it:

Kernel. shmmax = 536870912
Kernel. shmmni = 4096
Kernel. Shmall = 2097152
Kernel. SEM = 250 32000 100 128
FS. File-max = 65536
Net. ipv4.ip _ local_port_range = 1024 65000

Among them, kernel. shmmax is the maximum size of the shared memory segment, and kernel. shmmni is the minimum size of the shared memory segment. Go to the/proc/sys/kernel directory and run the following commands:
# Cat shmmax
# Cat shmmni
# Cat Shmall
View the values of kernel. shmmax, kernel. shmmni, and kernel. Shmall.

In an article, I can see that the calculation method of kernel. shmmax is:
Kernel. shmmax = 1024*1024 * RAM (m)/2 (at least ).

Run the following command:
# Cat SEM

You can view the value of kernel. SEM. 250 is the semmsl value, 32000 is the semmns value, 100 is the semopm value, and 128 is the semmni value.

Next, open the/etc/security/limits. conf file, add the following data to the end of limits. conf, and save:
Oracle soft nofile 65536
Oracle hard nofile 65536
Oracle soft nproc 16384
Hard nproc 16384

This is to set Oracle file requirements.

When/etc/sysctl. CONF file and/etc/security/limits. after the conf file is modified and saved, restart the (reboot) RedHat Linux9 system so that these parameters can take effect.

If you enter the/proc/sys/kernel path and run the preceding command again, the set parameters have taken effect.

2. Create an oracle user account and installation directory
If you have previously installed Oracle 8i for Linux, you should know that before installing Oracle, you must first add a user named oracle in the Linux operating system, and a group dedicated to Oracle DBAs. Specific users (non-root users) are required for Oracle Installation and Use. According to Oracle standards, three special users and user groups need to be added. To facilitate the installation, we have created two groups, one for installation and the other for management, and assigned the Oracle Installation and use to a specific user.

Log on as a root user and perform the following operations to create two groups (DBA group and oinstall group) and an oracle user. The operation command is as follows:
# Groupadd DBA
# Groupadd oinstall
# Useradd-G oinstall-g dba Oracle
# Passwd Oracle
Set the Oracle password.

The Oracle installation location shall comply with the ofa (optimal flexible architecture) specification. The typical installation of Oracle9i requires at least two installation points: one is to install the basic running program, the other is to store the database, and ensure that oracle users have writable permissions on these two directories.

Run the following command to create an oracle mount point ):

# Mkdir/opt/Oracle9i
# Mkdir/opt/Oracle9i/product
# Mkdir/opt/Oracle9i/product/9.2.0
# Chown-r oracle. oinstall/opt/Oracle9i
# Mkdir/var/opt/Oracle9i
# Chown oracle. DBA/var/opt/Oracle9i
# Chmod 755/var/opt/Oracle9i

3. Set Environment Variables
Log On As an oracle user, open the Edit/home/Oracle/. bash_profile file, add the following data lines at the end of the file, and save:
Export ld_assume_kernel = 2.4.1
Export oracle_base =/opt/Oracle9i
Export ORACLE_HOME =/opt/Oracle9i/product/9.2.0
Export oracle_sid = orcl (Database Sid, which can be modified. uppercase letters are recommended)
Export oracle_term = xterm
Export tns_admin = $ ORACLE_HOME/Network/admin
Export lang = en_us
Export ora_nls33 = $ ORACLE_HOME/ocommon/NLS/admin/Data
Export Path = $ path: $ ORACLE_HOME/bin

Classpath = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
Classpath = $ classpath: $ ORACLE_HOME/Network/jlib
Export classpath
# Export display = hostip: 0.0

In this way, oracle users carry these environment variables each time they log on.

Here: ORACLE_HOME is the installation directory of the system software, and oracle_sid is the SID of the database. You can set it here.
The last sentence "export display = hostip: 0.0" was mentioned in some articles on the Internet about installing oracle. I tried to add it, but when I log on as an oracle user, hostip error prompt appears, and can not log on normally, I checked some information is not resolved (I know Linux limited, if you know the reason please tell me:, thanks), So I commented out the environment variables. Fortunately, this does not affect the installation of Oracle9i.

Note ^ _ ^: environment variable configuration is particularly important. Many failures in installing oracle in Linux are caused by incorrect environment variables. The configuration of environment variables directly affects the installation and configuration of Oracle9i. This reminds you to focus more on setting environment variables.

Edit and save/home/Oracle /. after the bash_profile file, we recommend that you log out of the Oracle user first, and then log on again as an oracle user, in this way, you can test whether the configured environment variable has an error (for example, the hostip error mentioned above ).

Next, you can install oracle9.2.0 for Linux.

Iv. Installation Process:

1. decompress the Installation File
Log on as a root user, create a directory/setup, and compress three oracle920_for_linux files:

Lnx_920_disk1.cpio.gz is 527 MB (553,607,967 bytes)
Lnx_920_disk2.cpio.gz is 561 MB (588,799,187 bytes)
Lnx_920_disk3.cpio.gz is 421 MB (442,089,854 bytes)

Copy to directory/setup. (If you have not created a/setup directory, you 'd better create one &_&)

Go to the/setup directory and decompress the three files. The operation command is as follows:
# Cd/setup
# Gunzip lnx_920_disk1.cpio.gz
# Gunzip lnx_920_disk1.cpio.gz
# Gunzip lnx_920_disk1.cpio.gz

After decompression, three files with the following names are generated:


Then unpack the cpio package and execute the following command:

# Cpio-idmv <lnx_920_disk1.cpio
# Cpio-idmv <lnx_920_disk2.cpio
# Cpio-idmv <lnx_920_disk3.cpio

After all three packages are decompressed, three installation folders are generated, named disk1, disk2, and disk3 respectively. Log out of the root user and log on to the Oracle user for installation.

2. Installation Process

Log On As an oracle user for installation. Go to the/Setup/disk1 directory and run the following command:

# Cd/Setup/disk1

After a while, the graphical interface of Oracle universal Installer (Oui) will appear. Follow the prompts to click "Next" to install it.

Unfortunately, during the installation, I did not take the installation process interface as an image and save it. I was too lazy to reinstall it, so I could not use the image for further description. The following sections describe and describe in text. If you have any unclear information, please forgive me. :(

Keep the default settings for the first few steps. When you enter "Unix group name", enter the group name "dba" and click "Next ".

At this time, Oracle universal installer will generate an orainstroot used to establish Oracle inventory. sh file. A prompt box is displayed. You need to use the root identity to execute this/orainstroot. sh file. In this case, you can open a new terminal window (terminal) and follow the directory path written in the prompt window to run orainstroot as the root user. sh. After the installation is complete, return to the prompt window and press the "continue" button to continue the installation.

When you enter the global database name and database Sid window, you will find that the database Sid is displayed according to the oracle_sid = your_sid set in the environment variable. You only need to enter the global database name.

The subsequent installation will follow the default settings.

When you encounter a form that sets the character set of the database, do not select the default database character type. Character Set is the most important setting when an Oracle database is created. If the setting is incorrect, it is likely that Chinese data cannot be normally accessed during use. Here we 'd better select the drop-down box of the third option, select simplifiled Chinese zhs16gbk, and press next to go to the next step.

Before the Oracle universal installer starts copying the installation file, the Oracle9i product abstract to be installed is displayed. After confirmation, press the "Install" button to start the installation, this will be a long process. Of course, this is related to your machine configuration, computing speed, and memory size.

Because my installation program is on the hard disk, there is no such trouble as the installation from the CD (for details about how to install from the CD, please refer to relevant information on the network. ^_^ Actually, I have no experience installing it from a CD. ^_^ ).

There will be two errors during the next installation process. I have also mentioned these errors in all the articles on the Internet. I will also describe them here:

The first error is in the linking phase. When the installation Progress reaches 69%, the Oracle universal installer prompts that the file "/soft/Oracle/Network/lib/" has a problem, at this time, we can ignore it for the time being, select "Ignore", and ignore it. After the entire installation process is complete, we will solve this problem. (I have read a lot of documents, and I am doing the same. Alas, I cannot understand that there will also be many error messages when installing Oracle8i in RH7 .)

The second error is also in the linking phase. When the installation Progress reaches 84%, Oracle universal installer prompts "error in invoking target install of makefile $ ORACLE_HOME/CTX/lib/
At this time, do not select ignore. You can fix this error. Open the $ ORACLE_HOME/CTX/lib/ file and edit it as follows. Then, move the cursor to row 1,365th, that is, the line "inso_link =", and then add the sentence "$ (ldlibflag) DL" to the end of "inso_link =-L $ (ctxlib) $ (ldlibflag) m, after modification, it looks like this:

Inso_link =-L $ (ctxlib) $ (ldlibflag) M $ (ldlibflag) dL
$ (Ldlibflag) SC _ca $ (ldlibflag) SC _fa $ (ldlibflag) SC _ex
$ (Ldlibflag) SC _da $ (ldlibflag) SC _ut $ (ldlibflag) SC _ch
$ (Ldlibflag) SC _fi $ (llibctxhx) $ (ldlibflag) c
-Wl,-rpath, $ (ctxhome) Lib $ (corelibs) $ (compeobjs)

Save the $ ORACLE_HOME/CTX/lib/ file, return to the error Prompt window, and click "retry" to continue the installation.

After the database is created and all the files are copied to the system by the installer, the Oracle universal installer prompts a message window asking you to run root as root. sh program, Root. SH is located in the directory pointed to by ORACLE_HOME. In this case, you need to open a new terminal window (terminal) and log in as an oracle user. Run the following command:
# Su Root
# Cd/opt/Oracle9i/product/9.2.0
#./Root. Sh

After running, the system will prompt the following information:
Running oracle9 root. Sh script...
/Nthe following environment variables are set:
Oracle_owner = Oracle
ORACLE_HOME =/opt/Oracle9i/product/9.2.0

Enter the full pathname of the local bin directory: [/usr/local/bin]

Enter the default directory/opt/Oracle9i/product/9.2.0/bin.

After the execution is complete, if everything is normal, the Oui will display the "the installation of Oracle9i Database was successful." prompt message, indicating that the oracle920 database has been successfully installed on Redhat Linux9! It's really not easy! * _ ^

If you still need to install other content at this time, press the "next install" button to install it. Otherwise, press the "exit" button to exit Oui installation.

The last step is to fix the previous error, that is, the "/soft/Oracle/Network/lib/" error occurred when the linking stage was installed to 69%.

Run the following command as an oracle user:

# Cd $ ORACLE_HOME/Network/lib
# Make-F install
Then, edit the row 13-14 of the $ ORACLE_HOME/CTX/lib/ file, which consists:

Ctxhx: $ (ctxhxobj)
$ (Link) $ (ctxhxobj) $ (inso_link)
Ctxhx: $ (ctxhxobj)
$ (Link)-LDL $ (ctxhxobj) $ (inso_link)
Save the $ ORACLE_HOME/CTX/lib/ file.

Run the following command:

# Make-F $ ORACLE_HOME/CTX/lib/ install

Fix the error.

So far, the oracle920 database has been fully installed on Redhat Linux9.


V. Use of cancel9i

After the Oracle database is installed, it is automatically started. The following describes the actual operations.
Log on to the database as an oracle user. You can use a terminal window (terminal) to perform the following operations:

[Oracle @ Linux Oracle] $ sqlplus "/As sysdba" // log on to the database as a sysdba user

The following message is displayed:
SQL * Plus: Release on Thu Feb 26 15:53:31 2004
Copyright (c) 1982,2002, Oracle Corporation. All rights reserved.

Oracle9i Enterprise Edition Release
With the partitioning OLAP and Oracle Data Mining options
Jserver release


Run the shudown command to close the database:
SQL> Shutdown
Database closed.
Database dismounted.
Oracle instance shut down.

Start the Oracle 9i Database as follows:
[Oracle @ Linux Oracle] $ sqlplus "/As sysdba"

SQL * Plus: Release on Thu Feb 26 16:00:59 2004
Copyright (c) 1982,2002, Oracle Corporation. All rights reserved.
Connected to an idle instance.

SQL> startup

Oracle instance started.

Total system global area 235999352 bytes
Fixed size 450680 bytes
Variable Size 201326592 bytes
Database buffers 33554432 bytes
Redo buffers 667648 bytes
Database mounted.
Database opened.

Start the Oracle 9i listener as follows:
Note: Oracle listeners provide interfaces for client connections.
[Oracle @ Linux Oracle] $ LSNRCTL

Linux: Version on 26-feb-2004 16:10:17
Copyright (c) 1991,200 2, Oracle Corporation. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
Starting/opt/Oracle9i/product/9.2.0/bin/tnslsnr: Please wait...

Tnslsnr for Linux: Version
System parameter file is/opt/Oracle9i/product/9.2.0/Network/admin/listener. ora
Log messages written to/opt/Oracle9i/product/9.2.0/Network/log/listener. Log
Listening On: (description = (address = (Protocol = IPC) (Key = EXTPROC )))
Listening On: (description = (address = (Protocol = TCP) (host = Linux) (Port = 1521 )))

Connecting to (description = (address = (Protocol = IPC) (Key = EXTPROC )))
Status of the listener
Alias listener
Version tnslsnr for Linux: Version
Start date 26-feb-2004 15:28:23
Uptime 0 days 0 HR. 0 min. 0 sec
Trace Level off
Security off
SNMP off
Listener parameter file/opt/Oracle9i/product/9.2.0/Network/admin/listener. ora

Listener log file/opt/Oracle9i/product/9.2.0/Network/log/listener. Log

Listening endpoints summary...
(Description = (address = (Protocol = IPC) (Key = EXTPROC )))
(Description = (address = (Protocol = TCP) (host = Linux) (Port = 1521 )))
Services summary...
Service "orcl. Soft" has 1 instance (s ).
Instance "orcl", status unknown, has 1 handler (s) for this service...
Service "plsextproc" has 1 instance (s ).
Instance "plsextproc", status unknown, has 1 handler (s) for this service...
The command completed successfully

Disable the Oracle 9i listener as follows:
[Oracle @ Linux Oracle] $ LSNRCTL

Linux: Version on 26-feb-2004 16:15:28
Copyright (c) 1991,200 2, Oracle Corporation. All rights reserved.
Welcome to LSNRCTL, type "help" for information.

Connecting to (description = (address = (Protocol = IPC) (Key = EXTPROC )))
The command completed successfully

Start Oracle Web server as follows:
[Oracle @ Linux Oracle] $ CD $ ORACLE_HOME/Apache/bin
[Oracle @ Linux Oracle] $./startjserv. Sh
/Opt/Oracle9i/product/9.2.0/Apache/bin/apachectl start: httpd started

After starting Oracle Web server, the default port number is 7777. In the browser address bar of the client, enter

Http:// 7777/

Here, XXX. XX. XXX. XXX represents the IP address, or you can use the network machine name. If the Oracle HTTP Server Page appears in the browser, it indicates that the Oracle Web server runs normally.

To disable Oracle Web server, perform the following operations:
[Oracle @ Linux Oracle] $ CD $ ORACLE_HOME/Apache/bin
[Oracle @ Linux Oracle] $./stopjserv. Sh
/Opt/Oracle9i/product/9.2.0/Apache/bin/apachectl stop: httpd stopped

Start Database Configuration assistant with the following command:
[Oracle @ Linux Oracle] $ dbca &

Start Oracle Net configuration assistant with the following command:
[Oracle @ Linux Oracle] $ netca &

Start Enterprise Manager Configuration assistant with the following command:
[Oracle @ Linux Oracle] $ emca &

Oemapp commands are as follows:
[Oracle @ Linux Oracle] $ oemapp dbastudio
[Oracle @ Linux Oracle] $ oemapp Console
[Oracle @ Linux Oracle] $ oemapp txtmgr
[Oracle @ Linux Oracle] $ oemapp ocmcli
[Oracle @ Linux Oracle] $ oemapp lmviewer
[Oracle @ Linux Oracle] $ oemapp OCM
[Oracle @ Linux Oracle] $ oemapp esmsrv
[Oracle @ Linux Oracle] $ oemapp OPM
[Oracle @ Linux Oracle] $ oemapp CPTA
[Oracle @ Linux Oracle] $ oemapp ESM
[Oracle @ Linux Oracle] $ oemapp jdbctest
[Oracle @ Linux Oracle] $ oemapp oemutil
[Oracle @ Linux Oracle] $ oemapp topsess
[Oracle @ Linux Oracle] $ oemapp dataguard
[Oracle @ Linux Oracle] $ oemapp Worksheet
[Oracle @ Linux Oracle] $ oemapp CP
[Oracle @ Linux Oracle] $ oemapp sdoadvisor
[Oracle @ Linux Oracle] $ oemapp pm

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.