Install Oracle 11g R2 x64 on centos x64

Source: Internet
Author: User

1. First download the Oracle 11g x64 bit package from the official website.

:

Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_1of2.zip

Http://download.oracle.com/otn/linux/oracle11g/R2/linux.x64_11gR2_database_2of2.zip

2. Installation Package detection and Installation

?

[Root@ Struggle ~] # Rpm-Q binutils compat-libstdc ++-33 Alibaba-libelf elfutils-libelf-devel glibc-common glibc-devel gcc-C ++ libaio-devel libaio libgcc libstdc ++-devel make sysstat unixodbc- devel pdksh

Install several 32-bit packages:

Binutils

Compat-libstdc ++

Compat-libstdc ++ (32 bit)

Elfutils-libelf

Elfutils-libelf-devel

Gcc

Gcc-C ++

Glibc

Glibc (32 bit)

Glibc-common

Glibc-devel

Glibc-devel (32 bit)

Libaio

Libaio (32 bit)

Libaio-devel

Libgcc

Libgcc (32 bit)

Libstdc ++

Libstdc ++ (32 bit)

Libstdc ++-devel

Make

Sysstat

3. Check the inner and swap. It is certainly no problem for the server (if the swap partition is used when the system is installed, skip this step)

?

[Root@ Struggle ~] # Grep memtotal/proc/meminfo

?

[Root@ Struggle ~] # Grep swaptotal/proc/meminfo

(1) create a/home/swap partition file. The file size is 5120000 blocks, and 1 block is 1 K.

?

DdIf=/Dev/Zero of =/home/swap BS =1024 Count =5120000

(2) convert this partition into a swap partition.

?

Mkswap/home/swap

(3) add it to fstab.

?

Echo"/Home/swap defaults 0 0" >/Etc/fstab

4. Configure the kernel

[Root @ struggle ~] # Vim/etc/sysctl. conf

?

# Kernel paramaters required by Oracle 11gr1

FS. File-max =6815744

FS. AIO-max-Nr =1048576

Kernel. Shmall =2097152

Kernel. shmmax =2147483648

Kernel. shmmni =4096

Kernel. SEM =250 32000 100 128

Net. ipv4.ip _ local_port_range =9000 65500

Net. Core. rmem_default =4194304

Net. Core. rmem_max =4194304

Net. Core. wmem_default =262144

Net. Core. wmem_max =1048576

Save and make it take effect: [root @ struggle ~] #/Sbin/sysctl-P

If the following error message is displayed, ignore it!

Error: "net. Bridge. bridge-nf-call-ip6tables" is an unknown key

Error: "net. Bridge. Bridge-NF-call-iptables" is an unknown key

Error: "net. Bridge. Bridge-NF-call-arptables" is an unknown key

Note: The value of kernel. shmmax's is half of the physical memory.

5. Restrict Oracle account resources

[Root @ struggle ~] # Vi/etc/security/limits. conf

Oracle soft nproc 2047

Hard nproc 16384

Oracle soft nofile 1024

Oracle hard nofile 65536

6. Configure the PAM module for logon authentication

[Root @ struggle ~] # Vim/etc/PAM. d/login

?

Session required pam_limits.so

?

Session required/lib/security/pam_limits.so (If yes32Add this sentence to the BIT system)

7. Set resource limits for oracle users in bash and KSh to edit files

[Root @ struggle ~] # Vim/etc/profile

?

If [$ User ="Oracle" ]; Then

If [$ Shell ="/Bin/KSh" ]; Then

Ulimit-P16384

Ulimit-n65536

Else

Ulimit-u16384 -N65536

Fi

Fi

8. Create an operating system user as the owner of the software installation and support group.

?

[Root@ Struggle ~] # Groupadd oinstall

[Root@ Struggle ~] # Groupadd DBA

[Root@ Struggle ~] # Useradd-G oinstall-g dba Oracle

[Root@ Struggle ~] # Passwd Oracle

9. Create a software installation directory

?

[Root@ Struggle ~] # Mkdir-P/usr/u01/APP/

[Root@ Struggle ~] # Chown-r ORACLE: oinstall/usr/u01/

[Root@ Struggle ~] # Chmod-R755 /Usr/u01/

10. Set Environment Variables

[Root @ struggle ~] # Vi/home/Oracle/. bash_profile

?

#. Bash_profile

# Get the aliases and functions

If [-F ~ /. Bashrc]; then

.~ /. Bashrc

Fi

# User specific environment and startup programs

Path = $ path: $ home/bin

Export path

TMP =/tmp; export TMP

Tmpdir = $ TMP; export tmpdir

Oracle_base =/usr/u01/APP; export oracle_base

ORACLE_HOME = $ oracle_base/product/11.2.0/Dbhome_1; export ORACLE_HOME

Oracle_sid = orcl; export oracle_sid

Oracle_term = xterm; export oracle_term

Path = $ ORACLE_HOME/bin:/usr/sbin: $ path; export path

LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib;

Export LD_LIBRARY_PATH

Classpath = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib;

Export classpath

Umask022

11. decompress the downloaded Oracle 11g installation package to the/home/Oracle directory.

?

[Root@ Struggle ~] # Unzip linux.x64_11gr2_database_1of2.zip-D/home/Oracle

[Root@ Struggle ~] # Unzip linux.x64_11gr2_database5of2.zip-D/home/Oracle

12. Go to the/home/Oracle/database directory and check whether all files are in

[Root @ struggle database] # cd/home/Oracle/Database

[Root @ struggle database] # ls-Al

?

Total usage44

Drwxr-XR-X.8 Root4096 8Month21 2009 .

Drwx ------.5 Oracle oinstall4096 12Month5 14:19 ..

Drwxr-XR-X.12 Root4096 8Month17 2009 Doc

Drwxr-XR-X.4 Root4096 8Month15 2009 Install

Drwxrwxr-X.2 Root4096 8Month15 2009 Response

Drwxr-XR-X.2 Root4096 8Month15 2009 Rpm

-Rwxr-XR-X.1 Root3226 8Month15 2009 Runinstaller

Drwxrwxr-X.2 Root4096 8Month15 2009 Sshsetup

Drwxr-XR-X.14 Root4096 8Month15 2009 Stage

-RW-r --.1 Root5402 8Month18 2009 Welcome.html

13. Disable Firewall

[Root @ struggle database] # service iptables stop

14. Install and log on with an oracle user

[Root @ struggle database] # exit

[Struggle @ struggle ~] $ Su-Oracle

[Oracle @ struggle ~] $ CD/home/Oracle/database/

[Oracle @ struggle ~] $./Runinstaller-jreloc/usr/lib/JVM/Java-6-sun/JRE (I installed it with my own JDK)

Step 1: Enter email information for support (networking required)

Step 2: Select create and configure a database

Step 3: select the server (depending on your situation)

Step 4: select single-instance Database Installation

Step 5: select Custom Installation

Step 6: select the product Language

Step 7: select the version to install

Step 8: select the installation path (configure the path for environment variables)

Step 9: select the database instance name orcl

Step 10: select the data Character Set zhs16gbk

By default, Oracle has been installed. By step 17, components required for Oracle detection are selected and ignore all is selected. In this way, Oracle works normally after oracle is installed.

The machine is too slow to transmit images...

After installation, go to sqlplus

SQL> sqlplus/nolog

SQL> Conn/As sysdba

SQL> startup

Configure boot start:

Create a boot script under/usr/u01/APP/product/11.2.0/dbhome_1/bin:

[Oracle @ struggle dbhome_1] $ Vim/usr/u01/APP/product/11.2.0/dbhome_1/bin/oracledb

?

#! /Bin/bash

#/Etc/init. d/oracledb

# Run-level Startup ScriptFor The Oracle listener and Instances

# It relies on the information on/etc/oratab

Oracle_base =/usr/u01/APP

ORACLE_HOME = $ oracle_base/product/11.2.0/Dbhome_1

Export oracle_ownr = Oracle

Export Path = $ path: $ ORACLE_HOME/bin

Export oracle_sid = orcl

If [! -F $ ORACLE_HOME/bin/dbstart-o! -D $ ORACLE_HOME]

Then

Echo"Oracle startup: cannot start"

Exit1

Fi

Case "$1" In

Start)

# Oracle listener and instance startup

Echo-n"Starting ORACLE :"

Su $ oracle_ownr-C"$ ORACLE_HOME/bin/LSNRCTL start"

Su $ oracle_ownr-C"$ ORACLE_HOME/bin/dbstart $ ORACLE_HOME"

Touch/var/lock/Oracle

Echo"OK"

;;

Stop)

# Oracle listener and instance Shutdown

Echo-n"Shutdown ORACLE :"

Su $ oracle_ownr-C"$ ORACLE_HOME/bin/LSNRCTL stop"

Su $ oracle_ownr-C"$ ORACLE_HOME/bin/dbshut $ ORACLE_HOME"

Rm-F/var/lock/Oracle

Echo"OK"

;;

Reload | restart)

$0 Stop

$0 Start

;;

*)

Echo"Usage: 'basename $ 0' START | stop | restart | reload"

Exit1

Esac

Exit0

The modified script is executable:

[Root @ struggle ~] # Chmod A + x/usr/u01/APP/product/11.2.0/dbhome_1/bin/oracledb

Create a connection:

[Root @ struggle ~] # Ln-S/usr/u01/APP/product/11.2.0/dbhome_1/bin/oracledb/etc/rc. d/init. d/oracledb

Authorization:

[Root @ struggle ~] # Chmod 755/etc/rc. d/init. d/

Add service:

[Root @ struggle ~] # Chkconfig -- add oracledb

Modify Oracle STARTUP configuration

[Root @ struggle ~] # Vim/etc/oratab

Orcl:/usr/u01/APP/product/11.2.0/dbhome_1: Y

Change n to y.

Test:

Service oracledb stop

Service oracledb start

Successful!

http://www.cnblogs.com/lz-wolf/archive/2011/12/05/2276858.html

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