本篇内容介绍了“Linux克隆安装Oracle数据库软件的方法是什么”的有关知识,在实际案例的操作过程中,不少人都会遇到这样的困境,接下来就让小编带领大家学习一下如何处理这些情况吧!希望大家仔细阅读,能够学有所成!
A机 | B机 | |
Linux版本: | Linux 6.5 64-bit | Linux 6.5 64-bit |
Oracle版本: | 11.2.0.4 | 11.2.0.4 |
ORACLE_BASE: | /u01/app/oracle | /u01/app/oracle |
ORACLE_HOME: | /u01/app/oracle/product/11.2.0/db_1 | /u01/app/oracle/product/11.2.0/db_1 |
如果几个机器的配置相似,就不需要一遍又一遍地安装数据库软件了。这种情况下可以采用克隆安装的方式,比图形界面和静默安装更快捷。
源主机:A机,已经安装完数据库软件、安装完监听、建好库
目标主机:B机,安装完操作系统,配置最好与A机保持一致
step1: B机创建用户、组
step2: B机创建目录并赋予权限
step3: B机检查内核参数、用户限制、环境变量、安装包
step4: A机关库、关监听
step5: A机压缩目录,并传到B机相同目录下
step6: B机解压传过来的压缩包
step7: B机修改监听文件和tns文件
step8: B机运行runinstall脚本
step9: B机完成检查
1. B机创建用户和用户组
# groupadd -g 501 oinstall
# groupadd -g 502 dba
# useradd -g oinstall -G dba -u 501 -d /home/oracle oracle
参数说明 -g 指定用户组
-G 指定附加组
-d 指定用户目录
激活oracle用户(修改oracle用户密码)
# passwd oracle
2. 创建好目录并配置权限
# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# mkdir -p /u01/setup/os --用于操作系统iso文件存放
# mkdir -p /u01/setup/db --用于软件包文件存放
# mkdir -p /oradata --用于存放数据文件
# mkdir -p /backup --用于存放备份文件
# mkdir -p /archivelog --用于存放归档日志文件
# 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
oracle@172.16.70.171's password:
product.tar 100% 4225MB 62.1MB/s 01:08
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
$ ./runInstaller -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数据库软件的安装
1. 开启监听
$ lsnrctl start
2. 检验sqlplus功能
$ sqlplus / as sysdba
(注意此时已经安装完了数据库软件,并没有建库)
“Linux克隆安装Oracle数据库软件的方法是什么”的内容就介绍到这里了,感谢大家的阅读。如果想了解更多行业相关的知识可以关注亿速云网站,小编将为大家输出更多高质量的实用文章!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。