dataguard 搭建 oracle_sid不同 2節點 primary+standby
|
primary 庫 |
standby 庫 |
Ip |
10.8.98.103 |
10.8.98.104 |
hostname |
dbserver01 |
dbserver02 |
Oracle_sid |
prod1 |
proddg |
資料庫版本 |
11.2.0.4 |
11.2.0.4 |
Db_name |
prod |
prod |
Db_unique_name |
prodpri |
prodstd |
tnsnames |
tns_primary |
tns_standby |
主機安裝oracle,備機只需要安裝資料庫軟體,不需要建庫。
1、主機設定歸檔模式
1
2
3
4
5
6
7 |
SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination
/oracle/app/oracle/oradata/prod/arch Oldest online log sequence 60 Next log sequence to archive 62 Current log sequence 62 |
主機開啟force logging 模式
1 |
SQL> alter database force logging; |
2、主機新增standby log
1
2
3 |
alter database add standby logfile group 21(
'/oracle/app/oracle/oradata/prod/redo21_standby.log'
) size 50M; alter database add standby logfile group 22(
'/oracle/app/oracle/oradata/prod/redo22_standby.log'
) size 50M; alter database add standby logfile group 23(
'/oracle/app/oracle/oradata/prod/redo23_standby.log'
) size 50M; |
3.
配置主庫的初始化引數,如果配置引數有問題,重啟資料庫服務就ok。
#dg add alter system set db_unique_name='prodpri' scope=spfile; alter system set log_archive_config='DG_CONFIG=(prodpri,prodstd)' scope=both ; alter system set LOG_ARCHIVE_DEST_1='LOCATION=/oracle/app/oracle/oradata/prod/arch valid_for=(all_logfiles,all_roles) db_unique_name=prodpri' scope=both; alter system set LOG_ARCHIVE_DEST_2='SERVICE=tns_standby LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=prodstd' scope=both; alter system set log_archive_format='%t_%s_%r.arc' scope=spfile ; alter system set log_archive_max_processes=8 scope=both ; alter system set db_file_name_convert='/oracle/app/oracle/oradata/prod/','/oracle/app/oracle/oradata/prod/' scope=spfile; alter system set log_file_name_convert='/oracle/app/oracle/oradata/prod/','/oracle/app/oracle/oradata/prod/' scope=spfile; alter system set standby_file_management=AUTO scope=both; alter system set fal_server='tns_standby' scope=both ; alter system set FAL_CLIENT='tns_primary' scope=both ;
重啟資料庫服務,並查詢是否生效
set linesize 500 pages 0 col value for a90 col name for a50 select name, value from v$parameter where name in ('db_name','db_unique_name','log_archive_config', 'log_archive_dest_1','log_archive_dest_2','log_archive_dest_state_1','log_archive_dest_state_2','remote_login_passwordfile','log_archive_format','log_archive_max_processes','fal_server','db_file_name_convert', 'log_file_name_convert', 'standby_file_management');
4.根據spfile建立pfile
SQL> create pfile from spfile;
5.主機更改 lisenter.ora,tnsnames.ora
[oracle@dbserver01 admin]$ cat listener.ora # listener.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = prod) (ORACLE_HOME = /oracle/app/oracle/product/11.2.0) (SID_NAME = prod1)) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.103)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = /oracle/app/oracle [oracle@dbserver01 admin]$
[oracle@dbserver01 admin]$ cat tnsnames.ora # tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/tnsnames.ora # Generated by Oracle configuration tools. PROD = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = dbserver01)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_primary = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.103)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_standby = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.104)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) )
重啟資料庫監聽。
5. 複製主機上 lisenter.ora,tnsnames.ora (需要更改部分),pfile檔案 (部分引數需要更改),密碼檔案 (需要改名)到備機。
pfile更改以下幾行
db_unique_name=' prodstd' scope=spfile;
LOG_ARCHIVE_DEST_1='LOCATION=/oracle/app/oracle/oradata/prod/arch valid_for=(all_logfiles,all_roles) db_unique_name= prodstd' scope=both;
LOG_ARCHIVE_DEST_2='SERVICE= tns_primary LGWR SYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME= prodpri' scope=both;
fal_server=' tns_primary' scope=both ;
FAL_CLIENT=' tns_standby' scope=both ;
*.dispatchers='(PROTOCOL=TCP) (SERVICE=prod dgXDB)'
備機根據引數檔案initproddg.ora建立相應的資料夾
1
2
3 |
mkdir -p /oracle/app/oracle/admin/prod/adump mkdir -p /oracle/app/oracle/oradata/prod/ mkdir -p /oracle/app/oracle/oradata/prod/arch
|
更改完之後,create spfile from pfile,並且從spfile重新啟動
備機 lisenter.ora
[oracle@dbserver02 admin]$ cat listener.ora # listener.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/listener.ora # Generated by Oracle configuration tools. SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = prod) (ORACLE_HOME = /oracle/app/oracle/product/11.2.0) (SID_NAME = proddg)) ) LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.104)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) ADR_BASE_LISTENER = /oracle/app/oracle [oracle@dbserver02 admin]$
並重新啟動監聽
備機 tnsnames.ora
[oracle@dbserver02 admin]$ cat tnsnames.ora # tnsnames.ora Network Configuration File: /oracle/app/oracle/product/11.2.0/network/admin/tnsnames.ora # Generated by Oracle configuration tools. PROD = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.104)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_primary = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.103)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) ) tns_standby = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.8.98.104)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = prod) ) )
6、測試tnsping ok,主備機都啟動到nomount狀態,均從spfile啟動
然後主機開啟資料庫,備機開啟到nomount狀態。
7. 實施資料庫克隆透過rman duplicate (在備機操作)
請參照 http://blog.itpub.net/70004783/viewspace-2788445/
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/70004783/viewspace-2792951/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- dataguard 搭建 oracle_sid相同 2節點 primary+standbyOracle
- oracle11g單節點DataGuard搭建Oracle
- 主庫RAC,備庫單節點ASM的dataguard搭建ASM
- DM8搭建2節點DMDSC
- Oracle11gR2 Dataguard搭建Oracle
- DataGuard搭建
- consul 多節點/單節點叢集搭建
- MongoDB叢集搭建(包括隱藏節點,仲裁節點)MongoDB
- 4.2 叢集節點初步搭建
- JQuery2:節點選取與節點插入jQuery
- 設計節奏點——讓遊戲與眾不同遊戲
- mongo資料庫單節點搭建Go資料庫
- Geth搭建多節點私有鏈條
- 2節點RAC安裝
- 不同bit數做dataguard的文章
- 1.19 JQuery2:節點插入與節點選取jQuery
- DataGuard搭建物理StandBy
- DataGuard搭建邏輯StandBy
- 透過Geth搭建多節點私有鏈
- Oracle11gR2下搭建DataGuard主備同步詳解Oracle
- Oracle11g R2之Dataguard搭建物理standbyOracle
- ORACLE 11G 建立 DATAGUARD(雙節點RAC-->單例項DG)Oracle單例
- 【RAC】節點2上不能完全識別節點1上的asmdiskASM
- 搭建 Oracle10g DataGuardOracle
- 搭建DataGuard碰到的小陷阱
- NEO共識節點推薦搭建步驟
- oracle11g單節點DGbroker搭建Oracle
- L2TP與PPTP的不同點——VecloudpptpCloud
- rman duplicate建立異地auxiliary Database oracle_11g oracle_sid不同UXDatabaseOracle
- kafka系列二:多節點分散式叢集搭建Kafka分散式
- CentOS7 上搭建多節點 Elasticsearch叢集CentOSElasticsearch
- hadoop叢集搭建——單節點(偽分散式)Hadoop分散式
- rhel6.4-11.2.0.3-RAC搭建單節點DG
- redis cluster 故障後,主從位於不同節點的修復。Redis
- Oracle 11.2 DataGuard RAC To RAC搭建Oracle
- 實戰不停機搭建ORACLE DataGuardOracle
- 搭建dataguard時,錯誤處理
- DataGuard 搭建 uweb 分行資料庫Web資料庫