oracle 11g 單實例靜默安裝 AURHOR:Oracle_Ran 環境規劃: 操作系統環境配置可參考Oracle 單實例安裝文檔 1、上傳Oracle安裝介質,進入解壓目錄,複製響應文件模板 2、修改響應文件相關參數 3、靜默 安裝資料庫軟體 4、靜默配置監聽 5、靜默安裝資料庫 後續的參數 ...
oracle 11g 單實例靜默安裝
AURHOR:Oracle_Ran
環境規劃:
OS Version : Red Hat Enterprise Linux Server release 6.7 (Santiago)
Oracle Version: 11.2.0.4
操作系統環境配置可參考Oracle 單實例安裝文檔
1、上傳Oracle安裝介質,進入解壓目錄,複製響應文件模板
cd /home/oracle/
mkdir rsp
cp /db/soft/database/response/* /home/oracle/rsp/
su - root
chmod 700 /home/oracle/rsp/*.rsp
chown -R oracle:oinstall /home/oracle/rsp/
2、修改響應文件相關參數
vi /home/oracle/rsp/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,AL32UTF8 //選擇語言
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 //設置安全更新
3、靜默 安裝資料庫軟體
[oracle@template database]$ ./runInstaller -silent -force -responseFile /home/oracle/res/db_install.rsp
【註意】
安裝過程中如果出現Fail,說明安裝中斷。
出現Waring可以不用理會,此時安裝仍在進行,可隨時註意查看安裝日誌即可。
Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 8033 MB Passed Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-04-05_06-27-07PM. Please wait ...
[oracle@template database]$ [F] [INS-10101] The given response file /home/oracle/res/db_install.rsp is not found. CAUSE: The given response file is either not accessible or do not exist. ACTION: Give a correct response file location. (Note: relative path is not supported) A log of this session is currently saved as: /tmp/OraInstall2018-04-05_06-27-07PM/installActions2018-04-05_06-27-07PM.log.
Oracle recoms that if you want to keep this log, you should move it from the temporary location to a more permanent location. 根據紅色部分提示,發現路徑寫錯。
再次執行: [oracle@template database]$ [oracle@template database]$ ./runInstaller -silent -force -responseFile /home/oracle/rsp/db_install.rsp Starting Oracle Universal Installer... Checking Temp space: must be greater than 120 MB. Actual 8033 MB Passed Checking swap space: must be greater than 150 MB. Actual 4095 MB Passed Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-04-05_06-31-06PM. Please wait ...[oracle@template database]$ [Wt meet some optional requirements. CAUSE: Some of the optional prerequisites are not met. See logs for details. /tmp/OraInstall2018-04-05_06-31-06PM/installActions2018 ACTION: Identify the list of failed prerequisite checks from the log: /tmp/OraInstall2018-04-05_06-31-06PM/installActions2018-04-05_e 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: /db/oraInventory/logs/installActions2018-04-05_06-31-06PM.log 正常輸出 這裡提示安裝成功,運行腳本:
[oracle@template database]$ The installation of Oracle Database 11g was successful. Please check '/db/oraInventory/logs/silentInstall2018-04-05_06-31-06PM.log' for more details. As a root user, execute the following script(s): 1. /db/oracle/product/11.2.0/db_1/root.sh Successfully Setup Software. 到root 用戶執行該腳本:
/db/oracle/product/11.2.0/db_1/root.sh
查看安裝日誌: (安裝已經完成)
tail -f /db/oraInventory/logs/installActions2018-04-05_06-31-06PM.log
...
...
INFO: Completed validating state <finish>
INFO: Terminating all background operations
INFO: Terminated all background operations
INFO: Successfully executed the flow in SILENT mode
INFO: Adding ExitStatus SUCCESS_WITH_WARNINGS to the exit status set
INFO: Finding the most appropriate exit status for the current application
INFO: Exit Status is 6
INFO: List of warnings encountered in this Application:
INFO: PREREQS_FAILED_WITH_WARNING
INFO: Shutdown Oracle Database 11g Release 2 Installer
登錄驗證安裝成功:
4、靜默配置監聽
[oracle@template database] $ORACLE_HOME/bin/netca /silent /responseFile /home/oracle/rsp/netca.rsp
可直接修改 /netca.rsp 文件內的配置來創建監聽
5、靜默安裝資料庫
安裝資料庫可以通過修改響應文件和直接使用命令 兩種方式來安裝 修改僅安裝資料庫的響應文件 vim /home/oracle/rsp/dbca.rsp [CREATEDATABASE] //僅修改此部分即可,可按照實際需求調整 GDBNAME="oadb.template" //全局資料庫的名字=SID+主機功能變數名稱 SID="oadb" //SID CHARACTERSET="AL32UTF8" //編碼 NATIONALCHARACTERSET="UTF8" //編碼 開始靜默創建資料庫: [oracle@template database] $ORACLE_HOME/bin/dbca -silent -responseFile /home/oracle/rsp/dbca.rsp 執行之後會要求輸入sys/system 密碼(可以在響應文件中直接修改) 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 57% 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 "/db/oracle/cfgtoollogs/dbca/oadb/oadb.log" for further details.
資料庫創建完成。
進入資料庫查詢資料庫的狀態。
後續的參數調整根據個人實際情況進行修改。