Install Oracle 10g R2 in centos 6.3 (x86_64)

Source: Internet
Author: User
Tags stop script

Contents

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 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

Set the followingCodeAdd to 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 a Linux host Check whether the localhost record (pointing to 127.0.0.1) exists in the/etc/hosts file. If it does not exist, some problems may occur when configuring the Oracle listener later, resulting in failure to start the listener, 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 installation. Program : # Export display =: 0.0
# Xhost +
$./Runinstaller

Encountered 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: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. AboveThis problem occurs because 64-bit Linux requires the 64-bit libxp package to be installed.

Execute again

$./Runinstaller

Encountered 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

Encountered 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 Oracle databases

C.Run upgrade package upgrade 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 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.

 

Install Oracle 10g R2 in centos 6.3 (x86_32)

Http://www.cnblogs.com/mchina/archive/2012/11/06/2737472.html

Linux Oracle service startup & stop script and Automatic startup

Http://www.cnblogs.com/mchina/archive/2012/11/27/2782993.html

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.