這篇文章主要介紹了DG Broker如何搭建,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
按需網(wǎng)站開發(fā)可以根據(jù)自己的需求進(jìn)行定制,成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)構(gòu)思過程中功能建設(shè)理應(yīng)排到主要部位公司成都網(wǎng)站設(shè)計(jì)、網(wǎng)站建設(shè)的運(yùn)用實(shí)際效果公司網(wǎng)站制作網(wǎng)站建立與制做的實(shí)際意義DG Broker搭建
1.環(huán)境說明
database | sid | db_name | db_unique_name | net service name |
primary | ogg | ogg | ogg | ogg_p |
physical standby | dogg | ogg | dogg | dogg_s |
2.查看參數(shù)
----主庫
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參數(shù)。這里就用默認(rèn)的路徑,也可以自己指定。如果是在RAC環(huán)境中,這個把這個文件把到共享的存儲上面,如果有ASM可以放到ASM中。
3.啟用BROKER
----在兩個數(shù)據(jù)庫上面都執(zhí)行:
alter system set dg_broker_start=true scope=both;
4.登錄配置
---在其中任意一臺做下面的操作就可以了,另它安裝了client的客戶端也是可以的
[oracle@ogg-80 ~]$ dgmgrl
(1)連接到當(dāng)前的主數(shù)據(jù)庫
DGMGRL> connect sys/oracle@ogg_p
DGMGRL> help create -----查看幫助
Creates a broker configuration
Syntax:
CREATE CONFIGURATION
PRIMARY DATABASE IS
CONNECT IDENTIFIER IS
(2)創(chuàng)建一個配置文件(ogg是db_unique_name,oggDG是配置的名字--可以修改,ogg_p是連接到prod數(shù)據(jù)庫的tnsname)
create configuration oggDG as primary database is ogg connect identifier is ogg_p;
(3)啟用配置文件
DGMGRL> enable configuration;
(4)增加備庫到配置文件中 (dogg是備機(jī)的db_unique_name,dogg_s是連接到sprod數(shù)據(jù)庫的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參數(shù),記得兩個數(shù)據(jù)庫都要修改。
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)查看狀態(tài)
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;
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“DG Broker如何搭建”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)-成都網(wǎng)站建設(shè)公司行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!