静默安装 Oracle数据库软件

时间:2022-09-28 08:43:48

静默安装数据库软件之前,需要将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用户有读写权限。

以下是录制好的响应配置文档:
[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]#

开始静默安装数据软件:
[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
执行完以上操作后,数据库软件安装完成。
后面可以通过静默安装数据库,或者手动建库。

静默卸载Oracle数据库软件:
执行以下命令静默卸载Oracle数据库软件
[oracle@node1 database]$ ./runInstaller –silent –deinstall –removeallfiles –removeAllPatches “REMOVE_HOMES={$ORACLE_HOME}” –responseFile /u01/install_database.rsp
卸载完毕。

本文出自 “旋木的技术博客” 博客,谢绝转载!