Install oracle 11g R2 x64 on centOS x64

Source: Internet
Author: User
Tags sqlplus

  

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 elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc- gcc-c++ libaio-devel libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC 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.

dd if=/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 swap 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 it is a 32-bit system, add this sentence)

 

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 -p 16384  ulimit -n 65536 else  ulimit -u 16384 -n 65536 fifi

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 -R 755 /usr/u01/

 

10. Set Environment Variables

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

# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATHTMP=/tmp; export TMPTMPDIR=$TMP; export TMPDIRORACLE_BASE=/usr/u01/app; export ORACLE_BASEORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOMEORACLE_SID=orcl; export ORACLE_SIDORACLE_TERM=xterm; export ORACLE_TERMPATH=$ORACLE_HOME/bin:/usr/sbin:$PATH; export PATHLD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib;export LD_LIBRARY_PATHCLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib;export CLASSPATHumask 022

 

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_database_2of2.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 usage 44drwxr-xr-x. 8 root 4096 August 21 2009. drwx ------. 5 oracle oinstall 4096 December 5 14:19 .. drwxr-xr-x. 12 root 4096 August 17 2009 docdrwxr-xr-x. 4 root 4096 August 15 2009 installdrwxrwxr-x. 2 root 4096 August 15 2009 responsedrwxr-xr-x. 2 root 4096 September 2009 rpm-rwxr-xr-x. 1 root 3226 July 2009 runInstallerdrwxrwxr-x. 2 root 4096 August 15 2009 sshsetupdrwxr-xr-x. 14 root 4096 August 15 2009 stage-rw-r --. 1 root 5402 August 18 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 script for the Oracle Listener and Instances# It relies on the information on /etc/oratabORACLE_BASE=/usr/u01/app ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1 export ORACLE_OWNR=oracleexport PATH=$PATH:$ORACLE_HOME/binexport ORACLE_SID=orclif [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]then    echo "Oracle startup: cannot start"    exit 1ficase "$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"             exit 1esacexit 0

 

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!

 

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.