ITPub博客

首页 > 数据库 > Oracle > Oracle 静默安装

Oracle 静默安装

原创 Oracle 作者:chenoracle 时间:2015-07-24 11:37:56 0 删除 编辑

Oracle 静默安装

 

准备工作 

1.1配置本地YUM,安装软件

[root@chen ~]# cd /etc/yum.repos.d/

[root@chen yum.repos.d]# cp public-yum-ol6.repo yum.repo

[root@chen yum.repos.d]# mv public-yum-ol6.repo /root/

[root@chen yum.repos.d]# vim yum.repo

[chen_cc]

name=Oracle_chen

baseurl=file:///mnt

gpgcheck=0

enabled=1

[root@chen yum.repos.d]# mount /dev/sr1 /mnt

[root@chen yum.repos.d]# yum list

 

[root@chen yum.repos.d]# yum -y install compat-libstdc++-33-3.2.3 elfutils-libelf gcc gcc-c++* glibc glibc-common glibc-common glibc-devel libaio libaio-devel libgcc libstdc++-* libstdc++-devel make sysstat

 

1.2创建用户,组

[root@chen ~]# groupadd -g 1000 oinstall

[root@chen ~]# groupadd -g 1001 dba

[root@chen ~]# useradd -u 1000 -g oinstall -G dba oracle

[root@chen ~]# mkdir -p /u01/app/oracle

[root@chen ~]# mv p10404530_112030_Linux-x86-64_* /u01/

[root@chen ~]# chown oracle.oinstall -R /u01/

[oracle@chen u01]$ unzip p10404530_112030_Linux-x86-64_1of7.zip

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

 

1.3配置oracle用户环境变量

[oracle@chen ~]$ vim .bash_profile

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0

export ORACLE_SID=orcl

export PATH=$ORACLE_HOME/bin:$PATH

export NLS_LANG='AMERICAN_AMERICA.ZHS16GBK'

~

[oracle@chen ~]$ source .bash_profile

 

1.4安全配置

[root@chen ~]# vim /etc/security/limits.conf

# End of file

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, 2034C written 

 

[root@chen ~]# vim /etc/sysctl.conf

fs.aio-max-nr = 1048576

fs.file-max = 6815744

kernel.shmall = 2097152

kernel.shmmax = 536870912

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" 52L, 1461C written

 

[root@chen ~]# sysctl -p

 

/*

伪装操作系统

[root@chen ~]# vim /etc/redhat-release

#Red Hat Enterprise Linux Server release 6.3 (Santiago)

redhat-4

*/

 

静默安装数据库软件


2.1创建oraInst.loc文件

[root@chen ~]# cd /etc/

[root@chen etc]# touch oraInst.loc

[root@chen etc]# vim oraInst.loc

inventory_loc=/u01/app/oracle/oraInventory

inst_group=oinstall

[root@chen ~]# chown oracle.oinstall /etc/oraInst.loc

[root@chen ~]# chmod 664 /etc/oraInst.loc

 

2.2 创建响应文件db_install.rsp

[oracle@chen ~]$ cp /u01/database/response/* /home/oracle/

[oracle@chen ~]$ ls

dbca.rsp  db_install.rsp  netca.rsp

 

[oracle@chen ~]$ vim db_install.rsp

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=chen

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/u01/app/oracle/oraInventory

SELECTED_LANGUAGES=en,zh_CN

ORACLE_HOME=/u01/app/oracle/product/11.2.0

ORACLE_BASE=/u01/app/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.EEOptionsSelection=true

oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=oinstall

oracle.install.db.config.starterdb.type=GENERAL_PURPOSE

oracle.install.db.config.starterdb.globalDBName=orcl

oracle.install.db.config.starterdb.SID=orcl

oracle.install.db.config.starterdb.characterSet=AL32UTF8

oracle.install.db.config.starterdb.memoryOption=true

oracle.install.db.config.starterdb.memoryLimit=

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.control=DB_CONTROL

oracle.install.db.config.starterdb.automatedBackup.enable=false

oracle.install.db.config.starterdb.storageType=FILE_SYSTEM_STORAGE

oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=/u01/app/oracle/oradata

oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/u01/app/oracle/recovery_area

DECLINE_SECURITY_UPDATES=true

oracle.installer.autoupdates.option=SKIP_UPDATES

其他 均为默认值;

 

2.3 静默安装oracle软件

[oracle@chen database]$ cd /u01/database/

[oracle@chen database]$ ./runInstaller -silent -force -responseFile /home/oracle/db_install.rsp

Starting Oracle Universal Installer...

 

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

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

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-07-23_04-36-10PM. Please wait ...

 

 [WARNING] [INS-13014] Target environment do not meet some optional requirements.

   CAUSE: Some of the optional prerequisites are not met. See logs for details. /u01/app/oracle/oraInventory/logs/installActions2015-07-23_04-38-39PM.log

   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oracle/oraInventory/logs/installActions2015-07-23_04-38-39PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.

You can find the log of this install session at:

 /u01/app/oracle/oraInventory/logs/installActions2015-07-23_04-38-39PM.log

 

 

The installation of Oracle Database 11g was successful.

Please check '/u01/app/oracle/oraInventory/logs/silentInstall2015-07-23_04-38-39PM.log' for more details.

 

As a root user, execute the following script(s):

        1. /u01/app/oracle/product/11.2.0/root.sh

 

 

Successf   

 

2.4执行脚本

[root@chen 11.2.0]# ./root.sh

Check /u01/app/oracle/product/11.2.0/install/root_chen_2015-07-23_16-50-00.log for the output of root script

 

[oracle@chen database]$ vim /u01/app/oracle/oraInventory/logs/silentInstall2015-07-23_04-38-39PM.log

silentInstall2015-07-23_04-38-39PM.log

The installation of Oracle Database 11g was successful.

 

2.5 查看安装效果

[oracle@chen dbs]$ sqlplus / as sysdba

 

SQL*Plus: Release 11.2.0.3.0 Production on Thu Jul 23 17:19:54 2015

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

Connected to an idle instance.

 

 

静默安装数据库文件

3.1 准备响应文件dbca.rsp

/*

[oracle@chen ~]$ cp /u01/database/response/* /home/oracle/

[oracle@chen ~]$ ls

dbca.rsp  db_install.rsp  netca.rsp

*/

[oracle@chen ~]$ vim dbca.rsp

OPERATION_TYPE = "createDatabase"

GDBNAME = "orcl"

SID = "orcl"

DATAFILEDESTINATION =/u01/app/oracle/oradata

LISTENERS = "listener_chen"

MEMORYPERCENTAGE = "40"

SOURCEDB = "chen:1521:orcl"

其余 均为默认值;

 

3.2 静默安装数据文件

10:21---10:23

[oracle@chen ~]$ $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/dbca.rsp

Copying database files

1% complete

3% complete

11% complete

18% complete

26% complete

37% complete

Creating and starting Oracle instance

40% complete

45% complete

50% complete

55% complete

56% complete

60% complete

62% complete

Completing Database Creation

66% complete

70% complete

73% complete

85% complete

96% complete

100% complete

Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for further details.

 

3.3 查看安装效果

[oracle@chen ~]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Fri Jul 24 10:24:14 2015

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

Enter user-name: /as sysdba

 

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, Oracle Label Security, OLAP, Data Mining,

Oracle Database Vault and Real Application Testing options

 

SQL> select instance_name,status from v$instance;

INSTANCE_NAME                    STATUS

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

orcl                             OPEN

 

SQL> select name from v$dbfile;

NAME

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

/u01/app/oracle/oradata/orcl/users01.dbf

/u01/app/oracle/oradata/orcl/undotbs01.dbf

/u01/app/oracle/oradata/orcl/sysaux01.dbf

/u01/app/oracle/oradata/orcl/system01.dbf

 

SQL> select name from v$controlfile;

NAME

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

/u01/app/oracle/oradata/orcl/control01.ctl

/u01/app/oracle/fast_recovery_area/orcl/control02.ctl

 

SQL> select member from v$logfile;

MEMBER

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

/u01/app/oracle/oradata/orcl/redo03.log

/u01/app/oracle/oradata/orcl/redo02.log

/u01/app/oracle/oradata/orcl/redo01.log

 

静默安装网络文件

4.1 准备响应文件netca.rsp

/*

[oracle@chen ~]$ cp /u01/database/response/* /home/oracle/

[oracle@chen ~]$ ls

dbca.rsp  db_install.rsp  netca.rsp

*/

[oracle@chen ~]$ vim netca.rsp

 

4.2 静默安装网络文件

SHOW_GUI=false

LOG_FILE=""/u01/app/oracle/network/tools/log/netca.log""

NSN_PROTOCOLS={"TCP;chen;1521"}

其它 都为默认值

 

[oracle@chen ~]$ $ORACLE_HOME/bin/netca -silent -responseFile /home/oracle/netca.rsp

 

Warning: Failed to create log file:

    /u01/app/oracle/network/tools/log/netca.log

Fri Jul 24 10:43:26 CST 2015 Oracle Net Configuration Assistant

Parsing command line arguments:

    Parameter "silent" = true

    Parameter "responsefile" = /home/oracle/netca.rsp

    Parameter "log" = /u01/app/oracle/network/tools/log/netca.log

Done parsing command line arguments.

Oracle Net Services Configuration:

Profile configuration complete.

Oracle Net Listener Startup:

    Running Listener Control:

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

    Listener Control complete.

    Listener started successfully.

Listener configuration complete.

Oracle Net Services configuration successful. The exit code is 0

 

4.3 查看安装效果

[oracle@chen ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.3.0 - Production on 24-JUL-2015 10:44:13

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

 

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

STATUS of the LISTENER

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

Alias                     LISTENER

Version                   TNSLSNR for Linux: Version 11.2.0.3.0 - Production

Start Date                24-JUL-2015 10:43:27

Uptime                    0 days 0 hr. 0 min. 46 sec

Trace Level               off

Security                  ON: Local OS Authentication

SNMP                      OFF

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

Listener Log File         /u01/app/oracle/diag/tnslsnr/chen/listener/alert/log.xml

Listening Endpoints Summary...

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

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

Services Summary...

Service "orcl" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

Service "orclXDB" has 1 instance(s).

  Instance "orcl", status READY, has 1 handler(s) for this service...

The command completed successfully

 

[oracle@chen ~]$ cd $ORACLE_HOME/network/admin

[oracle@chen admin]$ vim listener.ora

# listener.ora Network Configuration File: /u01/app/oracle/product/11.2.0/network/admin/listener.ora

# Generated by Oracle configuration tools.

 

LISTENER =

  (DESCRIPTION_LIST =

    (DESCRIPTION =

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

      (ADDRESS = (PROTOCOL = TCP)(HOST = chen)(PORT = 1521))

    )

  )

 

ADR_BASE_LISTENER = /u01/app/oracle

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29785807/viewspace-1749429/,如需转载,请注明出处,否则将追究法律责任。

上一篇: Oracle ASM查看信息
请登录后发表评论 登录
全部评论
纸上得来终觉浅,绝知此事要躬行!

注册时间:2014-08-05

  • 博文量
    235
  • 访问量
    744969