oracle 11g 單實例靜默安裝

環境規劃:
OS Version : CentOS Linux release 7.4.1708 (Core) 
Oracle Version: 11.2.0.4
操作系統環境配置可參考Oracle 單實例安裝文檔
 1、修改響應文件相關參數
 
vi db_install.rsp

oracle.install.option=INSTALL_DB_SWONLY            //安裝類型
ORACLE_HOSTNAME=hostname                           //主機名稱
UNIX_GROUP_NAME=oinstall                           //安裝組
INVENTORY_LOCATION=/db/oraInventory                //INVENTORY目錄
SELECTED_LANGUAGES=en,zh_CN                      //選擇語言
ORACLE_HOME=/db/oracle/product/11.2.0/db_1         //oracle_home
ORACLE_BASE=/db/oracle                             //oracle_base
oracle.install.db.InstallEdition=EE                //oracle版本
oracle.install.db.isCustomInstall=true             //自定義安裝
oracle.install.db.DBA_GROUP=dba                    //dba用戶組
oracle.install.db.OPER_GROUP=oinstall              //oper用戶組
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE                   //數據庫類型
oracle.install.db.config.starterdb.globalDBName=oadb                      //globalDBName
oracle.install.db.config.starterdb.SID=orcl         //SID
oracle.install.db.config.starterdb.characterSet=AL32UTF8                  //字符集
oracle.install.db.config.starterdb.memoryLimit=512                        //自動管理內存的最小內存(M)
oracle.install.db.config.starterdb.password.ALL=oracle                    //設定所有數據庫用戶使用同一個密碼
DECLINE_SECURITY_UPDATES=true                   //設置安全更新 
oracle.installer.autoupdates.option=SKIP_UPDATES
 
 
3、靜默 安裝數據庫軟件
 
[ora11g@elk-master database]$ ./runInstaller -silent -responseFile /data/lyp/setup/database/db_install.rsp

安裝過程中如果出現Fail,說明安裝中斷。
出現Waring可以不用理會,此時安裝仍在進行,可隨時注意查看安裝日誌即可。

[ora11g@elk-master database]$ ./runInstaller -silent -force -responseFile /data/lyp/setup/database/db_install.rsp 
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 77870 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 542 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2020-02-06_10-56-09AM. Please wait ...
[ora11g@elk-master database]$ [WARNING] [INS-13014] Target environment do not meet some optional requirements.
   CAUSE: Some of the optional prerequisites are not met. See logs for details. /opt/oracle/oraInventory/logs/installActions2020-02-06_10-56-09AM.log
   ACTION: Identify the list of failed prerequisite checks from the log: /opt/oracle/oraInventory/logs/installActions2020-02-06_10-56-09AM.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:
 /opt/oracle/oraInventory/logs/installActions2020-02-06_10-56-09AM.log
The installation of Oracle Database 11g was successful.
Please check '/opt/oracle/oraInventory/logs/silentInstall2020-02-06_10-56-09AM.log' for more details.

As a root user, execute the following script(s):
        1. /data/lyp/oracle/product/11.2.0/db_1/root.sh


Successfully Setup Software.

[ora11g@elk-master database]$ 

正常輸出

這裏提示安裝成功,運行腳本:

[root@elk-master /]# /data/lyp/oracle/product/11.2.0/db_1/root.sh
Check /data/lyp/oracle/product/11.2.0/db_1/install/root_elk-master_2020-02-06_10-59-44.log for the output of root script
[root@elk-master /]# cat /data/lyp/oracle/product/11.2.0/db_1/install/root_elk-master_2020-02-06_10-59-44.log
Performing root user operation for Oracle 11g 

The following environment variables are set as:
    ORACLE_OWNER= ora11g
    ORACLE_HOME=  /data/lyp/oracle/product/11.2.0/db_1
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

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.
[root@elk-master /]# 


 
4、靜默配置監聽
[ora11g@elk-master database] $ORACLE_HOME/bin/netca /silent /responseFile /data/lyp/setup/database/netca.rsp 

可直接修改 /netca.rsp 文件內的配置來創建監聽


 5、靜默安裝數據庫
 
安裝數據庫可以通過修改響應文件和直接使用命令 兩種方式來安裝

修改僅安裝數據庫的響應文件
vim  /home/oracle/rsp/dbca.rsp

[CREATEDATABASE]                    //僅修改此部分即可,可按照實際需求調整
GDBNAME="oadb.template"             //全局數據庫的名字=SID+主機域名
SID="oadb"                          //SID
CHARACTERSET="AL32UTF8"             //編碼
NATIONALCHARACTERSET="AL16UTF16"         //編碼 
DATAFILEDESTINATION=$ORACLE_BASE/oradata  //數據文件路徑,默認爲$ORACLE_BASE/oradata
開始靜默創建數據庫: 
執行之後會要求輸入sys/system 密碼(可以在響應文件中直接修改) 

[ora11g@elk-master database]$ $ORACLE_HOME/bin/dbca -silent -responseFile /data/lyp/setup/database/dbca.rsp 
Enter SYS user password: 
oracle
Enter SYSTEM user password: 
oracle
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 "/data/lyp/oracle/cfgtoollogs/dbca/lypdb/lypdb.log" for further details.
[ora11g@elk-master database]$ 

數據庫創建完成。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章