Centos-6.7下_Oracle 11gR2"静默"详细安装过程及排错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Centos-6.7下_Oracle 11gR2"静默"详细安装过程及排错相关的知识,希望对你有一定的参考价值。

系统要求:
内存:1G(官方最低要求1G)
硬盘:40G(企业版安装所需4.29G和1.7G数据文件)

检查的命令
内存
# grep MemTotal /proc/meminfo
交换空间
# grep SwapTotal /proc/meminfo
磁盘空间
# df -ah

安装前系统准备:
1、修改主机名
# sed -i "s/HOSTNAME=localhost.localdomain/HOSTNAME=DB_2/g" /etc/sysconfig/network
# hostname DB_2

2、添加主机名与IP对应记录
 #vi /etc/hosts
10.10.0.48    DB_2

3、关闭Selinux
# sed -i "s/SELINUX=enforcing/SELINUX=disabled/"/etc/selinux/config 
# setenforce 0


创建用户和组(root用户:创建Oracle安装组oinstall,数据库管理员组dba,及oracle用户)

# groupadd-g 200 oinstall
# groupadd -g 201 dba
# useradd -u 440 -g oinstall -G dba oracle (主组oinstall,其它组:dba
# passwd oracle   #(P)

 

修改内核参数(root用户:修改 /etc/sysctl.conf 文件,加上如下参数)
#vi/etc/sysctl.conf  #末尾添加如下
net.ipv4.ip_local_port_range= 9000 65500
fs.file-max = 6815744
kernel.shmall = 10523004
kernel.shmmax = 6465333657
kernel.shmmni = 4096
kernel.sem = 250 32000 100128
net.core.rmem_default=262144
net.core.wmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_max=1048576
fs.aio-max-nr = 1048576
# sysctl -p  #使配置生效

 

修改系统资源限制(root用户:修改 /etc/security/limits.conf 文件,加上下面的参数):
# 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

 

修改用户验证选项(root用户下:修改/etc/pam.d/login文件加上如下参数):
# vi /etc/pam.d/login
session    required    pam_namespace.so    #下面添加一条pam_limits.so
session    required    pam_limits.so

 

修改用户配置文件(root用户下:修改/etc/profile文件加入如下参数):
# vi/etc/profile    #(如果做了第6步的limits.conf设置,这个设置就不需要了)
if [ $USER ="oracle" ]; then
      if [ $SHELL = "/bin/ksh" ];then
          ulimit -p 16384
          ulimit -n 65536
      else
          ulimit -u 16384 -n 65536
      fi
fi

 

创建安装目录及设置权限:

# mkdir -p /opt/app/oracle/ 
# chmod 755 /opt/app/oracle/ 
# chown oracle.oinstall -R /opt/app/oracle/

设置oracle环境变量:
使用oracle账户
#su - oracle
$ vi ~/.bash_profile
#设置oracle
export ORACLE_BASE=/opt/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
#export PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_SID=ora11g
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib

保存退出

source ~/.bash_profile

完成后执行:
$ env | grep ORA #查看环境变量是否完成
$ env | grep ORA
ORACLE_BASE=/opt/app/oracle
ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1


安装Oracle

1、安装依赖包
# yum -y install gcc gcc-c++ make binutilscompat-libstdc++-33 elfutils-libelf elfutils-libelf-develglibc glibc-commonglibc-devel libaio libaio-devel libgcclibstdc++libstdc++-devel unixODBC unixODBC-devel ksh

# yum -y installbinutils compat-libstdc++-33 compat-libstdc++-33.i686

elfutils-libelfelfutils-libelf-devel gcc gcc-c++ glibc glibc.i686 glibc-common

glibc-devel glibc-devel.i686glibc-headers ksh libaio libaio.i686 libaio-devel

libaio-devel.i686 libgcclibgcc.i686 libstdc++ libstdc++.i686 libstdc++-devel make

sysstat unixODBC unixODBC-devel


2
、 解压oracle
# unzip linux.x64_11gR2_database_1of2.zip
# unzip linux.x64_11gR2_database_1of2.zip


3、图形界面安装(略,通常的生产环境是不安装图形界面的)
# xhost +  #使所有用户都能访问图形桌面
# su –oracle
#.~/database/runInstaller
输入接受一些安全问题的邮件地址


4、字符界面下安装oracle
  在/opt目录下 解压oracle软件
 $ unzip linux.x64_11gR2_database_1of2.zip
 $ unzip linux.x64_11gR2_database_2of2.zip

解压后得到database目录,其中包含response目录,该目录中有三个rsp文件,用来作为静默安装时的应答文件的模板。

三个文件作用分别是:
db_install.rsp:安装应答
dbca.rsp: 创建数据库应答
netca.rsp:建立监听、本地服务名等网络设置的应答

将db_install.rsp备份一份,在其基础上修改内容, 将create database段中内容设置好即可。
修改静默安装的配置文件
$ less/opt/database/response/db_install.rsp |grep -v "#"|grep -v"^$"
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_SWONLY
ORACLE_HOSTNAME=DB_m2
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/opt/app/oracle/oraInventory
SELECTED_LANGUAGES=en,zh_CN
ORACLE_HOME=/opt/app/oracle/product/11.2.0/db_1
ORACLE_BASE=/opt/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.isCustomInstall=false
oracle.install.db.customComponents=oracle.server:11.2.0.1.0,oracle.sysman.ccr:10.2.7.0.0,oracle.xdk:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network:11.2.0.1.0,oracle.network.listener:11.2.0.1.0,oracle.rdbms:11.2.0.1.0,oracle.options:11.2.0.1.0,oracle.rdbms.partitioning:11.2.0.1.0,oracle.oraolap:11.2.0.1.0,oracle.rdbms.dm:11.2.0.1.0,oracle.rdbms.dv:11.2.0.1.0,orcle.rdbms.lbac:11.2.0.1.0,oracle.rdbms.rat:11.2.0.1.0
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=oinstall
oracle.install.db.CLUSTER_NODES=
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE
oracle.install.db.config.starterdb.globalDBName=ora11g
oracle.install.db.config.starterdb.SID=ora11g
oracle.install.db.config.starterdb.characterSet=AL32UTF8
oracle.install.db.config.starterdb.memoryOption=true
oracle.install.db.config.starterdb.memoryLimit=1500
oracle.install.db.config.starterdb.installExampleSchemas=false
oracle.install.db.config.starterdb.enableSecuritySettings=true
oracle.install.db.config.starterdb.password.ALL=oracle
oracle.install.db.config.starterdb.password.SYS=
oracle.install.db.config.starterdb.password.SYSTEM=
oracle.install.db.config.starterdb.password.SYSMAN=
oracle.install.db.config.starterdb.password.DBSNMP=
oracle.install.db.config.starterdb.control=DB_CONTROL
oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
oracle.install.db.config.starterdb.dbcontrol.enableEmailNotification=false
oracle.install.db.config.starterdb.dbcontrol.emailAddress=
oracle.install.db.config.starterdb.dbcontrol.SMTPServer=
oracle.install.db.config.starterdb.automatedBackup.enable=false
oracle.install.db.config.starterdb.automatedBackup.osuid=
oracle.install.db.config.starterdb.automatedBackup.ospwd=
oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE
oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT=
DECLINE_SECURITY_UPDATES=true    //一定要设为true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=


开始静默安装:

oracle用户身份登录系统安装Oracle,为避免出现中文乱码,装装前可以执行export LANG="",显示英文,

[[email protected]_m2database]# su - oracle

[[email protected]_m2~]$ cd /opt

[[email protected]_m2opt]$ cd database/

[[email protected]_m2opt]$ export LANG=""

[[email protected]_m2 opt]$ ./runInstaller-silent -force -responseFile /home/oracle/etc/db_install.rsp 

如果出现:
$ Exception in thread "main" java.lang.NoClassDefFoundError 
        at java.lang.Class.forName0(Native Method) 
        at java.lang.Class.forName(Class.java:164) 
        at java.awt.Toolkit$2.run(Toolkit.java:821) ...
       
这些错误提示,可能是环境变量还没有完全变为oracle下的,那么最好断开与主机的连接,然后重新使用oracle身份连接:ssh [email protected];

如果出现:
Preparing to launch Oracle Universal Installer from/tmp/OraInstall2015-07-29_03-58-41PM. Please wait ...              [[email protected] database]$You can find the log ofthis  install session at:     //
则表示安装顺利
如果出现:
Preparing to launch Oracle Universal Installer
from /tmp/OraInstall2015-07-29_03-58-41PM. Please wait ...              [[email protected] database]$    //之后就没有反应

或者报错[FATAL] [INS-13013] Target environment do not meet some mandatoryrequirements

则需要按下面步骤进行:

安装命令中加入选项-ignorePrereq,详情请见
安装中,如果提示[WARNING]不必理会,此时安装程序仍在进行,如果出现[FATAL],则安装程序已经停止了。
大约需要五分钟左右......
如果需要查看安装日志信息了解安装进度,可以:
cd $ORACLE_BASE/oraInventory/logs
tail -100f installActions*.log

 

加上-ignorePrereq再次尝试静默安装:

[[email protected]_m2database]$ ./runInstaller -silent -force -ignorePrereq -responseFile/opt/database/response/db_install.rsp

说明:

-silent  必须要有

-ignorePrereq  如果哪块没有符合要求,不添加可能就安装不过去了

-force  软件可以安装在一个非空目录中

-responseFile  指定响应文件

StartingOracle Universal Installer...

 

CheckingTemp space: must be greater than 120 MB.  Actual 6843 MB    Passed

Checkingswap space: must be greater than 150 MB.  Actual 929 MB    Passed

Preparingto launch Oracle Universal Installer from /tmp/OraInstall2016-03-06_02-24-49PM.Please wait ...[[email protected]_m2 database]$ You can find the log of this installsession at:

 /opt/app/oracle/oraInventory/logs/installActions2016-03-06_02-24-49PM.log

Thefollowing configuration scripts need to be executed as the "root"user.

 #!/bin/sh

 #Root scripts to run

 

/opt/app/oracle/product/11.2.0/db_1/root.sh

Toexecute the configuration scripts:

         1. Open a terminal window

         2. Log in as "root"

         3. Run the scripts

         4. Return to this window and hit"Enter" key to continue

 

SuccessfullySetup Software.

安装完毕后会提示上述的信息,整个执行过程大部分时间都是在后台完成的,而且可能等待好一会儿才会有响应,所以需要耐心等待,通过监控/opt/app/oracle目录的大小可以确定完成的情况,按照以上的配置完成安装后/opt/app/oracle目录的大小为4.1GB左右。
      在最后会提示执行root.sh脚本,在新的会话窗口执行root.sh脚本,使用root用户执行root.sh

[[email protected]_m2 ~]#/opt/app/oracle/product/11.2.0/db_1/root.sh

Check/opt/app/oracle/product/11.2.0/db_1/install/root_DB_m2_2016-03-06_14-49-29.logfor the output of root script
 
执行结果也是没有前台显示出来。

 

配置监听程序:

$ORACLE_HOME/bin/netca /silent/responseFile /opt/database/response/netca.rsp

可能会出现以下错误:
UnsatisfiedLinkError excepti native library: njni11
         java.lang.UnsatisfiedLinkError:/soft/u01/app/oracle/product/11.2.0/db_1/lib/libnjni11.so: libclntsh.so.11.1:                 cannot
open shared objectfile: No such file or directory
可能是有些oracle依赖包没有安装:
检查以下RPM包是否安装(官方推荐必装包):
  binutils-2.20.51.0.2-5.11.el6 (x86_64) 
  compat-libcap1-1.10-1 (x86_64)  
  compat-libstdc++-33-3.2.3-69.el6 (x86_64) 
  compat-libstdc++-33-3.2.3-69.el6.i686 
  gcc-4.4.4-13.el6 (x86_64)  
  gcc-c++-4.4.4-13.el6 (x86_64) 
  glibc-2.12-1.7.el6 (i686) 
  glibc-2.12-1.7.el6 (x86_64)  
  glibc-devel-2.12-1.7.el6 (x86_64) 
  glibc-devel-2.12-1.7.el6.i686 ksh  
  libgcc-4.4.4-13.el6 (i686) 
  libgcc-4.4.4-13.el6 (x86_64) 
  libstdc++-4.4.4-13.el6 (x86_64) 
  libstdc++-4.4.4-13.el6.i686  
  libstdc++-devel-4.4.4-13.el6 (x86_64) 
  libstdc++-devel-4.4.4-13.el6.i686 
  libaio-0.3.107-10.el6 (x86_64) 
  libaio-0.3.107-10.el6.i686  
  libaio-devel-0.3.107-10.el6 (x86_64) 
  libaio-devel-0.3.107-10.el6.i686 
  make-3.81-19.el6  
  sysstat-9.0.4-11.el6 (x86_64)

  使用rpm -qa|grep XX  查看是否安这些依赖包,这些依赖包缺一不可

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

  如果没有直接在google搜索,下载对应版本就可以了
  最后别忘了:
  $ORACLE_HOME/bin/relink all 
  然后重新执行网络配置


[[email protected]_m2 database]$ $ORACLE_HOME/bin/netca/silent /responseFile /opt/database/response/netca.rsp

Parsing command line arguments:

    Parameter "silent" =true

    Parameter"responsefile" = /opt/database/response/netca.rsp

Done parsing command line arguments.

Oracle Net Services Configuration:

Profile configuration complete.

Oracle Net Listener Startup:

    Running Listener Control:

      /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctlstart LISTENER

    Listener Control complete.

    Listener started successfully.

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0


启动监听程序:

$  /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctlstart LISTENER
$ORACLE_BASE//opt/app/oracle/product/11.2.0/db_1/bin/lsnrctlstart LISTENER

[[email protected]_m2database]$ /opt/app/oracle/product/11.2.0/db_1/bin/lsnrctl start LISTENER

LSNRCTLfor Linux: Version 11.2.0.1.0 - Production on 06-MAR-2016 15:18:49

 

Copyright(c) 1991, 2009, Oracle.  All rightsreserved.

 

Starting/opt/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...

TNSLSNRfor Linux: Version 11.2.0.1.0 - Production

Systemparameter file is /opt/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Logmessages written to /opt/app/oracle/diag/tnslsnr/DB_m2/listener/alert/log.xml

Listeningon: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

Listeningon: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DB_m2)(PORT=1521)))

 

Connectingto (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS ofthe LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version11.2.0.1.0 - Production

StartDate                06-MAR-2016 15:18:51

Uptime                    0 days 0 hr. 0 min. 0 sec

TraceLevel               off

Security                  ON: Local OS Authentication

SNMP                      OFF

ListenerParameter File   /opt/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

ListenerLog File        /opt/app/oracle/diag/tnslsnr/DB_m2/listener/alert/log.xml

ListeningEndpoints Summary...

 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DB_m2)(PORT=1521)))

Thelistener supports no services

Thecommand completed successfully

启动成功

 

静默dbca建库:

[[email protected]_m2~]# vi  /opt/database/response/dbca.rsp
GDBNAME = " ora11g.DB_m2"   //78全局数据库的名字=SID+主机域名
SID = "ora11g"   //149 SID
CHARACTERSET = "AL32UTF8"   //415编码
NATIONALCHARACTERSET= "UTF8"   //425编码

SYSPASSWORD="sys"    //190 密码可自己设置
SYSTEMPASSWORE="system"    //200 密码可自己设置

[[email protected]_m2 database]$ $ORACLE_HOME/bin/dbca -silent -responseFile /opt/database/response/dbca.rsp

EnterSYSTEM user password:

 

sh: /bin/ksh: No such file or directory

sh: /bin/ksh: No such file or directory

Copyingdatabase files

1%complete

3%complete

11%complete

18%complete

26%complete

37%complete

Creatingand starting Oracle instance

40%complete

45%complete

50%complete

55%complete

56%complete

60%complete

62%complete

CompletingDatabase Creation

66%complete

70%complete

73%complete

85%complete

96%complete

100%complete

Look atthe log file "/opt/app/oracle/cfgtoollogs/dbca/ora11g/ora11g.log" forfurther details.

建库后实例检查:

ps -ef | grep ora_ | grep -v grep| wc -l
21

[[email protected]_m2 database]$ ps -ef | grep ora_ |grep -v grep

oracle    15924     1  0 15:50 ?        00:00:00 ora_pmon_ora11g

oracle    15926     1  0 15:50 ?        00:00:01 ora_vktm_ora11g

oracle    15930     1  0 15:50 ?        00:00:00 ora_gen0_ora11g

oracle    15932     1  0 15:50 ?        00:00:00 ora_diag_ora11g

oracle    15934     1  0 15:50 ?        00:00:00 ora_dbrm_ora11g

oracle    15936     1  0 15:50 ?        00:00:00 ora_psp0_ora11g

oracle    15938     1  0 15:50 ?        00:00:00 ora_dia0_ora11g

oracle    15940     1  0 15:50 ?        00:00:00 ora_mman_ora11g

oracle    15942     1  0 15:50 ?        00:00:00 ora_dbw0_ora11g

oracle    15944     1  0 15:50 ?        00:00:00 ora_lgwr_ora11g

oracle    15946     1  0 15:50 ?        00:00:00 ora_ckpt_ora11g

oracle    15948     1  0 15:50 ?        00:00:00 ora_smon_ora11g

oracle    15950     1  0 15:50 ?        00:00:00 ora_reco_ora11g

oracle    15952     1  0 15:50 ?        00:00:00 ora_mmon_ora11g

oracle    15954     1  0 15:50 ?        00:00:00 ora_mmnl_ora11g

oracle    15956     1  0 15:50 ?        00:00:00 ora_d000_ora11g

oracle    15958     1  0 15:50 ?        00:00:00 ora_s000_ora11g

oracle    15966     1  0 15:50 ?        00:00:00 ora_qmnc_ora11g

oracle    15980     1  0 15:50 ?        00:00:00 ora_cjq0_ora11g

oracle    15982     1  0 15:50 ?        00:00:00 ora_q000_ora11g

oracle    15984     1  0 15:50 ?        00:00:00 ora_q001_ora11g

 

建库后监听检查:
lsnrctl status

[[email protected]_m2 database]$ lsnrctl status

LSNRCTL for Linux: Version11.2.0.1.0 - Production on 06-MAR-2016 15:55:31

 

Copyright (c) 1991, 2009,Oracle.  All rights reserved.

 

Connecting to(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))

STATUS of the LISTENER

------------------------

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version11.2.0.1.0 - Production

Start Date                06-MAR-2016 15:36:22

Uptime                    0 days 0 hr. 19 min. 8 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

Listener Parameter File  /opt/app/oracle/product/11.2.0/db_1/network/admin/listener.ora

Listener Log File        /opt/app/oracle/diag/tnslsnr/DB_m2/listener/alert/log.xml

Listening Endpoints Summary...

 (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))

 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=DB_m2)(PORT=1521)))

Services Summary...

Service "ora11g.DB_m2"has 1 instance(s).

 Instance "ora11g", status READY, has 1 handler(s) for thisservice...

Service"ora11gXDB.DB_m2" has 1 instance(s).

 Instance "ora11g", status READY, has 1 handler(s) for thisservice...

The command completedsuccessfully

 

如果出现以下错误:
lsnrctl: error while loading shared libraries:/u01/app/oracle/product/11.2.0/db_1/lib/libclntsh.so.11.1: cannotrestoresegment prot after reloc: Permission denied
或者
ORA-12547: TNS:lost contact
 
解决办法:在root用户下执行以下命令
 
su - root
setenforce 0 不需要重启
修改/etc/selinux/config文件中的SELINUX="" disabled ,需要重启

注意:如果在没有将依赖包全部安装完成后强行安装数据库,那么登录数据库时将会出现:ORA-12547:                    TNS:lost contact错误,出现这个错误,就重新安装吧

 

修改oracle启动配置文件:
su - oracle
vi /etc/oratab
 
orcl:/soft/u01/app/oracle/product/11.2.0/db_1:Y //“N”改成“Y”
这样就可以通过dbstart 启动此实例,监听器。
 
dbstart $ORACLE_HOME
此时所有oracle的进程关闭,监听器也停止。
 
dbshut $ORACLE_HOME
再次查看监听器状态。
lsnrctl status


启动数据库:

$ sqlplus / as sysdba  //as前有个空格

[[email protected]_m2 database]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Mar 616:22:55 2016

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

ERROR:

ORA-12162: TNS:netservice name is incorrectly specified

Enter user-name:

登录出现以上错误,诡异的故障背后的原因竟然是那样的基础:ORACLE_SID没有指定!
确认系统当前的ORACLE_HOMEORACLE_SID环境变量

[[email protected]_m2 database]$ echo$ORACLE_HOME 

/opt/app/oracle/product/11.2.0/db_1

[[email protected]_m2 database]$ echo$ORACLE_SID  

 

[[email protected]_m2 database]$

可见,此时只设置了ORACLE_HOME环境变量,但ORACLE_SID此时为空,这就是该问题的真实原因。

解决方法如下:

[[email protected]_m2 database]$ cd    

[[email protected]_m2 ~]$ pwd

/home/oracle

[[email protected]_m2 ~]$ vi .bash

.bash_history  .bash_profile 

.bash_logout   .bashrc       

[[email protected]_m2 ~]$ vi .bash_

.bash_history  .bash_logout  .bash_profile

[[email protected]_m2 ~]$ vi .bash_profile

在最后面加入如下内容:

export ORACLE_SID=ora11g 后保存退出!

[[email protected]_m2 ~]$ source.bash_profile 

[[email protected]_m2 ~]$ echo $ORACLE_SID

ora11g

[[email protected]_m2 ~]$ sqlplus / assysdba

SQL*Plus: Release 11.2.0.1.0Production on Sun Mar 6 16:31:46 2016

Copyright (c) 1982, 2009,Oracle.  All rights reserved.

Connected to:

Oracle Database 11g EnterpriseEdition Release 11.2.0.1.0 - 64bit Production

With the Partitioning, OLAP, DataMining and Real Application Testing options

SQL>start

SQL>startup

ORACLE instance started.

 

Total System Global Area  304807936 bytes

Fixed Size                  2212856 bytes

Variable Size             113249288 bytes

Database Buffers          184549376 bytes

Redo Buffers                4796416 bytes

Database mounted.

Database opened.

SQL>
使用show parameter;或者select table_name from dba_tables;看看是否正常

启动监听:lsnrctl start
查看监听:lsnrctl status
停止监听:lsnrctl stop

 

报错排除:

[[email protected] database]$./runInstaller -silent -force -responseFile/opt/database/response/db_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must begreater than 120 MB.   Actual 161383 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 16383MB    Passed
Preparing to launch Oracle Universal Installer from/tmp/OraInstall2015-01-26_01-34-45PM. Please wait ...[[email protected]]$ [FATAL] [INS-32012] Unable to create directory.
   CAUSE: Either proper permissions were not granted to create thedirectory or there was no space left in the volume.
   ACTION: Check your permission on the selected directory or choose anotherdirectory.
[FATAL] [INS-32012] Unable to create directory.
   CAUSE: Either proper permissions were not granted to create thedirectory or there was no space left in the volume.
   ACTION: Check your permission on the selected directory or chooseanother directory.

error

[[email protected] database]$./runInstaller -silent -force -responseFile/opt/database/response/db_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must begreater than 120 MB.   Actual 165989 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 16383MB    Passed
Preparing to launch Oracle Universal Installer from/tmp/OraInstall2015-01-26_03-18-11PM. Please wait ...[[email protected]]$ [FATAL] [INS-32015] The location specified for Oracle home Locationis invalid.
   CAUSE: The specified location cannot be used for Oracle homeLocation. Either the specified location is not found on the system or isdetected to be a file.
   ACTION: Specify a valid location for Oracle home Location.
[WARNING] [INS-32018] The selected Oracle home is outside of Oracle base.
   CAUSE: The Oracle home selected was outside of Oracle base.
   ACTION: Oracle recommends installing Oracle software within theOracle base directory. Adjust the Oracle home or Oracle base accordingly.
[FATAL] [INS-32021] Insufficient disk space on this volume for the selectedOracle home.
   CAUSE: The selected Oracle home was on a volume without enoughdisk space.
   ACTION: Choose a location for Oracle home that has enough space(minimum of 4,397MB) or free up space on the existing volume.
  
解决办法:
   检查了环境变量$ORACLE_BASE和$ORACLE_HOME发现两个路径均正常,没有发现任何异常

逐步从头排查,发现在文件./response/db_install.rsp中INVENTORY_LOCATION、ORACLE_BASE和ORACLE_HOME三个字段被配置成了相对路径
umask 022
export ORACLE_BASE=/home/oracle/app
export ORACLE_HOME=$ORACLE_BASE/oracle/product/11.2.0/dbhome_1
export ORACLE_SID=ora11g

export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=$ORACLE_HOME/bin :$PATH:$HOME/bin


[[email protected] database]$./runInstaller -silent -force -responseFile/opt/database/response/db_install.rsp
Starting Oracle Universal Installer...

Checking Temp space: must begreater than 120 MB.   Actual 165989 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 16383MB    Passed
Preparing to launch Oracle Universal Installer from/tmp/OraInstall2015-01-26_05-56-45PM. Please wait ...[[email protected]]$ [FATAL] [INS-32015] The location specified for Oracle home Locationis invalid.
   CAUSE: The specified location cannot be used for Oracle homeLocation. Either the specified location is not found on the system or isdetected to be a file.
   ACTION: Specify a valid location for Oracle home Location.
[WARNING] [INS-32018] The selected Oracle home is outside of Oracle base.
   CAUSE: The Oracle home selected was outside of Oracle base.
   ACTION: Oracle recommends installing Oracle software within theOracle base directory. Adjust the

以上是关于Centos-6.7下_Oracle 11gR2"静默"详细安装过程及排错的主要内容,如果未能解决你的问题,请参考以下文章

Windows下Oracle 11g的安装

oracle 11g 安装包解压的问题

CentOS7安装Oracle 11gR2 安装

centos 下配置oracle11gR2开机自启

windows本地 Oracle 11g安装完整教程 (windows10下安装)

Oracle win32_11gR2_client.zip