Oracle11gR2静默安装与克隆安装

来源:互联网 发布:网页游戏的源码 编辑:程序博客网 时间:2024/06/07 14:53

静默安装

1. (可选)删除之前安装的oracle软件和安装信息

[oracle@centos6_dg ~]$ sqlplus -vSQL*Plus: Release 11.2.0.4.0 Production[oracle@centos6_dg ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Sat Nov 26 04:51:48 2016Copyright (c) 1982, 2013, Oracle.  All rights reserved.Connected to an idle instance.[oracle@centos6_dg ~]$ cd $ORACLE_HOME[oracle@centos6_dg db_1]$ rm -rf *  #删除oracle产品目录
[oracle@centos6_dg ContentsXML]$ pwd/u01/app/oracle/inventory/ContentsXML [oracle@centos6_dg ContentsXML]$ cat inventory.xml<?xml version="1.0" standalone="yes" ?><!-- Copyright (c) 1999, 2013, Oracle and/or its affiliates.All rights reserved. --><!-- Do not modify the contents of this file by hand. --><INVENTORY><VERSION_INFO>   <SAVED_WITH>11.2.0.4.0</SAVED_WITH>   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER></VERSION_INFO><HOME_LIST>  # 此处用来存放之前oracle之前安装的信息,需要删除</HOME_LIST><COMPOSITEHOME_LIST></COMPOSITEHOME_LIST></INVENTORY>

2. 复制编辑响应文件

[oracle@centos6_dg response]$ cp /home/oracle/database/response/db_install.rsp /home/oracle/centos6_dg.rsp[oracle@centos6_dg ~]$ vim centos6_dg.rsporacle.install.option=INSTALL_DB_SWONLY  #只安装数据库软件ORACLE_HOSTNAME=centos6_dg  #安装主机名UNIX_GROUP_NAME=oinstall     #Oracle用户用于安装软件的组名INVENTORY_LOCATION=/u01/app/oracle/inventory  #oracle产品清单目录SELECTED_LANGUAGES=en  #oracle运行语言环境ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1  #oracle安装目录ORACLE_BASE=/u01/app/oracle   #oracle基础目录oracle.install.db.InstallEdition=EE  #安装版本类型,一般是企业版oracle.install.db.DBA_GROUP=dba  #oracle用户用于授权OSDBA权限的组名oracle.install.db.OPER_GROUP=oinstall  #oracle用户用于授权OSPRR权限的组名oracle.install.db.config.starterdb.characterSet=ZHS16GBK  #根据需要设置字符集DECLINE_SECURITY_UPDATES=true  #一定要设置为true

3. 运行安装命令,开始安装

[oracle@centos6_dg database]$ ./runInstaller -silent -responseFile /home/oracle/centos6_dg.rsp -ignoreSysPrereqsStarting Oracle Universal Installer...# silent:表示以静默方式方式安装,不会有任何提示  Checking Temp space: must be greater than 120 MB.   Actual 21108 MB    PassedChecking swap space: must be greater than 150 MB.   Actual 4067 MB    PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2016-11-26_05-22-27AM. Please wait ...[oracle@centos6_dg 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. /u01/app/oracle/inventory/logs/installActions2016-11-26_05-22-27AM.log   ACTION: Identify the list of failed prerequisite checks from the log: /u01/app/oracle/inventory/logs/installActions2016-11-26_05-22-27AM.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: /u01/app/oracle/inventory/logs/installActions2016-11-26_05-22-27AM.logThe installation of Oracle Database 11g was successful.Please check '/u01/app/oracle/inventory/logs/silentInstall2016-11-26_05-22-27AM.log' for more details.As a root user, execute the following script(s):        1. /u01/app/oracle/product/11.2.0/db_1/root.shSuccessfully Setup Software.  ##安装成功

4. 切换至root用户,执行脚本

[root@centos6_dg ~]# /u01/app/oracle/product/11.2.0/db_1/root.sh



克隆安装

1. 删除oracle之前的产品信息,由于是模拟,假设ORACLE_HOME目录是从其他地方拷贝过来的

[oracle@centos6_dg ContentsXML]$ pwd/u01/app/oracle/inventory/ContentsXML[oracle@centos6_dg ContentsXML]$ vim inventory.xml[oracle@centos6_dg ContentsXML]$ cat inventory.xml<?xml version="1.0" standalone="yes" ?><!-- Copyright (c) 1999, 2013, Oracle and/or its affiliates.All rights reserved. --><!-- Do not modify the contents of this file by hand. --><INVENTORY><VERSION_INFO>   <SAVED_WITH>11.2.0.4.0</SAVED_WITH>   <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER></VERSION_INFO><HOME_LIST></HOME_LIST><COMPOSITEHOME_LIST></COMPOSITEHOME_LIST></INVENTORY>

2. 执行克隆安装命令

[oracle@centos6_dg bin]$ pwd/u01/app/oracle/product/11.2.0/db_1/clone/bin[oracle@centos6_dg bin]$ perl clone.pl ORACLE_BASE=$ORACLE_BASE ORACLE_HOME=$ORACLE_HOME  ORACLE_HOME_NAME=centos6_dg./runInstaller -clone -waitForCompletion  "ORACLE_BASE=/u01/app/oracle" "ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1" "ORACLE_HOME_NAME=centos6_dg" -silent -noConfig -nowait Starting Oracle Universal Installer...Checking swap space: must be greater than 500 MB.   Actual 4095 MB    PassedPreparing to launch Oracle Universal Installer from /tmp/OraInstall2016-11-26_04-37-32AM. Please wait ...Oracle Universal Installer, Version 11.2.0.4.0 ProductionCopyright (C) 1999, 2013, Oracle. All rights reserved.You can find the log of this install session at: /u01/app/oracle/inventory/logs/cloneActions2016-11-26_04-37-32AM.log.................................................................................................... 100% Done.Installation in progress (Saturday, November 26, 2016 4:38:02 AM CST)..............................................................................                                                  78% Done.Install successfulLinking in progress (Saturday, November 26, 2016 4:38:15 AM CST)Link successfulSetup in progress (Saturday, November 26, 2016 4:39:43 AM CST)Setup successfulEnd of install phases.(Saturday, November 26, 2016 4:40:14 AM CST)WARNING:The following configuration scripts need to be executed as the "root" user./u01/app/oracle/product/11.2.0/db_1/root.shTo execute the configuration scripts:    1. Open a terminal window    2. Log in as "root"    3. Run the scripts    The cloning of centos6_dg was successful.Please check '/u01/app/oracle/inventory/logs/cloneActions2016-11-26_04-37-32AM.log' for more details.
最后,以root用户执行脚本即可



0 0
原创粉丝点击