环境:

==============================================================================

Red Hat Enterprise Linux AS release 4 (Nahant Update 7)

oracle version:10.2.0.1

临时服务器A   IP:192.168.60 (有图形化功能)

目标服务器B   IP:192.168.221

==============================================================================

有时候在生产环境库上没有显示器或者图形化界面的时候,可能很多人都会觉得,此时安装数据软件会很麻烦,但根据oracle官方文档,有一个叫“静默安装”的方式,可以解决这样环境的需求,下面是我个人的安装过程,有什么不对的地方请指正:

1)  在服务器B上建立oracle用户,设置环境,网络配置,软件包检查,内核参数,用户资源限制等

2)  服务器B安装数据库软件

这个安装的过程,前期的检查很重要,一定要仔细,而且$ORACLE_HOME,$ORACLE_BASE尽量和A的保持一致,不一致也可以,可以修改,后面会介绍。

1.       在临时服务器A上进行创建静默安装文件

  注意的地方:

1)录制过程中选择只安装数据库软件不创建数据库

2)当录制的过程中安装界面到达最后一步时选择cancel,否则变成安装软件了,在临时服务器录制文件,远程登录结合XMANAGER

3)当用xmanager安装数据库软件的时候,尽量登录的时候,直接用oracle用户登录,而不要通过root切换过去,否则容易造成出现老是安装不了的现象,谨记!!!

下面是我的录制过程:

$./runInstaller -record -destinationFile /tmp/install_database.rsp

next

文本方式安装oracle_职场

选择Enterprise Edition(1.60GB),Next

文本方式安装oracle_Oracle_02

Path:默认会根据用户环境变量设置的定义,Next

文本方式安装oracle_休闲_03

进行安装前的检查的时候,这边出现了1个错误和1个警告,1个是环境定义,由于这个服务器已经安装过oracle软件,所以会出现错误,版本不对

文本方式安装oracle_休闲_04

警告是说swap分区设置不合要求,这个影响不大,勾上,选择Next

文本方式安装oracle_休闲_05

这一步是Summary,也是最后一步选择,在此一定要选择Cancel,否则变成安装了

2.       回放响应文件静默安装Oracle数据库软件

拷贝A服务器中的录制文件到B服务器,可以对这个文件进行里面的修改,根据环境的需要,然后执行以下命令静默安装Oracle数据库软件

$./runInstaller -silent -responseFile /tmp/install_database.rsp

安装完成后,记得先不要回车,先查看安装日志,屏幕会有提示安装日志的路径,默认是在/tmp/目录下,查看日志里面会有提示要执行如下二个脚本,在另一窗口以root身份执行,执行完了再返回到那个窗口回车

#.

$ORACLE_BASE/oraInventory/orainstRoot.sh
#. $ORACLE_HOME/root.sh

  关于录制文件install_database.rsp,把一些注释过滤掉,要留意的地方,下面也进行了说明,主要包括如下的内容,标颜色的要重点留意

RESPONSEFILE_VERSION=2.2.1.0.0

UNIX_GROUP_NAME="oinstall"      --这个是oracle安装的用户组

FROM_LOCATION="/home/oracle/soft/database/stage/products.xml" –这个要和目标的要保持一致

FROM_LOCATION_CD_LABEL=<Value Unspecified>

ORACLE_HOME="/u01/app/oracle/db10g"    --ORACLE_HOME目录

ORACLE_HOME_NAME="OraDb10g_home1"      --ORACLE_HOME名字

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=<Value Unspecified>

s_superAdminSamePasswd=<Value Unspecified>

s_globalDBName=<Value Unspecified>

s_dlgASMCfgRedundancyValue=<Value Unspecified>

s_dlgASMCfgNewDisksSize=<Value Unspecified>

s_dlgASMCfgExistingFreeSpace=<Value Unspecified>

s_dlgASMCfgDiskGroupName=<Value Unspecified>

s_dlgASMCfgDiskDiscoveryString=<Value Unspecified>

s_dlgASMCfgAdditionalSpaceNeeded=<Value Unspecified>

s_dbSelectedUsesASM=<Value Unspecified>

s_dbSIDSelectedForUpgrade=<Value Unspecified>

s_dbRetChar=<Value Unspecified>

s_dbOHSelectedForUpgrade=<Value Unspecified>

s_ASMSYSPassword=<Value Unspecified>

n_performUpgrade=<Value Unspecified>

n_dlgASMCfgRedundancySelected=<Value Unspecified>

n_dbType=<Value Unspecified>

n_dbSelection=<Value Unspecified>

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=<Value Unspecified>

Set this to true (default) if recovery into file system is desired, else to false for ASM recovery .

b_useFileSystemForRecovery=<Value Unspecified>

Set this to true if email update is desired, false is the default .

b_receiveEmailNotification=<Value Unspecified>

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=<Value Unspecified>

Set this to true if automatic backup of the database is desired, else false to disable backup.

b_enableAutoBackup=<Value Unspecified>

b_dlgASMShowCandidateDisks=<Value Unspecified>

b_centrallyManageASMInstance=<Value Unspecified>

sl_dlgASMDskGrpSelectedGroup=<Value Unspecified>

s_dlgRBOUsername=<Value Unspecified>

s_dlgEMCentralAgentSelected=<Value Unspecified>

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=<Value Unspecified>

s_superAdminSamePasswdAgain=<Value Unspecified>

s_dlgEMSMTPServer=<Value Unspecified>

s_dlgEMEmailAddress=<Value Unspecified>

s_dlgRBORecoveryLocation=<Value Unspecified>

n_upgradeDB=<Value Unspecified>

n_configurationOption=<Value Unspecified>

sl_upgradableSIDBInstances=<Value Unspecified>

n_upgradeASM=<Value Unspecified>

sl_dlgASMCfgDiskSelections=<Value Unspecified>

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=<Value Unspecified>

s_rawDeviceMapFileLocation=<Value Unspecified>

sl_upgradableRACDBInstances=<Value Unspecified>

s_dlgRBOPassword=<Value Unspecified>

b_stateOfUpgradeDBCheckbox=<Value Unspecified>

s_dbSid=<Value Unspecified>

b_dbSelectedUsesASM=<Value Unspecified>

sl_superAdminPasswdsAgain=<Value Unspecified>

s_mountPoint=<Value Unspecified>

b_stateOfUpgradeASMCheckbox=<Value Unspecified>

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=<Value Unspecified>

s_nameForOPERGrp=<Value Unspecified>

s_nameForDBAGrp=<Value Unspecified>

文本模式创建数据库:

2、DBCA静默安装数据库
用DBCA创建一个种子数据库:
(1) 创建初始数据库的时候选择Custom Database模板
(2) 建议使用File System存储机制
(3) 数据文件的存放地点建议选择
Use Oracle-Managed Files
Database Area: {ORACLE_BASE}/oradata
(4) 内存建议选择Custom,指定SGA和PGA大小
(5) 字符集根据实际需要设定
(6) 数据库创建选项里面选择Create Database
(7) 创建应用程序需要的表空间和用户,导入初始数据
用DBCA根据种子数据库创建一个模板:
(1) 启动DBCA,选择Manage Templates
(2) 按照提示创建一个模板,创建后的模板文件:$ORACLE_HOME/assistants/dbca/templates
/{模板名.dbc}
将Oracle DB安装盘里面response目录下的dbca.rsp拷贝到本机上
修改dbca.rsp文件,将模板名和DB名添加进去
GDBNAME=orcl1
SID=orcl1
TEMPLATENAME=orcl.dbc{为了方便,将模板文件拷贝到dbca.rsp相同目录下}
如果需要使用Oracle Enterprise Manager,则还需要修改以下参数如下:
EMCONFIGURATION=”LOCAL” SYSMANPASSWORD=”password” DBSNMPPASSWORD=”password”   执行以下命令使用DBCA根据模板创建新数据库
$./dbca –silent –createdatabase –responseFile /home/oracle/dbca.rs