您好,登錄后才能下訂單哦!
這篇文章主要介紹了DG Broker如何搭建,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
DG Broker搭建
1.環境說明
database | sid | db_name | db_unique_name | net service name |
primary | ogg | ogg | ogg | ogg_p |
physical standby | dogg | ogg | dogg | dogg_s |
2.查看參數
----主庫
SYS@ogg>show parameter broker
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0 /dbhome_1/dbs/dr1ogg.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0 /dbhome_1/dbs/dr2ogg.dat
dg_broker_start boolean FALSE
----備庫
SYS@dogg> show parameter broker
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
dg_broker_config_file1 string /u01/app/oracle/product/11.2.0 /db_1/dbs/dr1dogg.dat
dg_broker_config_file2 string /u01/app/oracle/product/11.2.0/db_1/dbs/dr2dogg.dat
dg_broker_start boolean FALSE
------修改dg_broker_config_file參數。這里就用默認的路徑,也可以自己指定。如果是在RAC環境中,這個把這個文件把到共享的存儲上面,如果有ASM可以放到ASM中。
3.啟用BROKER
----在兩個數據庫上面都執行:
alter system set dg_broker_start=true scope=both;
4.登錄配置
---在其中任意一臺做下面的操作就可以了,另它安裝了client的客戶端也是可以的
[oracle@ogg-80 ~]$ dgmgrl
(1)連接到當前的主數據庫
DGMGRL> connect sys/oracle@ogg_p
DGMGRL> help create -----查看幫助
Creates a broker configuration
Syntax:
CREATE CONFIGURATION <configuration name> AS
PRIMARY DATABASE IS <database name>
CONNECT IDENTIFIER IS <connect identifier>;
(2)創建一個配置文件(ogg是db_unique_name,oggDG是配置的名字--可以修改,ogg_p是連接到prod數據庫的tnsname)
create configuration oggDG as primary database is ogg connect identifier is ogg_p;
(3)啟用配置文件
DGMGRL> enable configuration;
(4)增加備庫到配置文件中 (dogg是備機的db_unique_name,dogg_s是連接到sprod數據庫的tnsname)
DGMGRL> add database dogg as connect identifier is dogg_s;
(5)啟用備庫
DGMGRL> enable database dogg;
(6)查看配置文件
DGMGRL> show configuration
Configuration - oggdg
Protection Mode: MaxPerformance
Databases:
ogg - Primary database
dogg - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
(7)查看主庫的配置消息
DGMGRL> show database verbose ogg;
Database - ogg
Role: PRIMARY
Intended State: TRANSPORT-ON
Instance(s):
ogg
Properties:
DGConnectIdentifier = 'ogg_p'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'optional'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/dogg/, /u01/app/oracle/oradata/ogg/'
LogFileNameConvert = '/u01/app/oracle/oradata/dogg/, /u01/app/oracle/oradata/ogg/'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName = 'ogg'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ogg-80)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ogg_DGMGRL)(INSTANCE_NAME=ogg)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/u01/app/oracle/archive'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
(8)查看備庫的配置消息
DGMGRL> show database verbose dogg;
Database - dogg
Role: PHYSICAL STANDBY
Intended State: APPLY-ON
Transport Lag: 0 seconds (computed 0 seconds ago)
Apply Lag: 0 seconds (computed 0 seconds ago)
Apply Rate: 0 Byte/s
Real Time Query: ON
Instance(s):
dogg
Properties:
DGConnectIdentifier = 'dogg_s'
ObserverConnectIdentifier = ''
LogXptMode = 'ASYNC'
DelayMins = '0'
Binding = 'OPTIONAL'
MaxFailure = '0'
MaxConnections = '1'
ReopenSecs = '300'
NetTimeout = '30'
RedoCompression = 'DISABLE'
LogShipping = 'ON'
PreferredApplyInstance = ''
ApplyInstanceTimeout = '0'
ApplyParallel = 'AUTO'
StandbyFileManagement = 'auto'
ArchiveLagTarget = '0'
LogArchiveMaxProcesses = '4'
LogArchiveMinSucceedDest = '1'
DbFileNameConvert = '/u01/app/oracle/oradata/ogg/, /u01/app/oracle/oradata/dogg/'
LogFileNameConvert = '/u01/app/oracle/oradata/ogg/, /u01/app/oracle/oradata/dogg/'
FastStartFailoverTarget = ''
InconsistentProperties = '(monitor)'
InconsistentLogXptProps = '(monitor)'
SendQEntries = '(monitor)'
LogXptStatus = '(monitor)'
RecvQEntries = '(monitor)'
ApplyLagThreshold = '0'
TransportLagThreshold = '0'
TransportDisconnectedThreshold = '30'
SidName = 'dogg'
StaticConnectIdentifier = '(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=d-ogg)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dogg_DGMGRL)(INSTANCE_NAME=dogg)(SERVER=DEDICATED)))'
StandbyArchiveLocation = '/u01/app/oracle/archive'
AlternateLocation = ''
LogArchiveTrace = '0'
LogArchiveFormat = '%t_%s_%r.dbf'
TopWaitEvents = '(monitor)'
Database Status:
SUCCESS
(9)修改StaticConnectIdentifier參數,記得兩個數據庫都要修改。
DGMGRL> edit database ogg set property StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.80)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ogg)(SERVER=DEDICATED)))';
DGMGRL> edit database dogg set property StaticConnectIdentifier='(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.1.90)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=dogg)(SERVER=DEDICATED)))';
(10)開始切換
DGMGRL> switchover to dogg;
Performing switchover NOW, please wait...
Operation requires a connection to instance "dogg" on database "dogg"
Connecting to instance "dogg"...
Connected.
New primary database "dogg" is opening...
Operation requires startup of instance "ogg" on database "ogg"
Starting instance "ogg"...
ORACLE instance started.
Database mounted.
Database opened.
Switchover succeeded, new primary is "dogg"
(11)查看狀態
DGMGRL> show configuration;
Configuration - oggdg
Protection Mode: MaxPerformance
Databases:
dogg - Primary database
ogg - Physical standby database
Fast-Start Failover: DISABLED
Configuration Status:
SUCCESS
(12)再次切換回去
DGMGRL> switchover to ogg;
感謝你能夠認真閱讀完這篇文章,希望小編分享的“DG Broker如何搭建”這篇文章對大家有幫助,同時也希望大家多多支持億速云,關注億速云行業資訊頻道,更多相關知識等著你來學習!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。