你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle快速克隆安装

[日期:2017-03-04] 来源:Linux社区  作者:xiaochina [字体: ]

Oracle的家目录进行快速克隆,对同类型机器配置很高效的!

01、确认你在克隆数据库时,原数据库已经关闭

sqlplus  /  as sysdba;       

shutdown immediate ;       

lsnrctl stop     

ps –ef|grep ora_    ###查看oracle进程 

02、 对$ORACLE_BASE目录下的product进行备份

zip  –r product.zip    product

03、移动到目标机器或目标目录解压

unzip  –d  target_path   product.zip    # 或者在目标目录下  unzip product.zip

04、删除解压后的product/network/admin下面的ora文件

rm  *.ora     ###清理监听文件

05、运行runinstaller

$ORACLE_HOME/oui/bin/runinstaller  –silent –clone  ORACLE_BASE='productd的当前目录'  ORACLE_HOME='oracle_home目录'    ORACLE_HOME_NAME='这个名字随便取一个'

注:运行以上命令,会出现一个字符界面的进度条,全部运行完后。你运行一个脚本root.sh,以root 运行,一路回车就ok了。

cd product/11.2.0/dbhome_1/oui/bin
[oracle@oracle-111 bin]$ ./runInstaller -silent -clone ORACLE_HOME='/data/clone_oracle/product/11.
2.0/dbhome_1'  ORACLE_HOME_NAME='clone' Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 1535 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-02-27_06-41-44AM. Please w
ait ...[oracle@oracle-111 bin]$ 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:
 /data/oraInventory/logs/cloneActions2017-02-27_06-41-44AM.log
Values for the following variables could not be obtained from the command line or response file(s)
:   ORACLE_BASE 
Cloning cannot continue.    ###第一次没指定ORACLE_BASE目录导致的错误

[oracle@oracle-111 bin]$ ./runInstaller -silent -clone  ORACLE_BASE='/data/clone_oracle'  ORACLE_H
OME='/data/clone_oracle/product/11.2.0/dbhome_1'  ORACLE_HOME_NAME='clone'  -noConfig -nowaitStarting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 1535 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-02-27_06-43-34AM. Please w
ait ...[oracle@oracle-111 bin]$ 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:
 /data/oraInventory/logs/cloneActions2017-02-27_06-43-34AM.log
..................................................................................................
.. 100% Done.


Installation in progress (Monday, February 27, 2017 6:43:59 AM CST)
..............................................................................                    
                              78% Done.Install successful

Linking in progress (Monday, February 27, 2017 6:44:08 AM CST)
Link successful

Setup in progress (Monday, February 27, 2017 6:46:56 AM CST)
Setup successful

End of install phases.(Monday, February 27, 2017 6:47:47 AM CST)
WARNING:
The following configuration scripts need to be executed as the "root" user.
/data/clone_oracle/product/11.2.0/dbhome_1/root.sh   ###以root身份运行root.sh文件
To execute the configuration scripts:
    1. Open a terminal window
    2. Log in as "root"
    3. Run the scripts
    
The cloning of clone was successful.
Please check '/data/oraInventory/logs/cloneActions2017-02-27_06-43-34AM.log' for more details.

[oracle@oracle-111 bin]$ cd ..

 06、设置oracle环境变量

cd ~

vim .bash_profile  ###根据需求进行修改

#export ORACLE_SID=mvp

export ORACLE_BASE=/data/clone_oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export NLS_DATE_FORMAT='yyyy-mm-dd hh24:mi:ss'

export PATH=$ORACLE_HOME/bin:/usr/local/bin:$PATH:$HOME/bin

07、建立数据库实例及监听

netca  ###监听

dbca   ###实例

####启动新建的实例

sqlplus / as  sysdba;

startup

exit;

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址http://www.linuxidc.com/Linux/2017-03/141335.htm

linux
相关资讯       Oracle克隆安装 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款