這篇文章主要介紹了DG Broker如何搭建,具有一定借鑒價(jià)值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
從事成都服務(wù)器托管,服務(wù)器租用,云主機(jī),雅安服務(wù)器托管,空間域名,CDN,網(wǎng)絡(luò)代維等服務(wù)。
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)境中,這個(gè)把這個(gè)文件把到共享的存儲(chǔ)上面,如果有ASM可以放到ASM中。
3.啟用BROKER
----在兩個(gè)數(shù)據(jù)庫上面都執(zhí)行:
alter system set dg_broker_start=true scope=both;
4.登錄配置
---在其中任意一臺(tái)做下面的操作就可以了,另它安裝了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 <configuration name> AS
PRIMARY DATABASE IS <database name>
CONNECT IDENTIFIER IS <connect identifier>;
(2)創(chuàng)建一個(gè)配置文件(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ù),記得兩個(gè)數(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如何搭建”這篇文章對(duì)大家有幫助,同時(shí)也希望大家多多支持創(chuàng)新互聯(lián),關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識(shí)等著你來學(xué)習(xí)!
新聞標(biāo)題:DGBroker如何搭建
標(biāo)題URL:http://aaarwkj.com/article26/pcsdcg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App開發(fā)、商城網(wǎng)站、網(wǎng)站內(nèi)鏈、網(wǎng)頁設(shè)計(jì)公司、關(guān)鍵詞優(yōu)化、營(yíng)銷型網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)