您好,登錄后才能下訂單哦!
本篇內容介紹了“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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。