您好,登錄后才能下訂單哦!
配置遠程歸檔
與本地歸檔一樣,遠程歸檔也是配置在dmarch.ini文件中,遠程歸檔相關的主要幾個配置項包括:
1. ARCH_TYPE設置為REMOTE,表示是遠程歸檔
2. ARCH_DEST設置為遠程數據庫實例名,表示REDO日志發送到這個節點
3. ARCH_INCOMING_PATH設置為本地存儲路徑,用于保存ARCH_DEST實例發送的REDO日志
一般建議DMRAC集群中的節點,在配置本地歸檔之外,再交叉配置集群中所有其他節點的遠程歸檔。查詢V$DM_ARCH_INI、V$ARCH_STATUS等動態視圖可以獲取歸檔配置以及歸檔狀態等相關信息。下面以兩節點DMRAC集群為例,說明如何配置遠程歸檔,RAC0和RAC1是DMRAC集群中的兩個實例,交叉進行REMOTE歸檔配置:
1)修改數據庫為MOUNT狀態。
rac0實例:
SQL> alter database mount; executed successfully used time: 00:00:01.852. Execute id is 0.
rac1實例:
SQL> alter database mount; executed successfully used time: 00:00:01.853. Execute id is 0.
2)配置本地歸檔。
rac0實例:
SQL> alter database add archivelog 'dest=/dm7/data/rac0_arch,type=local,file_size=256,space_limit=0'; executed successfully used time: 3.459(ms). Execute id is 0.
rac1實例:
SQL> alter database add archivelog 'dest=/dm7/data/rac1_arch,type=local,file_size=256,space_limit=0'; executed successfully used time: 3.000(ms). Execute id is 0.
3)配置遠程歸檔。
rac0實例:
SQL> alter database add archivelog 'dest=RAC1,type=remote,file_size=256,space_limit=0,incoming_path=/dm7/data/rac1_arch'; executed successfully used time: 2.836(ms). Execute id is 0.
rac1實例:
SQL> alter database add archivelog 'dest=RAC0,type=remote,file_size=256,space_limit=0,incoming_path=/dm7/data/rac0_arch'; executed successfully used time: 2.865(ms). Execute id is 0.
4)開啟歸檔模式。
rac0實例:
SQL> alter database archivelog; executed successfully used time: 11.553(ms). Execute id is 0.
rac1實例:
SQL> alter database archivelog; executed successfully used time: 10.644(ms). Execute id is 0.
5)修改數據庫為OPEN狀態。
rac0實例:
SQL> alter database open; executed successfully used time: 00:00:01.362. Execute id is 0.
rac1實例:
SQL> alter database open; executed successfully used time: 00:00:02.341. Execute id is 0.
6)查看歸檔配置文件dmarch.ini
rac0實例:
[dmdba@dmrac1 rac0_config]$ pwd /dm7/data/rac0_config [dmdba@dmrac1 rac0_config]$ cat dmarch.ini #DaMeng Database Archive Configuration file #this is comments ARCH_WAIT_APPLY = 1 [ARCHIVE_LOCAL1] ARCH_TYPE = LOCAL ARCH_DEST = /dm7/data/rac0_arch ARCH_FILE_SIZE = 256 ARCH_SPACE_LIMIT = 0 [ARCH_REMOTE1] ARCH_TYPE = REMOTE ARCH_DEST = RAC1 ARCH_INCOMING_PATH = /dm7/data/rac1_arch ARCH_FILE_SIZE = 256 ARCH_SPACE_LIMIT = 0
rac1實例:
[dmdba@dmrac2 rac1_config]$ pwd /dm7/data/rac1_config [dmdba@dmrac2 rac1_config]$ cat dmarch.ini #DaMeng Database Archive Configuration file #this is comments ARCH_WAIT_APPLY = 1 [ARCHIVE_LOCAL1] ARCH_TYPE = LOCAL ARCH_DEST = /dm7/data/rac1_arch ARCH_FILE_SIZE = 256 ARCH_SPACE_LIMIT = 0 [ARCH_REMOTE1] ARCH_TYPE = REMOTE ARCH_DEST = RAC0 ARCH_INCOMING_PATH = /dm7/data/rac0_arch ARCH_FILE_SIZE = 256 ARCH_SPACE_LIMIT = 0
7)檢查ARCH_INI參數是否為1
rac0實例:
SQL> select * from v$dm_ini where para_name='ARCH_INI'; LINEID PARA_NAME PARA_VALUE MIN_VALUE MAX_VALUE MPP_CHK SESS_VALUE FILE_VALUE DESCRIPTION PARA_TYPE ---------- --------- ---------- --------- --------- ------- ---------- ---------- ----------- --------- 1 ARCH_INI 1 0 1 N 1 1 dmarch.ini SYS used time: 10.267(ms). Execute id is 9.
rac1實例:
SQL> select * from v$dm_ini where para_name='ARCH_INI'; LINEID PARA_NAME PARA_VALUE MIN_VALUE MAX_VALUE MPP_CHK SESS_VALUE FILE_VALUE DESCRIPTION PARA_TYPE ---------- --------- ---------- --------- --------- ------- ---------- ---------- ----------- --------- 1 ARCH_INI 1 0 1 N 1 1 dmarch.ini SYS used time: 30.225(ms). Execute id is 19.
8)檢查是否生成了歸檔日志文件(在打開數據庫時就會生成)
本地歸檔日志文件
rac0實例:
[dmdba@dmrac1 rac0_arch]$ pwd /dm7/data/rac0_arch [dmdba@dmrac1 rac0_arch]$ ls -lrt total 136 -rw-r--r-- 1 dmdba dinstall 268435456 May 28 20:21 ARCHIVE_LOCAL1_20200528202150715_0.log
rac1實例:
[dmdba@dmrac2 rac1_arch]$ pwd /dm7/data/rac1_arch [dmdba@dmrac2 rac1_arch]$ ls -lrt total 136 -rw-r--r-- 1 dmdba dinstall 268435456 May 28 20:21 ARCHIVE_LOCAL1_20200528202151877_1.log
遠程歸檔日志文件
rac0實例:
[dmdba@dmrac1 rac1_arch]$ pwd /dm7/data/rac1_arch [dmdba@dmrac1 rac1_arch]$ ls -lrt total 136 -rw-r--r-- 1 dmdba dinstall 268435456 May 28 20:21 ARCH_REMOTE1_20200528202146001_1.log
rac1實例:
[dmdba@dmrac2 rac0_arch]$ pwd /dm7/data/rac0_arch [dmdba@dmrac2 rac0_arch]$ ls -lrt total 136 -rw-r--r-- 1 dmdba dinstall 268435456 May 28 20:21 ARCH_REMOTE1_20200528202156601_0.log
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。