本篇內(nèi)容介紹了“Linux克隆安裝Oracle數(shù)據(jù)庫(kù)軟件的方法是什么”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
成都創(chuàng)新互聯(lián)公司專(zhuān)注于常州企業(yè)網(wǎng)站建設(shè),成都響應(yīng)式網(wǎng)站建設(shè)公司,商城開(kāi)發(fā)。常州網(wǎng)站建設(shè)公司,為常州等地區(qū)提供建站服務(wù)。全流程定制網(wǎng)站設(shè)計(jì),專(zhuān)業(yè)設(shè)計(jì),全程項(xiàng)目跟蹤,成都創(chuàng)新互聯(lián)公司專(zhuān)業(yè)和態(tài)度為您提供的服務(wù)
A機(jī) | B機(jī) | |
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 |
如果幾個(gè)機(jī)器的配置相似,就不需要一遍又一遍地安裝數(shù)據(jù)庫(kù)軟件了。這種情況下可以采用克隆安裝的方式,比圖形界面和靜默安裝更快捷。
源主機(jī):A機(jī),已經(jīng)安裝完數(shù)據(jù)庫(kù)軟件、安裝完監(jiān)聽(tīng)、建好庫(kù)
目標(biāo)主機(jī):B機(jī),安裝完操作系統(tǒng),配置最好與A機(jī)保持一致
step1: B機(jī)創(chuàng)建用戶(hù)、組
step2: B機(jī)創(chuàng)建目錄并賦予權(quán)限
step3: B機(jī)檢查內(nèi)核參數(shù)、用戶(hù)限制、環(huán)境變量、安裝包
step4: A機(jī)關(guān)庫(kù)、關(guān)監(jiān)聽(tīng)
step5: A機(jī)壓縮目錄,并傳到B機(jī)相同目錄下
step6: B機(jī)解壓傳過(guò)來(lái)的壓縮包
step7: B機(jī)修改監(jiān)聽(tīng)文件和tns文件
step8: B機(jī)運(yùn)行runinstall腳本
step9: B機(jī)完成檢查
1. B機(jī)創(chuàng)建用戶(hù)和用戶(hù)組
# groupadd -g 501 oinstall
# groupadd -g 502 dba
# useradd -g oinstall -G dba -u 501 -d /home/oracle oracle
參數(shù)說(shuō)明 -g 指定用戶(hù)組
-G 指定附加組
-d 指定用戶(hù)目錄
激活oracle用戶(hù)(修改oracle用戶(hù)密碼)
# passwd oracle
2. 創(chuàng)建好目錄并配置權(quán)限
# mkdir -p /u01/app/oracle/product/11.2.0/db_1
# mkdir -p /u01/setup/os --用于操作系統(tǒng)iso文件存放
# mkdir -p /u01/setup/db --用于軟件包文件存放
# mkdir -p /oradata --用于存放數(shù)據(jù)文件
# 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
注:在通常的生產(chǎn)環(huán)境中,我們將數(shù)據(jù)庫(kù)軟件(ORACLE_HOME)安裝在本地,將數(shù)據(jù)(oradata/backup/archivelog)安裝在存儲(chǔ)中
3. 檢查B機(jī)修改內(nèi)核參數(shù)與A機(jī)一致
# vi /etc/sysctl.conf
4. 檢查B機(jī)修改用戶(hù)限制文件與A機(jī)一致
# vi /etc/security/limits.conf
5. 檢查B機(jī)修改Oracle環(huán)境變量與A機(jī)一致(oracle用戶(hù))
$ vi .bash_pfile
6. B機(jī)安裝相應(yīng)需求包
# 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機(jī)操作:
1. 關(guān)閉數(shù)據(jù)庫(kù)
$ sqlplus / as sysdba
SQL> shutdown immediate;
2. 關(guān)閉監(jiān)聽(tīng)
$ lsnrctl stop
3. 打包/u01/app/oracle/product/目錄
$ cd /u01/app/oracle
$ tar -cvf /u01/app/oracle/product.tar product/
4. 將打包傳輸?shù)紹機(jī)
$ 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機(jī)操作:
1. 解壓tar包
$ cd /u01/app/oracle
$ tar -xvf product.tar
2. 檢測(cè)$ORACLE_HOME/network/admin目錄下listener.ora和tnsname.ora文件,修改HOST字段指向本機(jī)。
3. 運(yùn)行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.
此時(shí),已經(jīng)完成了Oracle數(shù)據(jù)庫(kù)軟件的安裝
1. 開(kāi)啟監(jiān)聽(tīng)
$ lsnrctl start
2. 檢驗(yàn)sqlplus功能
$ sqlplus / as sysdba
(注意此時(shí)已經(jīng)安裝完了數(shù)據(jù)庫(kù)軟件,并沒(méi)有建庫(kù))
“Linux克隆安裝Oracle數(shù)據(jù)庫(kù)軟件的方法是什么”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!