千家信息网

oracle install silent

发表于:2025-11-09 作者:千家信息网编辑
千家信息网最后更新 2025年11月09日,[root@silent opt]# rpm -ivh *.rpmwarning: compat-libcap1-1.10-1.x86_64.rpm: Header V3 RSA/SHA256 Sig
千家信息网最后更新 2025年11月09日oracle install silent

[root@silent opt]# rpm -ivh *.rpm

warning: compat-libcap1-1.10-1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY

warning: pdksh-5.2.14-30.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 73307de6: NOKEY

Preparing... ########################################### [100%]

1:pdksh ########################################### [ 25%]

2:libaio-devel ########################################### [ 50%]

3:elfutils-libelf-devel ########################################### [ 75%]

4:compat-libcap1 ########################################### [100%]




#!/bin/bash

#description:this script used to create a oracle groups user user environment settings the installation directory

#by lineqi

#2014-07-26


#Add oracle groups

groupadd -g 501 oinstall

groupadd -g 502 dba

groupadd -g 503 oper


#Add oracle user and Seting a oracle user password

useradd -u 502 -g oinstall -G dba,oper oracle;echo "oracle"|passwd --stdin oracle


#Seting a oracle user password

#passwd oracle<

#oracle

#oracle

#EOF


#mkdir the oracle installation directory

mkdir -p /u01/app/oracle

mkdir -p /u01/app/oraInventory

chmod -R 777 /u01/app

chown -R oracle:oinstall /u01/app/


#Add the following content to /home/oracle/.bash_profile

cat>>/home/oracle/.bash_profile<

export ORACLE_SID=orcl

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=/u01/app/oracle/product/11.2/dbhome_1

export PATH=\$ORACLE_HOME/bin:.:\$PATH

export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK

export NLS_DATE_FORMAT='yyyy-mm-dd HH24:mi:ss'

export ORACLE_UNQNAME=orcl

EOF

su - oracle -c ". .bash_profile"




set_para.sh


#!/bin/bash

#description:this script is used to set the oracle installation environment parameters

#by lineqi

#2014-07-26


#Add the following contents to /etc/hosts

cat >>/etc/hosts<

#for oracle

192.168.1.32silent


EOF


#Add the following contents to /etc/security/limits.conf


cat>>/etc/security/limits.conf<

#for oracle

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

oracle hard stack 10240

EOF

sleep 2


#Add the following contents to /etc/pam.d/login


cat>>/etc/pam.d/login<

# for oracle

session required pam_limits.so

EOF


sleep 1


#Add the following contents to /etc/sysctl.conf


cat>>/etc/sysctl.conf<

# for oracle

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 = 1048576

fs.aio-max-nr = 1048576

fs.file-max = 6815744

EOF

sysctl -p >>/dev/null 2>&1


#Add the following contents to /etc/profile


cat>>/etc/profile<

# for oracle

if [ \$USER = "oracle" ]; then

if [ \$SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

EOF


#Replace the following contents to /etc/selinux/config

sed -i "s/SELINUX=enforcing/SELINUX=disabled/g" `grep SELINUX=enforcing -rl /etc/selinux/config`




[root@silent opt]# ls -lt

total 288

-rw-r--r--. 1 root root 1525 Oct 8 17:30 set_para.sh

-rw-r--r--. 1 root root 999 Oct 8 17:26 cre_dir.sh

-rw-r--r--. 1 root root 13516 Aug 10 18:48 libaio-devel-0.3.107-10.el6.x86_64.rpm

-rw-r--r--. 1 root root 32232 Aug 10 18:47 elfutils-libelf-devel-0.152-1.el6.x86_64.rpm

-rw-r--r--. 1 root root 17700 Aug 10 18:47 compat-libcap1-1.10-1.x86_64.rpm

-rw-r--r--. 1 root root 207399 Apr 26 2014 pdksh-5.2.14-30.x86_64.rpm

drwxr-xr-x. 7 root root 4096 Aug 27 2013 database


[root@silent opt]# chmod +x *.sh

[root@silent opt]# ls -lt

total 288

-rwxr-xr-x. 1 root root 1525 Oct 8 17:30 set_para.sh

-rwxr-xr-x. 1 root root 999 Oct 8 17:26 cre_dir.sh

-rw-r--r--. 1 root root 13516 Aug 10 18:48 libaio-devel-0.3.107-10.el6.x86_64.rpm

-rw-r--r--. 1 root root 32232 Aug 10 18:47 elfutils-libelf-devel-0.152-1.el6.x86_64.rpm

-rw-r--r--. 1 root root 17700 Aug 10 18:47 compat-libcap1-1.10-1.x86_64.rpm

-rw-r--r--. 1 root root 207399 Apr 26 2014 pdksh-5.2.14-30.x86_64.rpm

drwxr-xr-x. 7 root root 4096 Aug 27 2013 database


系统初始化参数设置

[root@silent opt]# ./set_para.sh

[root@silent opt]# ./cre_dir.sh

Changing password for user oracle.

passwd: all authentication tokens updated successfully.

更改权限


[root@silent opt]# chown -R oracle:oinstall database/

[root@silent opt]# chmod 775 -R database/


创建oraInst.loc文件

[root@silent opt]# cat /etc/oraInst.loc

inventory_loc=/u01/app/oraInventory

inst_group=oinstall

[root@silent opt]#

[root@silent opt]# ls -l /etc/oraInst.loc

-rw-r--r--. 1 root root 56 Oct 8 17:37 /etc/oraInst.loc

[root@silent opt]# chown oracle:oinstall /etc/


准备响应文件内容


[root@silent opt]# less /opt/database/response/db_install.rsp |grep -v "#"|grep -v "^$"



[root@silent opt]# cat db_install.rsp

oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0

oracle.install.option=INSTALL_DB_SWONLY

ORACLE_HOSTNAME=silent

UNIX_GROUP_NAME=oinstall

INVENTORY_LOCATION=/u01/app/oraInventory

SELECTED_LANGUAGES=en,zh_CN

ORACLE_HOME=/u01/app/oracle/product/11.2/dbhome_1

ORACLE_BASE=/u01/app/oracle

oracle.install.db.InstallEdition=EE

oracle.install.db.EEOptionsSelection=false

oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.4.0,oracle.oraolap:11.2.0.4.0,oracle.rdbms.dm:11.2.0.4.0,oracle.rdbms.dv:11.2.0.4.0,oracle.rdbms.lbac:11.2.0.4.0,oracle.rdbms.rat:11.2.0.4.0

oracle.install.db.DBA_GROUP=dba

oracle.install.db.OPER_GROUP=oper

oracle.install.db.CLUSTER_NODES=

oracle.install.db.isRACOneInstall=

oracle.install.db.racOneServiceName=

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=ZHS16GBK

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=orcl

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.automatedBackup.enable=false

oracle.install.db.config.starterdb.automatedBackup.osuid=

oracle.install.db.config.starterdb.automatedBackup.ospwd=

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

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=false

PROXY_HOST=

PROXY_PORT=

PROXY_USER=

PROXY_PWD=

PROXY_REALM=

COLLECTOR_SUPPORTHUB_URL=

oracle.installer.autoupdates.option=

oracle.installer.autoupdates.downloadUpdatesLoc=

AUTOUPDATES_MYORACLESUPPORT_USERNAME=

AUTOUPDATES_MYORACLESUPPORT_PASSWORD=


各参数含义如下:


-silent 表示以静默方式安装,不会有任何提示


-force 允许安装到一个非空目录


-noconfig 表示不运行配置助手netca


-responseFile 表示使用哪个响应文件,必需使用绝对路径


oracle.install.responseFileVersion 响应文件模板的版本,该参数不要更改


oracle.install.option 安装选项,本例只安装oracle软件,该参数不要更改


DECLINE_SECURITY_UPDATES 是否需要在线安全更新,设置为false,该参数不要更改


ORACLE_HOSTNAME 安装主机名


UNIX_GROUP_NAME oracle用户用于安装软件的组名


INVENTORY_LOCATION oracle产品清单目录


SELECTED_LANGUAGES oracle运行语言环境,一般包括引文和简繁体中文


ORACLE_HOME Oracle安装目录


ORACLE_BASE oracle基础目录


oracle.install.db.InstallEdition 安装版本类型,一般是企业版


oracle.install.db.isCustomInstall 是否定制安装,默认Partitioning,OLAP,RAT都选上了


oracle.install.db.customComponents 定制安装组件列表:除了以上默认的,可加上Label Security和Database Vault


oracle.install.db.DBA_GROUP oracle用户用于授予OSDBA权限的组名


oracle.install.db.OPER_GROUP oracle用户用于授予OSOPER权限的组名



[root@silent opt]# chown oracle:oinstall db_install.rsp

[root@silent opt]# chmod 775 db_install.rsp



[oracle@silent database]$ ./runInstaller -silent -force -ignorePrereq -responseFile /opt/db_install.rsp

Starting Oracle Universal Installer...


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

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

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2015-10-08_06-23-55PM. Please wait ...[oracle@silent database]$ [WARNING] - My Oracle Support Username/Email Address Not Specified

[SEVERE] - The product will be registered anonymously using the specified email address.

You can find the log of this install session at:

/u01/app/oraInventory/logs/installActions2015-10-08_06-23-55PM.log

The installation of Oracle Database 11g was successful.

Please check '/u01/app/oraInventory/logs/silentInstall2015-10-08_06-23-55PM.log' for more details.


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

1. /u01/app/oracle/product/11.2/dbhome_1/root.sh



Successfully Setup Software.


执行脚本


[root@silent ~]# /u01/app/oracle/product/11.2/dbhome_1/root.sh

Check /u01/app/oracle/product/11.2/dbhome_1/install/root_silent_2015-10-08_18-45-26.log for the output of root script

[root@silent ~]# cat /u01/app/oracle/product/11.2/dbhome_1/install/root_silent_2015-10-08_18-45-26.log

Performing root user operation for Oracle 11g


The following environment variables are set as:

ORACLE_OWNER= oracle

ORACLE_HOME= /u01/app/oracle/product/11.2/dbhome_1

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.

Finished product-specific root actions.



silent方式建库


[oracle@silent ~]$ cd /u01/app/oracle/product/11.2/dbhome_1/assistants/dbca/templates/

[oracle@silent templates]$ ls

Data_Warehouse.dbc example01.dfb example.dmp General_Purpose.dbc New_Database.dbt Seed_Database.ctl Seed_Database.dfb


dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName orcl -sid orcl -sysPassword orcl -systemPassword orcl -characterset ZHS16GBK -nationalCharacterSet AL16UTF16


[oracle@silent templates]$ dbca -silent -createDatabase -templateName General_Purpose.dbc -gdbName orcl -sid orcl -sysPassword orcl -systemPassword orcl -characterset ZHS16GBK -nationalCharacterSet AL16UTF16

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.


配置监听


[oracle@silent admin]$ pwd

/u01/app/oracle/product/11.2/dbhome_1/network/admin

[oracle@silent admin]$ vi listener.ora


LISTENER =

(ADDRESS_LIST=

(ADDRESS=(PROTOCOL=tcp)(HOST=silent)(PORT=1521))

(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))

"listener.ora" 127L, 3996C written

[oracle@silent admin]$ lsnrctl start

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 08-OCT-2015 19:08:31


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


Starting /u01/app/oracle/product/11.2/dbhome_1/bin/tnslsnr: please wait...


TNSLSNR for Linux: Version 11.2.0.4.0 - Production

System parameter file is /u01/app/oracle/product/11.2/dbhome_1/network/admin/listener.ora

Log messages written to /u01/app/oracle/diag/tnslsnr/silent/listener/alert/log.xml

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=silent)(PORT=1521)))

Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))


Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=silent)(PORT=1521))

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date 08-OCT-2015 19:08:32

Uptime 0 days 0 hr. 0 min. 0 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

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

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

Listening Endpoints Summary...

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

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

The listener supports no services

The command completed successfully

[oracle@silent admin]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 08-OCT-2015 19:08:36


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


Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=silent)(PORT=1521))

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date 08-OCT-2015 19:08:32

Uptime 0 days 0 hr. 0 min. 4 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

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

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

Listening Endpoints Summary...

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

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

The listener supports no services

The command completed successfully

[oracle@silent admin]$ lsnrctl status


LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 08-OCT-2015 19:09:52


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


Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=silent)(PORT=1521))

STATUS of the LISTENER

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

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production

Start Date 08-OCT-2015 19:08:32

Uptime 0 days 0 hr. 1 min. 20 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

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

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

Listening Endpoints Summary...

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

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

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


0