您好,登录后才能下订单哦!
这篇文章给大家分享的是有关如何通过克隆方式安装Oracle数据库软件的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
有时候,如果几个机器的配置相似,就不需要一遍又一遍地安装数据库软件了。这种情况下可以采用克隆安装的方式,比图形界面和静默安装更快捷。
源主机:A机
目标主机:B机
1. B机创建用户和用户组
#groupadd –g 501 oinstall
#groupadd –g 502 dba
#groupadd -g 503 oper
#useradd -g oinstall -G dba,oper -u 501 -d /home/oracle oracle
参数说明 -g 指定用户组
-G 指定附加组
-d 指定用户目录
激活oracle用户(修改oracle用户密码)
#passwd oracle
2. B机创建数据库安装目录并分配权限
# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# chown -R oracle:oinstall /u01
# chown -R oracle:oinstall /oradata
# chown -R oracle:oinstall /backup
# chown -R oracle:oinstall /archivelog
#chmod –R 775 /u01
#chmod –R 775 /oradata
#chmod –R 775 /backup
#chmod –R 775 /archivelog
注:在通常的生产环境中,我们将数据库软件(ORACLE_HOME)安装在本地,将数据(oradata/backup/archivelog)安装在存储中
3. 检查B机修改内核参数与A机一致
# vi /etc/sysctl.conf
4. 检查B机修改用户限制文件与A机一致
# vi /etc/security/limits.conf
5. 检查B机修改Oracle环境变量与A机一致(oracle用户)
$ vi .bash_pfile
6. B机安装相应需求包
#yum install -y binutils compat* elfutils-libelf elfutils-libelf-devel glibc glibc-common glibc-devel gcc gcc-c++ libaio libgcc libstdc++ libstdc++-devel make sysstat unixODBC-devel libaio-devel ksh
A机操作:
1. 关闭数据库
$ sqlplus / as sysdba
SQL> shutdown immediate;
2. 关闭监听
$ lsnrctl stop
3. 打包/u01/app/oracle/product/目录
$ cd /u01/app/oracle
$ tar -cvf /u01/app/oracle/product.tar product/
4. 将打包传输到B机
$ scp product.tar oracle@IP:/u01/app/oracle
B机操作:
1. 解压tar包
$ cd /u01/app/oracle
$ tar -xvf product.tar
2. 检测$ORACLE_HOME/network/admin目录下listener.ora和tnsname.ora文件,修改HOST字段指向本机。
3. 运行runinstall
$ cd $ORACLE_HOME/oui/bin
$ ./runInstall -silent -clone ORACLE_BASE=’/u01/app/oracle’ ORACLE_HOME=’/u01/app/oracle/product/11.2.0/db_1/’ ORACLE_HOME_NAME=’ORACLE_HOME_1’ (自定义名)
Starting Oracle Universal Installer...
Checking swap space: must be greater than 500 MB. Actual 3999 MB Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2018-12-05_08-32-20AM. Please wait ...[oracle@localhost bin]$ Oracle Universal Installer, Version 11.2.0.4.0 Production
Copyright (C) 1999, 2013, Oracle. All rights reserved.
You can find the log of this install session at:
/u01/app/oraInventory/logs/cloneActions2018-12-05_08-32-20AM.log
.................................................................................................... 100% Done.
Installation in progress (Wednesday, December 5, 2018 8:32:30 AM EST)
.............................................................................. 78% Done.
Install successful
Linking in progress (Wednesday, December 5, 2018 8:32:36 AM EST)
Link successful
Setup in progress (Wednesday, December 5, 2018 8:33:04 AM EST)
Setup successful
End of install phases.(Wednesday, December 5, 2018 8:33:27 AM EST)
WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.
To register the new inventory please run the script '/u01/app/oraInventory/orainstRoot.sh' with root privileges.
If you do not register the inventory, you may not be able to update or patch the products you installed.
The following configuration scripts need to be executed as the "root" user.
/u01/app/oraInventory/orainstRoot.sh
/u01/app/oracle/product/11.2.0/db_1/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
The cloning of ORACLE_HOME_1 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2018-12-05_08-32-20AM.log' for more details.
此时,已经完成了Oracle数据库软件的安装
4. 开启监听
$ lsnrctl start
5. 检验sqlplus功能
$ sqlplus / as sysdba
感谢各位的阅读!关于“如何通过克隆方式安装Oracle数据库软件”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。