搭建rac+DataGuard的測試環境
搭建rac+DataGuard的測試環境
--1.配置網路
主備庫的監聽,修改tnsnames.ora 和 listener.ora 檔案
--主備庫的tnsnames.ora 檔案是一致的。 修改成如下:
racdb2=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
(INSTANCE_NAME = racdb2)
)
)
racdb1=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = racdb)
(INSTANCE_NAME = racdb1)
)
)
orcl_st =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =192.168.13.4)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SID = dgrac)
)
)
--備庫配置監聽
SID_LIST_LISTENER_RAC2 =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.13.4)(PORT = 1521))
)
--拷貝密碼檔案到備庫或者使用orapwd生成密碼檔案,一定要保持主備密碼一致
預設情況下,win下口令檔案的格式是pwdsid.ora,unix下的格式是orapwSID(大小寫敏感)
--生成standby控制檔案
alter database create standby controlfile as '/oracle/backup/control01.ctl';
--修改主庫引數檔案
create pfile='/oracle/backup/pfile.txt' from spfile;
*.log_archive_config='dg_config=(racdb,dgrac)'
*.log_archive_dest_3='service=orcl_st VALID_FOR=(ALL_LOGFILES,ALL_ROLES) db_unique_name=dgrac'
*.db_file_name_convert='/home/oracle/oradata','+ASM_DISK/RACDB/DATAFILE','/home/oracle/tempfile','+ASM_DISK/RACDB/tempfile'
*.log_file_name_convert='/home/oracle/oradata', '+ASM_DISK/RACDB/DATAFILE'
*.standby_file_management=auto
*.fal_server='orcl_st'
orcl1.fal_client='racdb1'
orcl2.fal_client='racdb2'
對應命令如下:
alter system set log_archive_config='dg_config=(racdb,dgrac)' scope=both sid='*';
alter system set log_archive_dest_3='service=orcl_st lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=dgrac' scope=both sid='*';
alter system set db_file_name_convert='/home/oracle/oradata','+ASM_DISK/RACDB/DATAFILE','/home/oracle/tempfile','+ASM_DISK/RACDB/tempfile' scope=spfile sid='*';
alter system set log_file_name_convert='/home/oracle/oradata', '+ASM_DISK/RACDB/DATAFILE' scope=spfile sid='*';
alter system set standby_file_management=auto scope=both sid='*';
alter system set fal_server='orcl_st' scope=both sid='*';
alter system set fal_client='racdb1' scope=both sid='racdb1';
alter system set fal_client='racdb2' scope=both sid='racdb2';
--備庫的引數檔案
*.db_unique_name=dgrac
-- 注意,這個值要和主庫參log_archive_dest_n裡設定的一致,不然會報錯誤:
ORA-16047: DGID mismatch between destination
*.log_archive_config='dg_config=(racdb,dgrac)'
*.log_archive_dest_2='service=racdb1 valid_for=(online_logfiles,primary_role) db_unique_name=racdb'
*.db_file_name_convert='+ASM_DISK/RACDB/DATAFILE','/home/oracle/oradata/','+ASM_DISK/RACDB/tempfile','/home/oracle/tempfile'
*.log_file_name_convert='+ASM_DISK/RACDB/onlinelog','/home/oracle/oradata'
*.standby_file_management=auto
*.fal_server='racdb1','racdb2'
*.fal_client='orcl_st'
--將主庫備份的目錄掛載到本地備庫
mount -t nfs -o rw,hard,nointr,tcp,noac,vers=3,timeo=600,rsize=32768,wsize=32768 192.168.13.201:/oracle/backup /oracle/backup
--備庫節點上
startup pfile='/home/oracle/node1.pfile' nomount;
rman target sys/zhong@racdb1 auxiliary /
duplicate target database for standby;
alter database add standby logfile group 10 '/home/oracle/oradata/standby10_a.log' size 50m;
alter database add standby logfile group 11 '/home/oracle/oradata/standby11_a.log' size 50m;
alter database add standby logfile group 12 '/home/oracle/oradata/standby12_a.log' size 50m;
alter database add standby logfile group 13 '/home/oracle/oradata/standby13_a.log' size 50m;
--開啟日誌應用
alter database recover managed standby database disconnect from session;
搭建Oracle DataGuard還是相對比較簡單,主要要注意在於
1,網路通暢
2,引數設定
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23073818/viewspace-765609/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- android測試環境搭建Android
- kaldi環境搭建 | yesno 測試
- 新手搭建 kubernetes 測試環境
- griffin環境搭建及功能測試
- 搭建自動化測試環境
- 如何搭建良好的軟體測試環境?測試環境對軟體測試起到什麼作用?
- 軟體測試培訓:如何搭建測試環境
- 自動化測試 selenium 環境搭建
- TestNG+Maven+IDEA環境搭建+測試MavenIdea
- 你真的會搭建測試環境嗎?
- PCIE XDMA 開發環境搭建以及環路測試開發環境
- fio效能測試-環境搭建,功能介紹,測試講解
- 想要軟體測試效果好,搭建好測試環境是前提
- IOS自動化測試環境搭建(Python & Java)iOSPythonJava
- 如何快速搭建微服務開發測試環境微服務
- lustre檔案系統環境搭建及測試
- 搭建appium+python自動化測試環境APPPython
- 配置開發環境、生成環境、測試環境開發環境
- 測試人員必看!!!軟體測試環境搭建有哪些原則?
- Web自動化測試 —— 測試環境搭建 (Selenium+Python) Windows篇WebPythonWindows
- 自動化測試之Selenium篇(一):環境搭建
- Web自動化測試 環境搭建(selenium+python)WebPython
- ubuntu18.04上搭建django專案測試環境UbuntuDjango
- 虛擬機器搭建測試環境解決方案虛擬機
- 搭建基於C#和 Appium 的 Android自動測試環境C#APPAndroid
- 『與善仁』Appium基礎 — 14、Appium測試環境搭建APP
- DVWA下載、安裝、使用(漏洞測試環境搭建)教程
- Linux伺服器上搭建測試環境(war包+tomcat)Linux伺服器Tomcat
- Windows配置Delve的測試環境Windows
- Xcode配置測試環境和線上環境XCode
- Windows環境下的Nginx環境搭建WindowsNginx
- 『與善仁』Appium基礎 — 1、Android系統的測試環境搭建APPAndroid
- Jenkins環境搭建(6)-修改自動化測試報告的樣式Jenkins測試報告
- 測試環境搭建需謹慎! 搭建前後需要注意哪幾點?
- IOS提審ipv6網路相容測試環境搭建iOS
- AgileTC --滴滴開源測試用例管理平臺環境搭建
- Android自動化測試第二篇 Appnium環境搭建AndroidAPP
- python+selenium UI自動化測試環境搭建及使用PythonUI
- 手把手教你搭建hadoop+hive測試環境(新手向)HadoopHive