ORACLE-DataGuard系列:邏輯standby搭建
來(lái)源:易賢網(wǎng) 閱讀:1119 次 日期:2014-10-17 10:45:38
溫馨提示:易賢網(wǎng)小編為您整理了“ORACLE-DataGuard系列:邏輯standby搭建”,方便廣大網(wǎng)友查閱!

準(zhǔn)備:

確認(rèn)對(duì)象和語(yǔ)句能被standby支持

確保primary庫(kù)中各表的行可被唯一標(biāo)識(shí)

環(huán)境:

操作系統(tǒng):RED HAT LINUX ENTERPRISE 5

ORACLE: 11.2.0.1.0

PRIMARY:

IP: 192.168.1.11

SID: test

DB_UNIQUE_NAME:test

安裝路徑:/oracle/oracle/product/11.2.0/dbhome_1

本地歸檔路徑:/oracle/oradata/test/archive

PHYSICS STANDBY:

IP: 192.168.1.12

SID: dgtest

DB_UNIQUE_NAME:dgtest

安裝路徑:/oracle/oracle/product/11.2.0/dbhome_1

本地歸檔路徑:/oracle/oradata/dgtest/dgtest/archive

LOGICAL STANDBY:

IP: 192.168.1.15

SID: logicdg

DB_UNIQUE_NAME: logicdg

安裝路徑:/oracle/oracle/product/11.2.0/dbhome_1

本地歸檔路徑:/oracle/oradata/logicdg/local-archive

本例測(cè)試采用物理standby轉(zhuǎn)邏輯standby的方式在一個(gè)已經(jīng)存在的dataguard環(huán)境中新增一臺(tái)邏輯standby.

原dataguard環(huán)境可參考:

http://xin23.blog.51cto.com/1827266/504066

創(chuàng)建新物理standby的過程亦可參照此文。此處不再贅述。

則目前環(huán)境為:

primary:192.168.1.11

physics: 192.168.1.12

logical: 192.168.1.15 (目前為物理standby.待轉(zhuǎn)換)

1.修改primary初始化參數(shù)文件(僅列出修改部分)

*.log_archive_dest_state_2=defer

*.log_archive_dest_state_3=defer

*.log_archive_config='dg_config=(test,dgtest,logicdg)'

*.log_archive_dest_2='service=test12 arch valid_for=(online_logfiles,primary_role) db_unique_name=dgtest'

*.log_archive_dest_3='service=test15 arch valid_for=(online_logfiles,primary_role) db_unique_name=logicdg'

*.fal_server=test11

*.fal_client=test12

*.standby_file_management=auto

*.db_file_name_convert='/oracle/oradata/test','/oracle/oradata/dgtest/dgtest','/oracle/oradata/test','/

oracle/oradata/logicdg'

*.log_file_name_convert='/oracle/oradata/test','/oracle/oradata/dgtest/dgtest','/oracle/oradata/test','/

oracle/oradata/logicdg'

2.查看兩臺(tái)物理standby同步狀態(tài)

physics> select sequence#,applied from v$archived_log;

SEQUENCE# APPLIED

---------- ---------

66 YES

67 YES

68 YES

69 YES

70 YES

71 YES

72 YES

7 rows selected.

-----------------------------------------------------------------------------

logical> select sequence#,applied from v$archived_log;

SEQUENCE# APPLIED

---------- ---------

67 YES

68 YES

69 YES

70 YES

71 YES

72 YES

6 rows selected.

3.取消待轉(zhuǎn)換物理standby的redo應(yīng)用

logical> alter database recover managed standby database cancel;

Database altered.

4.primary生成數(shù)據(jù)字典

primary> execute dbms_logstdby.build;

PL/SQL procedure successfully completed.

5.將物理standby轉(zhuǎn)換為邏輯standby

logical> alter database recover to logical standby logicdg;

Database altered.

logical> shutdown immediate

ORA-01507: database not mounted

ORACLE instance shut down.

logical> startup mount

ORACLE instance started.

Total System Global Area 2488635392 bytes

Fixed Size 2215904 bytes

Variable Size 1392508960 bytes

Database Buffers 1090519040 bytes

Redo Buffers 3391488 bytes

Database mounted.

6.調(diào)整standby初始化參數(shù)

logical> alter system set log_archive_dest_1='location=/oracle/oradata/logicdg/local-archive valid_for=(online_logfiles,all_roles)

2 db_unique_name=logicdg';

System altered.

logical> alter system set log_archive_dest_5='location=/oracle/oradata/logicdg/archive valid_for=(standby_logfiles,standby_role)

2 db_unique_name=logicdg';

System altered.

7.resetlogs方式打開數(shù)據(jù)庫(kù)

logical> alter database open resetlogs;

Database altered.

8.應(yīng)用redo

創(chuàng)建standby redologs

logical> alter database add standby logfile group 11 '/oracle/oradata/logicdg/standbyredo11.log' size 100m;

Database altered.

logical> alter database add standby logfile group 12 '/oracle/oradata/logicdg/standbyredo12.log' size 100m;

Database altered.

logical> alter database add standby logfile group 13 '/oracle/oradata/logicdg/standbyredo13.log' size 100m;

Database altered.

啟動(dòng)redo實(shí)時(shí)應(yīng)用

logical> alter database start logical standby apply immediate;

Database altered.

更多信息請(qǐng)查看IT技術(shù)專欄

更多信息請(qǐng)查看數(shù)據(jù)庫(kù)
易賢網(wǎng)手機(jī)網(wǎng)站地址:ORACLE-DataGuard系列:邏輯standby搭建
由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請(qǐng)考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇?zhǔn)!

2025國(guó)考·省考課程試聽報(bào)名

  • 報(bào)班類型
  • 姓名
  • 手機(jī)號(hào)
  • 驗(yàn)證碼
關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡(jiǎn)要咨詢 | 簡(jiǎn)要咨詢須知 | 加入群交流 | 手機(jī)站點(diǎn) | 投訴建議
工業(yè)和信息化部備案號(hào):滇ICP備2023014141號(hào)-1 云南省教育廳備案號(hào):云教ICP備0901021 滇公網(wǎng)安備53010202001879號(hào) 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號(hào)
云南網(wǎng)警備案專用圖標(biāo)
聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號(hào):hfpxwx
咨詢QQ:526150442(9:00—18:00)版權(quán)所有:易賢網(wǎng)
云南網(wǎng)警報(bào)警專用圖標(biāo)