How to install oracle by Command Line Interface(CLI) in silent mode on Linux

本文详细介绍了如何在Linux环境下通过命令行界面(CLI)以静默模式安装Oracle数据库。首先,解释了静默模式安装的好处,如在没有GUI的服务器环境中自动化安装过程。接着,详细描述了准备操作系统环境的步骤,包括安装媒体、系统包需求、创建用户和用户组、检查资源限制以及配置内核参数。然后,指导如何准备响应文件,并提供了修改和保存文件的建议。最后,详细阐述了安装过程和可能出现的警告,以及安装成功后的验证和后期配置。这是一份完整的Oracle静默安装教程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. Why silent mode?

Typically, Oracle Universal Installer runs in interactive mode, which means that we need to stay before the server to wait it prompts you to provide information in graphical user interface (GUI) screens.

Oracle also supply another mode to install database: Silent mode. When you use this mode, you don't need to stay before server, we use a response files to provide this information, and then run Oracle Universal Installer in Command Line Interface(CLI)Then oracle can automate the installation and configuration of Oracle software without interactive with human.

There are 3 benifits with silent mode:

  • On many server environment, there aren't GUI screens, we can just connect to the server by SSH with Command Line Interface.
  • We need to fast install many server with the same configuration. We can copy the response file to many server and then issue a command, that is so convenience.
  • In ome situation, In silent mode, we can integrate the DB install process with other deploy process.

At the follow step 2 to step 5, give a guildline of how to install oracle in silent mode, please follow it one by one.

2. Prepare the OS environment.

 

2.1 Prepare the install media.

First of all, we need some prerequisite before the installation:

  1. A server installed linux 4 or linux 5. 
  2. Require the root account and password of the server.
  3. At least 10G free disk space of your server.
  4. At least 1G memory of the server.
  5. The oracle install media of appropriate bit (32 or 64) with you OS.

You can download install media from oracle web site www.oracle.com or AAXIS fileserver: \\fileserver\Software\Database\.

Here, for example, we download the follow 2 files from \\fileserver\Software\Database\Oracle11gR2_Linux64

  • linux.x64_11gR2_database_1of2.zip
  • linux.x64_11gR2_database_1of2.zip

Next we need to upload the 2 files to the server which you need to install oracle database, here we put them into file folder /opt/oracle_software/

  • Notes: If /opt/oracle_software/ is not exists then execute "mkdir -p /opt/oracle_software" by root to create it.

Then, unzip the 2 files by root using the follow command:

unzip linux.x64_11gR2_database_1of2.zip

unzip linux.x64_11gR2_database_1of2.zip

2.2 Package requirements.

You must install the packages (or later versions) listed in the following table, and ensure that the list of RPMs are installed.

  •  Check which RPMS list you have to install.

Execute 'uname -a' by root to query the Linux version, you will see the output like this:

[root@rac1 ~]# uname -a
Linux rac1 2.6.18-274.el5 #1 SMP Fri Jul 22 04:43:29 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

The above example: 'el5' and 'x86_64' means that you OS is linux 5 and 64 bit, you need to check the fourth line of the follow table.

 

[root@rac1 ~]# uname -a

Linux rac1 2.6.9-89.ELsmp #1 SMP Mon Jun 22 12:32:43 EDT 2009 i686 i686 i386 GNU/Linux

The above example: You find i686 i386 but not  postfix with "_64" means that the OS is 32 bit.

  • Query which RPMS NOT installed.

Exexute 'rpm -qa | grep packagename' by root to query if the package is installed.

Notes: Packagename should not include version. For example, we check the first package "binutils-2.17.50.0.6" to see if it is installed like this:

[root@rac1 ~]# rpm -qa | grep binutils
binutils-2.17.50.0.6-14.el5

The output "binutils-2.17.50.0.6-14.el5" means that the this package is installed already. If there are nothing output means that the package is not installed, we need to execute the follow step.

  • Install the missing RPMS.

There are 2 methods to install RPMS:

    1. Download the missing rpm package and then execute 'rpm -ivh packagename' by root to install the missing package. Here the packagename means the full name of file you download.
    2. If the server can connect to internet, you can execute 'yum install packagename' by root , it will download automatically and then install it.

               Recommendation: There are some dependency between the packages, so we suggest you use the second method "yum" to install the missing package, because yum can resolve dependency automatically.

 

Operating System Requirement

Linux 4

X86 32bit

The following packages (or later versions) must be installed:
binutils-2.15.92.0.2
compat-libstdc++-33-3.2.3
elfutils-libelf-0.97
elfutils-libelf-devel-0.97
gcc-3.4.6
gcc-c++-3.4.6
glibc-2.3.4-2.41
glibc-common-2.3.4
glibc-devel-2.3.4
glibc-headers-2.3.4
libaio-devel-0.3.105
libaio-0.3.105
libgcc-3.4.6
libstdc++-3.4.6
libstdc++-devel-3.4.6
make-3.80
numactl-0.6.4.i386
pdksh-5.2.14
sysstat-5.0.5

Linux 5

X86 32bit

The following packages (or later versions) must be installed:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
elfutils-libelf-devel-static-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-common-2.5
glibc-devel-2.5
glibc-headers-2.5
kernel-headers-2.6.18
ksh-20060214
libaio-0.3.106
libaio-devel-0.3.106 
libgcc-4.1.2
libgomp-4.1.2
libstdc++-4.1.2 
libstdc++-devel-4.1.2
make-3.81
numactl-devel-0.9.8.i386
sysstat-7.0.2

Linux 4

X86-64

The following packages (or later versions) must be installed:
binutils-2.15.92.0.2
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.97
elfutils-libelf-devel-0.97
expat-1.95.7
gcc-3.4.6
gcc-c++-3.4.6
glibc-2.3.4-2.41
glibc-2.3.4-2.41 (32 bit)
glibc-common-2.3.4
glibc-devel-2.3.4
glibc-headers-2.3.4
libaio-0.3.105
libaio-0.3.105 (32 bit)
libaio-devel-0.3.105
libaio-devel-0.3.105 (32 bit)
libgcc-3.4.6
libgcc-3.4.6 (32-bit)
libstdc++-3.4.6
libstdc++-3.4.6 (32 bit)
libstdc++-devel 3.4.6
make-3.80
numactl-0.6.4.x86_64
pdksh-5.2.14
sysstat-5.0.5

Linux 5

X86-64

The following packages (or later versions) must be installed:
binutils-2.17.50.0.6
compat-libstdc++-33-3.2.3
compat-libstdc++-33-3.2.3 (32 bit)
elfutils-libelf-0.125
elfutils-libelf-devel-0.125
gcc-4.1.2
gcc-c++-4.1.2
glibc-2.5-24
glibc-2.5-24 (32 bit)
glibc-common-2.5
glibc-devel-2.5
glibc-devel-2.5 (32 bit)
glibc-headers-2.5
ksh-20060214
libaio-0.3.106
libaio-0.3.106 (32 bit)
libaio-devel-0.3.106
libaio-devel-0.3.106 (32 bit)
libgcc-4.1.2
libgcc-4.1.2 (32 bit)
libstdc++-4.1.2
libstdc++-4.1.2 (32 bit)
libstdc++-devel 4.1.2
make-3.81
numactl-devel-0.9.8.x86_64
sysstat-7.0.2



2.3 Creating Required Operating System Groups and Users

If this is the first time Oracle software is being installed on this system that you are installing, you may need to create several operating system groups and users.

 

2.3.1 Create user and usergroup

Execute the follow commands by root to create user and usergroup:

 

groupadd oinstall

groupadd dba

useradd -g oinstall -G dba oracle

passwd oracle

After the last command "passwd oracle", it will prompt you to input the password of user oracle. After input it and go on.

 

2.3.2 Create folder

Execute the follow commands by root to create folder:

 

mkdir -p /opt/oracle

chown -R oracle:oinstall /opt/oracle

chown -R oracle:oinstall /opt/oracle_software

chmod -R 775 /opt/oracle

chmod -R 775 /opt/oracle_software

 

2.3.3 Set environment variables 

Edit /home/oracle/.bash_profile by oracle to add the follow lines:

 

export ORACLE_BASE=/opt/oracle

export ORACLE_HOME=$ORACLE_BASE/11gR2

export ORACLE_SID=orcl

export PATH=$PATH:$ORACLE_HOME/bin

2.3.4 Make the environment variables effective

After add it, execute the follow command by oracle to make it effective:

source /home/oracle/.bash_profile

2.4 Checking Resource Limits for the Oracle Software Installation Users

Update the resource limits in the /etc/security/limits.conf configuration file for the installation owner "oracle". For example, using root to add the following lines to the /etc/security/limits.conf file:

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

oracle soft stack 10240

2.5 Configuring Kernel Parameters for Linux

If the value of any kernel parameter is different from the minimum value, then perform the following:

    • 1. Log on as root, Using any text editor such as "vi" to edit the /etc/sysctl.conf file, edit lines similar to the following, if that are not exists please add them:

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

    • 2.Enter the following command by root to change the current values of the kernel parameters:

/sbin/sysctl -p

3. Prepare the response file.

 

This section describes how to prepare and configure a response file for use during silent mode  installations. 

3.1 Copy a Response File

If you copied the software to a hard disk, the response files are located in the "/opt/oracle_software/database/response" directory.

Using user oracle to Copy the response file from the response file directory to a directory on your system:

$ cp   /opt/oracle_software/database/response/db_install.rsp   /opt/oracle

 

3.2 Edit a Response File

Open the response file in a text editor and modify it by oracle :

  $ vi /opt/oracle/db_install.rsp

The follow is a template response file, you can refer it to modify your rsp file or use it to overwrite your db_install.rsp file :


oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
oracle.install.option=INSTALL_DB_AND_CONFIG
ORACLE_HOSTNAME=rac1
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/opt/oracle/oraInventory
SELECTED_LANGUAGES=en
ORACLE_HOME=/opt/oracle/11gR2
ORACLE_BASE=/opt/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=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= 500
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=/opt/oracle/oradata
oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=/opt/oracle/dbrecovery
oracle.install.db.config.asm.diskGroup=
oracle.install.db.config.asm.ASMSNMPPassword=
MYORACLESUPPORT_USERNAME=
MYORACLESUPPORT_PASSWORD=
SECURITY_UPDATES_VIA_MYORACLESUPPORT= false
DECLINE_SECURITY_UPDATES= true
PROXY_HOST=
PROXY_PORT=
PROXY_USER=
PROXY_PWD=


All the parameter can be the same with the template except "ORACLE_HOSTNAME", you MUST modify it to your own hostname, you can execute the follow command to query your hostname:

[root@rac1 ~]# hostname
rac1

Here are some parameter need to pay more attention, we will give some suggestion of how to set it:

  • oracle.install.option=INSTALL_DB_AND_CONFIG

"oracle.install.option" Specify the installation option. It can be one of the following:
1. INSTALL_DB_SWONLY
2. INSTALL_DB_AND_CONFIG
 

INSTALL_DB_SWONLY means install db software only (not include instance).

INSTALL_DB_AND_CONFIG means install db software and create an instance.

Recommendation: To simplify the install process, you'd better set it to INSTALL_DB_AND_CONFIG.

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

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

               These 2 parameter supply the instance name.

               Recommendation: You can modify them to other name different from default "orcl", but you'd better set these 2 paramters same. 

  • oracle.install.db.InstallEdition=EE

This parameter specify the installation edition of the component. The value should contain only one of these choices. 
    EE : Enterprise Edition 
    SE : Standard Edition 
    SEONE : Standard Edition One
    PE : Personal Edition (WINDOWS ONLY)
Recommendation: This parameter depends on the license you bought from ORACLE. If your Database is used for ATG and other enterprise application, it will use some features which only EE have, please install EE (Enterprise Edition).

  • oracle.install.db.config.starterdb.password.ALL=oracle

               This parameter specify the password of administrator account such as "sys" and "system", you can modify it to a complex password.

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

               This parameter specify how many memory we allot to oracle, it is unit is MB.

               Recommendation: Allot 40% of your phisical memory to oracle database.

3.3 Save file and change the permissions

Change the permissions on the file to 700 by oracle:

$ chmod 700 /opt/oracle/db_install.rsp

 

4. Installation

4.1 Install


After edit a response file and saved it, issue the follow command by oracle user:  

Notes: This command must be executed by oracle.

/opt/oracle_software/database/runInstaller -ignoreSysPrereqs -ignorePrereq -silent -nowelcome -responseFile /opt/oracle/db_install.rsp

After issue this command, your screens will be similer with 4.2 and 4.3. Please don't close the windows and wait about half an hour until you see "Successfully Setup Software" and then press Enter.

In this process, if you see warning please refer "4.2 Waring", if you see error, please refer "step6:troubleshooting",

4.2 Warning

There will be some warning in the install windows as follow, you can ignore it:

[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.

 

[WARNING] [INS-30011] The password entered does not conform to the Oracle recommended standards.
CAUSE: Oracle recommends that the ADMIN password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
ACTION: Provide a password that conforms to the Oracle recommended standards.

 

[WARNING] [INS-32055] The Central Inventory is located in the Oracle base.
CAUSE: The Central Inventory is located in the Oracle base.
ACTION: Oracle recommends placing this Central Inventory in a location outside the Oracle base directory.

 

[WARNING] [INS-30011] The password entered does not conform to the Oracle recommended standards.
CAUSE: Oracle recommends that the ADMIN password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
ACTION: Provide a password that conforms to the Oracle recommended standards.

4.3 Validate install and execute some scripts

At the end of the install window, there will be some log like this:

You can find the log of this install session at:
/opt/oracle/oraInventory/logs/installActions2013-03-13_02-30-53PM.log

 

here, wait about 30 minutes....


[oracle@rac1 oracle]$ The following configuration scripts need to be executed as the "root" user. 
#!/bin/sh 
#Root scripts to run

/opt/oracle/oraInventory/orainstRoot.sh
/opt/oracle/11gR2/root.sh

To execute 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

Successfully Setup Software.

 

There are 3 information need to notice:

    1. The red line above is added by author, that means at there you will see nothing happens, please don't close the window and wait 30 minutes. 
    2. After 30 minutes' wait, there will be a tips that prompt you to run 2 scripts by root, please execute them at another window by root:
    • /opt/oracle/oraInventory/orainstRoot.sh
    • /opt/oracle/11gR2/root.sh
  1. At last, the last line "Successfully Setup Software." means that the installation is complete successfully.

5. PostInstallation Configuration.

5.1 Execute postinstallation scripts.

After installation, you need to  modify some settings.
  • 1.Logon sqlplus by user oracle.

sqlplus "/as sysdba"

  • 2.Execute the follow sql within sqlplus

ALTER system SET processes=2000 scope=spfile;

ALTER system SET sessions=2200 scope=spfile;

ALTER profile DEFAULT LIMIT FAILED_LOGIN_ATTEMPTS unlimited;

ALTER profile DEFAULT LIMIT PASSWORD_LIFE_TIME unlimited;

  • 3.Restart database to make the modify effective using the follow sql.

shutdown immediate;

startup open;

5.2 How to validate the installation success

After issue "startup open", if you see the follow message, it means the installation is success.

SQL> startup open
ORACLE instance started.

Total System Global Area 523108352 bytes
Fixed Size 1337632 bytes
Variable Size 473958112 bytes
Database Buffers 41943040 bytes
Redo Buffers 5869568 bytes
Database mounted.
Database opened.

6. Troubleshooting & Solution

6.1 Error in installing 11g2 in silent mode - [SEVERE] - Email Address Not Spec 


I got error in a couple of seconds when run "/opt/oracle_software/database/runInstaller -ignoreSysPrereqs -ignorePrereq -silent -nowelcome -responseFile /opt/oracle/db_install.rsp" :

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

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

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2010-01-08_05-20-03PM. 

Please wait ...[oracle@cchdb database]$ [SEVERE] - Email Address Not Specified

After contact with oracle support, turns out you need to set 'DECLINE_SECURITY_UPDATES=true' in file "db_install.rsp" and that will get you pass this error.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值