靜默安裝數據庫軟件以前,須要將oracle安裝環境像正常安裝同樣配置好,
若是你沒有靜默安裝的響應配置文檔,能夠使用OUI錄製響應文件,記錄安裝過程;若是有響應配置文檔,直接修改安裝參數,進行安裝oracle數據庫軟件。
首先,經過OUI來錄製一個響應配置文件。
oracle 用戶環境變量的設置:
[root@node1 /]# cat /home/oracle/.bash_profile
ORACLE_SID=orcl
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/10.1.2/db
PATH=$ORACLE_HOME/bin:$PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export ORACLE_SID ORACLE_BASE ORACLE_HOME PATH LD_ASSUME_KERNEL LD_LIBRARY_PATH
執行如下命令,而後在OUI中根據提示執行安裝數據庫軟件的操做:
[oracle@node1 database]$ ./runInstaller -record -destinationFile /u01/install_database.rsp
注:錄製過程當中選擇只安裝數據庫軟件不建立數據庫;當安裝界面到達最後一步時選擇cancel;/u01/install_database.rsp 目錄必須是ORACLE用戶有讀寫權限。node
如下是錄製好的響應配置文檔:
[root@node1 u01]# cat install_database.rsp
RESPONSEFILE_VERSION=2.2.1.0.0
UNIX_GROUP_NAME="oinstall" //----安裝用戶組
FROM_LOCATION="/opt/database/stage/products.xml" //–-安裝源文件地址
FROM_LOCATION_CD_LABEL=<Value Unspecified>
ORACLE_HOME="/u01/app/oracle/10.1.2/db" //---ORACLE_HOME
ORACLE_HOME_NAME="OraDb10g_home1" //---ORACLE_HOME_NAME
SHOW_WELCOME_PAGE=true
SHOW_CUSTOM_TREE_PAGE=true
SHOW_COMPONENT_LOCATIONS_PAGE=true
SHOW_SUMMARY_PAGE=true
SHOW_INSTALL_PROGRESS_PAGE=true
SHOW_REQUIRED_CONFIG_TOOL_PAGE=true
SHOW_CONFIG_TOOL_PAGE=true
SHOW_RELEASE_NOTES=true
SHOW_ROOTSH_CONFIRMATION=true
SHOW_END_SESSION_PAGE=true
SHOW_EXIT_CONFIRMATION=true
NEXT_SESSION=false
NEXT_SESSION_ON_FAIL=true
NEXT_SESSION_RESPONSE=<Value Unspecified>
DEINSTALL_LIST={"oracle.server","10.2.0.1.0"}
SHOW_DEINSTALL_CONFIRMATION=true
SHOW_DEINSTALL_PROGRESS=true
CLUSTER_NODES={}
ACCEPT_LICENSE_AGREEMENT=false
TOPLEVEL_COMPONENT={"oracle.server","10.2.0.1.0"}
SHOW_SPLASH_SCREEN=true
SELECTED_LANGUAGES={"en"} //----語言
COMPONENT_LANGUAGES={"en"} //----語言
INSTALL_TYPE="Enterprise Edition"
sl_superAdminPasswds=<Value Unspecified>
sl_dlgASMCfgSelectableDisks={}
s_superAdminSamePasswd=<Value Unspecified>
s_globalDBName="orcl" //全局數據名
s_dlgASMCfgRedundancyValue="2 (Norm)"
s_dlgASMCfgNewDisksSize="0"
s_dlgASMCfgExistingFreeSpace="0"
s_dlgASMCfgDiskGroupName="DATA"
s_dlgASMCfgDiskDiscoveryString=""
s_dlgASMCfgAdditionalSpaceNeeded=" MB"
s_dbSelectedUsesASM=""
s_dbSIDSelectedForUpgrade=""
s_dbRetChar=""
s_dbOHSelectedForUpgrade=""
s_ASMSYSPassword=<Value Unspecified>
n_performUpgrade=0
n_dlgASMCfgRedundancySelected=2
n_dbType=1
n_dbSelection=0
Set this to true if same password across all the schemas is desired, else false to enter distinguish passwords for each schema.
If set to true, values from s_superAdminSamePasswd and s_superAdminSamePasswdAgain are picked up, else stringlists sl_superAdminPasswds and sl_superAdminPasswdsAgain are used.
b_useSamePassword=false
Set this to true (default) if recovery into file system is desired, else to false for ASM recovery .
b_useFileSystemForRecovery=true
Set this to true if email update is desired, false is the default .
b_receiveEmailNotification=false
Set this to true if loading example schemas is desired, else false so database won't be created with example schemas. The default is false.
b_loadExampleSchemas=false
b_enableAutoBackup=false
b_dlgASMShowCandidateDisks=true
b_centrallyManageASMInstance=true
sl_dlgASMDskGrpSelectedGroup={" "," "," "," "}
s_dlgRBOUsername=""
s_dlgEMCentralAgentSelected="No Agents Found"
Set this to true if using database control to manage the database is desired, else false so database can be managed by grid control.
b_useDBControl=true
s_superAdminSamePasswdAgain=<Value Unspecified>
s_dlgEMSMTPServer=""
s_dlgEMEmailAddress=""
s_dlgRBORecoveryLocation="/u01/app/oracle/10.1.2/db/flash_recovery_area/" //閃回目錄
n_upgradeDB=1
n_configurationOption=3
sl_upgradableSIDBInstances={}
n_upgradeASM=0
sl_dlgASMCfgDiskSelections={}
s_ASMSYSPasswordAgain=<Value Unspecified>
Set this to the following numbers for corresponding database storage type desired:
1 - File System (default)
2 - ASM
3 - Raw Devices
n_dbStorageType=0
s_rawDeviceMapFileLocation=""
sl_upgradableRACDBInstances={}
s_dlgRBOPassword=<Value Unspecified>
b_stateOfUpgradeDBCheckbox=false
s_dbSid="orcl" //實例名
b_dbSelectedUsesASM=false
sl_superAdminPasswdsAgain=<Value Unspecified>
s_mountPoint="/u01/app/oracle/10.1.2/db/oradata/" //數據文件存儲目錄
b_stateOfUpgradeASMCheckbox=false
oracle.assistants.server:OPTIONAL_CONFIG_TOOLS="{}"
oracle.has.common:OPTIONAL_CONFIG_TOOLS="{}"
oracle.network.client:OPTIONAL_CONFIG_TOOLS="{}"
oracle.sqlplus.isqlplus:OPTIONAL_CONFIG_TOOLS="{}"
oracle.sysman.console.db:OPTIONAL_CONFIG_TOOLS="{}"
varSelect=1
s_nameForOPERGrp="dba" //安裝用戶所屬組
s_nameForDBAGrp="dba"
[root@node1 u01]#sql
開始靜默安裝數據軟件:
[oracle@node1 database]$./runInstaller –silent –responseFile /u01/install_database.rsp
The installation of Oracle Database 10g was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2011-10-24_05-42-00AM.log' for more details.數據庫
查看日誌文件:silentInstall2011-10-24_05-42-00AM.log 提示須要ROOT用戶執行如下操做,將完成數據軟件的安裝
[root@node1 oraInventory]# /u01/app/oracle/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oracle/oraInventory to 770.
Changing groupname of /u01/app/oracle/oraInventory to oinstall.
The execution of the script is complete
[root@node1 oraInventory]# /u01/app/oracle/10.1.2/db/root.sh
執行完以上操做後,數據庫軟件安裝完成。
後面能夠經過靜默安裝數據庫,或者手動建庫。bash
靜默卸載Oracle數據庫軟件:
執行如下命令靜默卸載Oracle數據庫軟件
[oracle@node1 database]$ ./runInstaller –silent –deinstall –removeallfiles –removeAllPatches 「REMOVE_HOMES={$ORACLE_HOME}」 –responseFile /u01/install_database.rsp
卸載完畢。oracle