天天看点

Oracle 11g Linux 安装 redhat6.4

Oracle 11g Linux 安装

安装环境:

操作系统 Red Hat Enterprise Linux Server release 6.4 (Santiago) 64位

Oracle版本 11.2.0.3

安装步骤:

1、检查操作系统版本

Last login: Thu Jan 29 11:02:05 2015 from 10.100.116.83

[[email protected] ~]# cat /etc/redhat-release

Red Hat Enterprise Linux Server release 6.4 (Santiago)

2、关闭selinux

[[email protected] ~]# vi /etc/selinux/conf

SELINUX=disabled

SELINUXTYPE=targeted

3、关闭iptable防火墙

[[email protected] ~]# service iptables status

iptables:未运行防火墙。

[[email protected] ~]# service ip6tables stop

ip6tables:清除防火墙规则:[确定]

ip6tables:将 chains 设置为 ACCEPT 策略:filter [确定]

:正在卸载模块:[确定]

[[email protected] ~]# service ip6tables save

[[email protected] ~]# chkconfig iptables off

[[email protected] ~]# chkconfig ip6tables off

4、创建oracle系统用户

[[email protected] ~]# groupadd dba

[[email protected] ~]# groupadd oinstall

[[email protected] ~]# useradd -g oinstall -G dba oracle

[[email protected] ~]# id oracle

uid=501(oracle) gid=503(oinstall) 组=503(oinstall),502(dba)

[[email protected] ~]# passwd oracle

更改用户 oracle 的密码 。

新的 密码:

无效的密码: 它基于字典单词

重新输入新的 密码:

passwd: 所有的身份验证令牌已经成功更新。

5、修改系统参数文件:

[[email protected] ~]# vi /etc/sysctl.conf

# Controls the default maxmimum size of a mesage queue

kernel.msgmnb = 65536

# Controls the maximum size of a message, in bytes

kernel.msgmax = 65536

# Controls the maximum shared segment size, in bytes

kernel.shmmax = 68719476736

# Controls the maximum number of shared memory segments, in pages

kernel.shmall = 4294967296

fs.file-max=6815744

fs.aio-max-nr = 1048576

kernel.shmmni = 4096

kernel.sem = 250 32000 100 128

net.ipv4.ip_local_port_range = 9000 65500

net.core.rmem_default = 262144

net.core.rmem_max = 4194304

net.core.wmem_default = 262144

net.core.wmem_max = 1048586

~

~

"/etc/sysctl.conf" 49L, 1406C written

[[email protected] ~]# sysctl -p  --应用新的参数

6、修改etc/security/limits.conf 限制用户对系统资源的使用

[[email protected] ~]# vi /etc/security/limits.conf

oracle              soft    nproc   2047

oracle              hard    nproc   16384

oracle              soft    nofile  1024

oracle              hard    nofile  65536

oracle              soft    stack   10240

"/etc/security/limits.conf" 56L, 2124C written

7、查看文件/etc/pam.d/login,确保写入下列信息

[[email protected] ~]# vi /etc/pam.d/login

session    required     pam_limits.so

"/etc/pam.d/login" 17L, 766C written

8、修改oracle安装目录的权限,切换到oracle用户,修改oracle环境变量

[[email protected] ~]# chown -R oracle:oinstall /app

[[email protected] ~]# chmod -R 775 /app

[[email protected] ~]# su - oracle

[[email protected] ~]$ vi .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

ORACLE_BASE=/app/oracle

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

ORACLE_SID=ggdir

LD_LIBRARY_PATH=$ORACLE_HOME/lib

PATH=$PATH:$ORACLE_HOME/bin:$HOME/bin

export ORACLE_BASE ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

~

~

".bash_profile" 18L, 400C 已写入                                                                                                           

[[email protected] ~]$ source .bash_profile

9、检查需要的包是否都已安装,命令rpm -q 包名

[[email protected] ~]$ rpm -q binutils

binutils-2.20.51.0.2-5.36.el6.x86_64

[[email protected] ~]$ rpm -q elfutils-libelf

elfutils-libelf-0.152-1.el6.x86_64

[[email protected] ~]$ rpm -q gcc

gcc-4.4.7-3.el6.x86_64

[[email protected] ~]$ rpm -q gcc-c++

gcc-c++-4.4.7-3.el6.x86_64

[[email protected] ~]$ rpm -q glibc

glibc-2.12-1.107.el6.x86_64

glibc-2.12-1.107.el6.i686

[[email protected] ~]$ rpm -q glibc-common

glibc-common-2.12-1.107.el6.x86_64

[[email protected] ~]$ rpm -q glibc-devel

glibc-devel-2.12-1.107.el6.x86_64

[[email protected] ~]$ rpm -q glibc-headers

glibc-headers-2.12-1.107.el6.x86_64

[[email protected] ~]$ rpm -q libaio

libaio-0.3.107-10.el6.x86_64

[[email protected] ~]$ rpm -q libgcc

libgcc-4.4.7-3.el6.x86_64

libgcc-4.4.7-3.el6.i686

[[email protected] ~]$ rpm -q libstdc++

libstdc++-4.4.7-3.el6.x86_64

[[email protected] ~]$ rpm -q libstdc++-devel

libstdc++-devel-4.4.7-3.el6.x86_64

[[email protected] ~]$ rpm -q make

make-3.81-20.el6.x86_64

[[email protected] ~]$ rpm -q sysstat

sysstat-9.0.4-20.el6.x86_64

[[email protected] ~]$ rpm -q elfutils-libelf-devel

elfutils-libelf-devel-0.152-1.el6.x86_64

[[email protected] ~]$ rpm -q pdksh

pdksh-5.2.14-30.x86_64

[[email protected] ~]$ rpm -q unixODBC

unixODBC-2.2.14-12.el6_3.x86_64

[[email protected] ~]$ rpm -q unixODBC-devel

unixODBC-devel-2.2.14-12.el6_3.x86_64

[[email protected] ~]$ rpm -q libaio-devel

libaio-devel-0.3.107-10.el6.x86_64

[[email protected] ~]$ rpm -q compat-libstdc++-33

compat-libstdc++-33-3.2.3-69.el6.x86_64

compat-libstdc++-33-3.2.3-69.el6.i686

10、上传安装文件,并解压

[[email protected] ~]$ cd /app/oracle

[[email protected] oracle]$ ls

p10404530_112030_Linux-x86-64_1of7.zip  p10404530_112030_Linux-x86-64_2of7.zip

[[email protected] oracle]$ unzip p10404530_112030_Linux-x86-64_1of7.zip   

[oracle@localhost oracle]$ unzip p10404530_112030_Linux-x86-64_2of7.zip

11、运行安装文件,安装oracle软件

[[email protected] oracle]$ mkdir -p $ORACLE_HOME

[[email protected] oracle]$ cd database

[[email protected] database]$ export DISPLAY=10.100.116

[[email protected] database]$ export DISPLAY=10.100.116.83:0.0

[[email protected] database]$ xhost +

access control disabled, clients can connect from any host

[[email protected] database]$ export LANG=c

[[email protected] database]$ ./runInstaller

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 9416 MB    Passed

Checking swap space: must be greater than 150 MB.   Actual 8191 MB    Passed

Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-01-30_04-27-29PM. Please wait ...[[email protected] database]$ You can find the log of this install session at:

 /app/oraInventory/logs/installActions2015-01-30_04-27-29PM.log

12、安装完成后,根据提示以root身份运行两个脚本

[[email protected] oraInventory]$ su - root

Password: 

[[email protected] ~]# cd /app

[[email protected] app]# cd oraInventory

[[email protected] oraInventory]# ./orainstRoot.sh

Changing permissions of /app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of /app/oraInventory to oinstall.

The execution of the script is complete.

[[email protected] oraInventory]# cd $ORACLE_HOME

[[email protected] ~]# cd /app/oracle

[[email protected] oracle]# cd product

[[email protected] product]# cd 11.2.0

[[email protected] 11.2.0]# cd dbhome_1

[[email protected] dbhome_1]# ./root.sh

Performing root user operation for Oracle 11g 

The following environment variables are set as:

    ORACLE_OWNER= oracle

    ORACLE_HOME=  /app/oracle/product/11.2.0/dbhome_1

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

   Copying dbhome to /usr/local/bin ...

   Copying oraenv to /usr/local/bin ...

   Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...

Entries will be added to the /etc/oratab file as needed by

Database Configuration Assistant when a database is created

Finished running generic part of root script.

Now product-specific root actions will be performed.

Finished product-specific root actions.

[[email protected] dbhome_1]# exit

13、切换oracle用户,调用DBCA创建数据库

[[email protected] oraInventory]$ cd

[[email protected] ~]$ export LANG=c

[[email protected] ~]$ export DISPLAY=10.100.116.83:0.0

[[email protected] ~]$ xhost +

access control disabled, clients can connect from any host

[[email protected] ~]$ dbca

14、调用netca配置监听

[[email protected] ~]$ netca

Oracle Net Services Configuration:

Configuring Listener:LISTENER

Listener configuration complete.

Oracle Net Listener Startup:

    Running Listener Control: 

      /app/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start LISTENER

    Listener Control complete.

    Listener started successfully.

Profile configuration complete.

Default local naming configuration complete.

    Created net service name: ggdir

Oracle Net Services configuration successful. The exit code is 0

[[email protected] ~]$ lsnrctl status

继续阅读