Install Oracle 10g R2 in CentOS 6.3 (x86_64)

Source: Internet
Author: User

I. Hardware requirements
Ii. Software
Iii. System Installation notes
4. system preparation before Oracle Installation
5. install and configure Oracle
6. Upgrade Oracle to patchset 10.2.0.4
7. Use rlwrap to call historical commands in sqlplus

I. Hardware requirements

1. Memory & swap

Minimum: 1 GB of RAM
Recommended: 2 GB of RAM or more

Check memory # grep MemTotal/proc/meminfo # grep SwapTotal/proc/meminfo

2. Hard Disk

Since CentOS is installed almost 4 ~ 5 GB, plus Oracle and so on, so please prepare at least 10 Gb hard disk space.

Check disk status # df-h

Ii. Software

System Platform: CentOS 6.3 (x86_64)

CentOS-6.3-x86_64-bin-DVD1.iso

Oracle version: Oracle 10g R2

10201_database_linux_x86_64.cpio

Patch: p6810189_10204

P6810189_10204_Linux-x86-64.zip

Iii. System Installation notes

During system installation, you must install the desktop mode. Otherwise, oracle cannot be installed. In addition, do not enable SELinux. oracle does not recommend SELinux, and CentOS Firewall should be temporarily disabled to reduce installation troubles. To prevent garbled characters during Oracle Installation, we recommend that you use English as the system language to install Oracle.

The system commands described in this article are marked as "#", which indicates the root permission, and "$" indicates the oracle permission.

4. system preparation before Oracle Installation

First, log in with the root account for some pre-set jobs.

1. Disable firewall and SELinux

# Setup

# Vi/etc/selinux/config

Modify SELINUX = disabled and restart.
If you do not want to restart the system, run the setenforce 0 command.

2. Install the dependency package

The installation package required by the Oracle official documentation:

Check whether the Oracle package has been installed:

Use yum to install the required packages:

# Yum-y install binutils compat-libstdc ++-33 compat-libstdc ++-33. i686 elfutils-libelf-devel gcc-c ++ glibc. i686 glibc-common glibc-devel glibc-devel.i686 glibc-headers ksh libaio. i686 libaio-devel libaio-devel.i686 libgcc. i686 libstdc ++. i686 libstdc ++-devel make sysstat

Finally, you must install libXp Library. Otherwise, a java Exception occurs during Oracle installation.

# Yum install libXp

3. Create Oracle users and groups

Only the single host environment is discussed here, regardless of the configuration of the RAC environment.

Run the following command to add the users and groups required for oracle installation.

(1) create a group oinstall
# Groupadd oinstall

(2) create a group dba
# Groupadd dba

(3) Add the user oracle and add it to the oinstall and dba groups.
# Useradd-m-g oinstall-G dba oracle

(4) test whether the oracle account has been created
# Id oracle

(5) Create a New oracle Password
# Passwd oracle

4. Add oracle users to The sudo Group

# Vi/etc/sudoers

Find
Root ALL = (ALL) ALL
This line, and add it below
Oracle ALL = (ALL) ALL
Enter wq! (Because this is a read-only document, you need to add it !) And press Enter

5. Configure System Kernel Parameters

# Vi/etc/sysctl. conf

Modify and add the following content:

Kernel. shmall = 4294967296 // indicates the total amount of shared memory that can be used by the system at one time (in page ). The default value is 2097152, which does not need to be modified.
Kernel. shmmax = 68719476736 // defines the maximum size of the shared memory segment (in bytes ). The default value is 32 M. For oracle, the default value is too low and is usually set to 2G.
Kernel. shmmni = 4096 // used to set the maximum number of shared memory segments within the system. The default value of this parameter is 4096. Usually no need to change
Kernel. sem = 250 32000 100 128 // indicates the set semaphore
Net. ipv4.ip _ local_port_range = 1024 65000
Net. core. rmem_default = 4194304 // default Receiving Window Size
Net. core. rmem_max = 4194304 // maximum size of the Receiving Window
Net. core. wmem_default = 262144 // default sending window size
Net. core. wmem_max = 262144 // maximum size of the sending window

If there are some parameters that are repeated with the current ones, modify them to the ones provided on the file.

After editing, save and execute:

# Sysctl-p

Enable the change.

6. edit/etc/security/limits. conf.

# Vi/etc/security/limits. conf

Add the following four lines
Oracle soft nproc 2047
Hard nproc 16384
Oracle soft nofile 1024
Oracle hard nofile 65536

7. edit/etc/pam. d/login.

# Vi/etc/pam. d/login

Add the following two lines
Session required/lib64/security/pam_limits.so
Session required pam_limits.so

8. Modify/etc/profile

# Vi/etc/profile

Add the following code to the profile file.

if [ $USER = "oracle" ]; then    if [ $SHELL = "/bin/ksh" ]; then        ulimit -p 16384        ulimit -n 65536    else        ulimit -u 16384 -n 65536    fifi 

9. Modify the Linux release version

Since CentOS 6 was not released when Oracle 10g was released, Oracle 10g did not confirm support for CentOS 6. You need to modify the file so that Oracle 10g supports CentOS 6. We need to manually modify the Linux release notes so that Oracle 10 Gb supports CentOS 6. Edit the/etc/redhat-release file # vi/etc/redhat-release and change CentOS release 6.3 (Final) to redhat 4.

10. Create an Oracle installation folder and a data storage folder

# Mkdir/opt/oracle
# Mkdir/opt/oracle/102
# Chown-R oracle: dba/opt/oracle

11. Configure the Linux host to check whether there is a localhost record in the/etc/hosts file (point to 127.0.0.1). If not, some problems may occur when configuring the Oracle listener later, as a result, the listener cannot be started. You can manually add this record here.

After completing these settings, log out of the root account and log on to the system again with the oracle account.

12. Configure oracle user environment variables

$ Cd/home/oracle
$ Vi. bash_profile
Modify and add the following content

ORACLE_BASE =/opt/oracle // Oracle installation folder created above
ORACLE_HOME = $ ORACLE_BASE/102
ORACLE_SID = orcl
LD_LIBRARY_PATH = $ ORACLE_HOME/lib
PATH = $ PATH: $ ORACLE_HOME/bin: $ HOME/bin

Export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

Save and run the following command to make the settings take effect:

$ Source/home/oracle/. bash_profile

5. install and configure Oracle

1. decompress the Installation File

Save the downloaded 10201_database_linux_x86_64.cpio to the/opt/oracle
Return to Terminal Mode and enter the oracle Folder:

$ Cd/opt/oracle

Decompress 10201_database_linux_x86_64.cpio

$ Cpio-idmv <10201_database_linux_x86_64.cpio

Next we will see a series of decompression actions.

After decompression, you will see the database folder in the same folder. Please enter the database Folder:

$ Cd database

Prepare to execute database installation. If your centos is a Chinese environment, Chinese garbled characters will appear during installation. Please run the following command:

$ Export LANG = en_US

Then execute

$./RunInstaller

If you cannot see the installation interface, run the following command in the root account before running the installer: # export DISPLAY =: 0.0
# Xhost +
$./RunInstaller

Error: Exception in.../lib/i386/libawt. so: libXp. so.6: cannot open shared object file: No such file or directory

Solution:

# Yum-y install libXp. i686

Analysis: Check the error message "/lib/i386/libawt. so: libXp. so.6: cannot open shared object file: No such file or directory ", libXp needs to install the i386 package, but cannot install the X64 package. The preceding figure shows that 64-bit linux requires the 64-bit libXp package to be installed, which causes this problem.

Execute again

$./RunInstaller

Error: Exception in.../lib/i386/libawt. so: libXt. so.6: cannot open shared object file: No such file or directory

Solution:

# Yum-y install libXt. i686

Execute again

$./RunInstaller

Error: Exception in.../lib/i386/libawt. so: libXtst. so.6: cannot open shared object file: No such file or directory

Solution:

# Yum-y install libXtst. i686

Execute again

$./RunInstaller

Start to execute the installation program.

As related pre-jobs have been completed before, in this step, you only need to select the unix dba Group as dba and enter the database Password shared by accounts such as SYS and SYSTEM. Select Next.

Similarly, select the group as the dba group and press Next

In this step, click Checking Network Configuration requirements as User Verified, and then press Next

The Install Summary screen is displayed, and you only need to press the Install button to start installation.

Installation process...

When the installation progress is about 65%, an error message is displayed:
Error in invoking target 'collector 'of makefile'/opt/oracle/102/sysman/lib/ins_emdb.mk '.

The following error message is displayed in the installation log file in the oraInventory/logs/directory:

This is a bug in the oracle Installation program. You can ignore this error and continue the installation without affecting the system.

In Configuration Assistants, the following error occurs:

OUI-25031: Some of the configuration assistants failed.

Analysis: Host Name ing Error

Solution: Modify the/etc/hosts file and add the ing between the IP address and the host name as follows:

The following error message is displayed:

ORA-27125: unable to create shared memory segment

Solution:

1. determine the user group used to install oracle

# Id oracle

The dba id of the oracle group is 501.

2. Modify Kernel Parameters

Echo "501">/proc/sys/vm/hugetlb_shm_group

You can.

Install it to the database settings assistant. You can select password management here to modify the password. If you do not need to modify the password, you only need to press OK.

Before the installation is complete, the following configuration script appears:

Start a new terminal, su to root.

Execute the two required scripts in sequence.

/Opt/oracle/oraInventory/orainstRoot. sh
/Opt/oracle/102/root. sh

The execution screen is shown in figure.
After the installation is complete, go back to the installation window and press OK to complete all oracle installation. After the installation is complete, the following screen appears.

In this case, you can use the preceding URL as a test. The Logon account can be sys or system.

Http: // CentOS-Oracle: 5560/isqlplus
Http: // CentOS-Oracle: 5560/isqlplus/dba
Http: // CentOS-Oracle: 1158/em

The preceding figure indicates that oracle has been installed properly.

6. Upgrade Oracle to patchset 10.2.0.4

1. upgrade software

A. Disable the instance to be upgraded.

Stop an instance

SQL> SHUTDOWN IMMEDIATE

Stop all background processes related to this instance

$ Emctl stop dbconsole

$ Isqlplusctl stop

$ Lsnrctl stop

B. Back up the Oracle database

C. Run the upgrade package and upgrade the software.

Decompress the patch package p6810189_10204_linux-x86-64.zip. Enter the decompressed directory and run the installation command.

Click "Next"

Specify the details of the Oracle Home Directory and click "Next"

Click "Next"

Click "Next"

Click "Install" to Install the SDK.

Upgrade process...

Run the script/opt/oracle/102/root. sh.

Open a new window and execute the script under the root account.

After the installation is complete, go back to the installation window and press "OK" to complete all oracle installation. After the installation is complete, the following screen appears.

Click "Exit" to Exit the Oracle Upgrade.

If you have not created a database before, upgrade to 10.2.0.4. Then you can create a new database.

If you have already created a database, follow these steps to upgrade the database to version 10.2.0.4.

2. Upgrade the database

A. Update the data dictionary

$ Sqlplus/as sysdba;

SQL> STARTUP UPGRADE

SQL> SPOOL patch. log

SQL> @? /Rdbms/admin/catupgrd. SQL

The upgrade process is long. Please wait.

After the upgrade, the total time is 38 minutes and 26 seconds.

SQL> SPOOL OFF

B. Shut down and restart the database.

SQL> SHUTDOWN IMMEDIATE

SQL> STARTUP

C. Invalid PL/SQL package Compilation

SQL> @? /Rdbms/admin/utlrp. SQL

Compiled successfully.

D. Check whether the upgrade is successful. If the status of all components is valid, the upgrade is successful.

SQL> SELECT COMP_NAME, VERSION, STATUS FROM SYS. DBA_REGISTRY;

E. Check for upgrade errors

SQL> select * from utl_recomp_errors;

F. Modify system compatibility Parameters

SQL> alter system set compatible = '10. 2.0.4.0 'scope = spfile;

SQL> SHUTDOWN

SQL> STARTUP

Upgrade complete.

7. Use rlwrap to call historical commands in sqlplus

If you run SQL * Plus in Linux, you cannot call historical commands. If you enter the wrong character, you cannot press the Backspace or Del key to delete the command. You can use Ctrl + Backspace to delete the command, however, the usage efficiency is seriously affected. The above functions can be implemented using third-party software rlwrap.

Rlwrap provides readline encapsulation (the input of commands in bash is handled by the readline library. That is to say, the up and down arrows show historical commands, Ctrl + r reverse lookup and matching historical input, and Ctrl + w, Ctrl + a and so on are all provided by readline ), that is to say, rlwrap provides an input environment in which various functions of readline can be used. If a program accepts input in the command line, you can use rlwrap to get the same effect as input in bash.

7.1 install rlwrap

Rlwrap encapsulates readline, so you need to install the readline library before installing rlwrap. You can install the SDK by using yum or by downloading the source code package. Official Website: http://utopia.knoware.nl /~ Hlub/uck/rlwrap/

I. yum Installation

The default yum software warehouse in CentOS does not contain the rlwrap package. It must be installed through a third-party yum source.

A. Install a third-party yum Source

# Rpm-ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

# Rpm -- import/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 // import key

By default, the epel. repo and epel-testing.repo profiles are created under/etc/yum. repos. d.

B. Install rlwrap and readline

# Yum install rlwrap readline-devel

II. Install the source code package

If there is no rlwrap or readline in the source of other Linux distributions (for example, the SUSE Enterprise Edition does not have these two packages by default), download these two source code packages for compilation and installation.

A. Install readline

# wget ftp://ftp.gnu.org/gnu/readline/readline-6.2.tar.gz# tar zxvf readline-6.2.tar.gz# cd readline-6.2/# ./configure# make# make install

B. Install rlwrap

# wget http://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.37.tar.gz# tar zxvf rlwrap-0.37.tar.gz# cd rlwrap-0.37/# ./configure# make# make install

7.2 set the system alias of sqlplus

# Vim/home/oracle/. bash_profile

Add at the end:

alias sqlplus='rlwrap sqlplus'alias rman='rlwrap rman'

Log out of oracle and log on again. Now, sqlplus in Linux is used like in cmd.

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: info-contact@alibabacloud.com 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.