RAC歸檔儲存方案:交叉互備
RAC歸檔儲存方案:交叉互備
1、測試環境
10.2.0.1.0 on 2.6.18-53.el5
192.168.1.101 rac1
192.168.1.102 rac2
2、RAC歸檔一般放在所有節點都可以看到的地方,方便RMAN發現所有的歸檔日誌。
RMAN>backup archivelog all delete all input format '.......';
3、RAC歸檔方案有:
--使用OCFS共享儲存
--使用NFS共享儲存
--使用交叉互備(即本方案缺點:大量互傳歸檔,慎用)
--任何節點只有它自己的歸檔日誌,使用時再合併
4、本文演示的交叉互備方案需大量互傳歸檔,慎用
5、如發現錯誤歡迎立即提出,方便及時更正
一、在一個非常大的檔案系統上建立目錄
1、在RAC1上建目錄,rac1-rac2路徑一致
$ mkdir /u01/arch
$ ll -d /u01/arch
drwxr-xr-x 2 oracle oinstall 4096 Jul 6 11:01 /u01/arch
2、在RAC2上建目錄,rac1-rac2路徑一致
[oracle@rac2 ~]$ mkdir /u01/arch
[oracle@rac2 ~]$ ll -d /u01/arch
drwxr-xr-x 2 oracle oinstall 4096 Jul 6 11:01 /u01/arch
1、本地歸檔設定
alter system set log_archive_dest_1='location=/u01/arch';
2、分別檢視tnsnames中針對另一節點的tnsnames.ora
[oracle@rac1 ~]$ head -12 $ORACLE_HOME/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RACDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RACDB)
(INSTANCE_NAME = RACDB1)
)
)
[oracle@rac2 ~]$ head -12 $ORACLE_HOME/network/admin/tnsnames.ora
# tnsnames.ora.rac2 Network Configuration File: /u01/db_1/network/admin/tnsnames.ora.rac2
# Generated by Oracle configuration tools.
RACDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RACDB)
(INSTANCE_NAME = RACDB1)
)
)
2、交叉歸檔,這樣每個節點都可以讀到其他節點的歸檔
alter system set log_archive_dest_2='service=RACDB2' sid='RACDB1';
alter system set log_archive_dest_2='service=RACDB1' sid='RACDB2';
alter system set standby_archive_dest='/u01/arch';
3、確認引數設定生效
col value for a25
col name for a20
select inst_id,name,value from gv$parameter
where name in ('standby_archive_dest','log_archive_dest_2','log_archive_dest_1');
INST_ID NAME VALUE
---------- -------------------- -------------------------
1 log_archive_dest_1 location=/u01/arch
1 log_archive_dest_2 service=RACDB2
1 standby_archive_dest /u01/arch
2 log_archive_dest_1 location=/u01/arch
2 log_archive_dest_2 service=RACDB1
2 standby_archive_dest /u01/arch
6 rows selected.
4、典型錯誤演示:service=*設定錯誤,傳輸歸檔到對方節點時會有以下錯誤
alter system set log_archive_dest_2='service=rac2' sid='RACDB1';
alter system set log_archive_dest_2='service=rac1' sid='RACDB2';
alter system set standby_archive_dest='/u01/arch';
SYS@RACDB2> alter system archive log current;
$ tail -f /u01/admin/RACDB/bdump/*.log
Mon Jul 7 17:42:46 2014
Thread 2 advanced to log sequence 32
Current log# 4 seq# 32 mem# 0: +DG1/racdb/redo04.log
Mon Jul 7 17:42:46 2014
Error 12514 received logging on to the standby
Mon Jul 7 17:42:46 2014
Errors in file /u01/admin/RACDB/bdump/racdb2_arc1_5696.trc:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
PING[ARC1]: Heartbeat failed to connect to standby 'rac1'. Error is 12514.
三、調整歸檔日誌檔案命名方式
SYS@RACDB1> alter system set log_archive_format ='arch_%S_%R_%T.arc' scope=spfile;
SYS@RACDB1> select value from v$spparameter where name='log_archive_format';
--arch_%S_%R_%T.arc
%s: 日誌序列號
%S:日誌序列號(帶有前導0)。
%t: 重做執行緒編號。
%T: 重做執行緒編號(帶有前導0)
%a: %A:資料庫ID號
%d: 資料庫ID號
%r: RESETLOGS的id值
四、為RAC資料庫開啟歸檔
1、關閉所有節點資料庫例項
$ srvctl stop database -d RACDB
$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application OFFLINE OFFLINE
ora....B2.inst application ONLINE OFFLINE
ora.RACDB.db application OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
2、在其中一個節點上開歸檔
SYS@RACDB1> startup mount
SYS@RACDB1> alter database archivelog;
SYS@RACDB1> alter database open;
3、開啟所有節點資料庫例項
$ srvctl stop database -d RACDB
$ srvctl start database -d RACDB;sleep 60
4、驗證歸檔是否開啟
SYS@RACDB1> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch
Oldest online log sequence 26
Next log sequence to archive 27
Current log sequence 27
五、測試、確認以上配置達到目的
1、 當前無任何歸檔日誌
[oracle@rac1 ~]$ ls -1 /u01/arch/*
ls: /u01/arch/*: No such file or directory
[oracle@rac2 ~]$ ls -1 /u01/arch/*
ls: /u01/arch/*: No such file or directory
2、切換REDO生成歸檔
SYS@RACDB2> alter system archive log current;
3、注意事項、測試、確認以上配置達到目的
[oracle@rac1 ~]$ ls -1 /u01/arch/*
/u01/arch/arch_0000000033_0851859689_0001.arc
/u01/arch/arch_0000000038_0851859689_0002.arc
[oracle@rac2 ~]$ ls -1 /u01/arch/*
/u01/arch/arch_0000000033_0851859689_0001.arc
/u01/arch/arch_0000000038_0851859689_0002.arc
zcs0237
2014.07.06
More cleaner and more efficient!
1、測試環境
10.2.0.1.0 on 2.6.18-53.el5
192.168.1.101 rac1
192.168.1.102 rac2
2、RAC歸檔一般放在所有節點都可以看到的地方,方便RMAN發現所有的歸檔日誌。
RMAN>backup archivelog all delete all input format '.......';
3、RAC歸檔方案有:
--使用OCFS共享儲存
--使用NFS共享儲存
--使用交叉互備(即本方案缺點:大量互傳歸檔,慎用)
--任何節點只有它自己的歸檔日誌,使用時再合併
4、本文演示的交叉互備方案需大量互傳歸檔,慎用
5、如發現錯誤歡迎立即提出,方便及時更正
一、在一個非常大的檔案系統上建立目錄
1、在RAC1上建目錄,rac1-rac2路徑一致
$ mkdir /u01/arch
$ ll -d /u01/arch
drwxr-xr-x 2 oracle oinstall 4096 Jul 6 11:01 /u01/arch
2、在RAC2上建目錄,rac1-rac2路徑一致
[oracle@rac2 ~]$ mkdir /u01/arch
[oracle@rac2 ~]$ ll -d /u01/arch
drwxr-xr-x 2 oracle oinstall 4096 Jul 6 11:01 /u01/arch
1、本地歸檔設定
alter system set log_archive_dest_1='location=/u01/arch';
2、分別檢視tnsnames中針對另一節點的tnsnames.ora
[oracle@rac1 ~]$ head -12 $ORACLE_HOME/network/admin/tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RACDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RACDB)
(INSTANCE_NAME = RACDB1)
)
)
[oracle@rac2 ~]$ head -12 $ORACLE_HOME/network/admin/tnsnames.ora
# tnsnames.ora.rac2 Network Configuration File: /u01/db_1/network/admin/tnsnames.ora.rac2
# Generated by Oracle configuration tools.
RACDB1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RACDB)
(INSTANCE_NAME = RACDB1)
)
)
2、交叉歸檔,這樣每個節點都可以讀到其他節點的歸檔
alter system set log_archive_dest_2='service=RACDB2' sid='RACDB1';
alter system set log_archive_dest_2='service=RACDB1' sid='RACDB2';
alter system set standby_archive_dest='/u01/arch';
3、確認引數設定生效
col value for a25
col name for a20
select inst_id,name,value from gv$parameter
where name in ('standby_archive_dest','log_archive_dest_2','log_archive_dest_1');
INST_ID NAME VALUE
---------- -------------------- -------------------------
1 log_archive_dest_1 location=/u01/arch
1 log_archive_dest_2 service=RACDB2
1 standby_archive_dest /u01/arch
2 log_archive_dest_1 location=/u01/arch
2 log_archive_dest_2 service=RACDB1
2 standby_archive_dest /u01/arch
6 rows selected.
4、典型錯誤演示:service=*設定錯誤,傳輸歸檔到對方節點時會有以下錯誤
alter system set log_archive_dest_2='service=rac2' sid='RACDB1';
alter system set log_archive_dest_2='service=rac1' sid='RACDB2';
alter system set standby_archive_dest='/u01/arch';
SYS@RACDB2> alter system archive log current;
$ tail -f /u01/admin/RACDB/bdump/*.log
Mon Jul 7 17:42:46 2014
Thread 2 advanced to log sequence 32
Current log# 4 seq# 32 mem# 0: +DG1/racdb/redo04.log
Mon Jul 7 17:42:46 2014
Error 12514 received logging on to the standby
Mon Jul 7 17:42:46 2014
Errors in file /u01/admin/RACDB/bdump/racdb2_arc1_5696.trc:
ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
PING[ARC1]: Heartbeat failed to connect to standby 'rac1'. Error is 12514.
三、調整歸檔日誌檔案命名方式
SYS@RACDB1> alter system set log_archive_format ='arch_%S_%R_%T.arc' scope=spfile;
SYS@RACDB1> select value from v$spparameter where name='log_archive_format';
--arch_%S_%R_%T.arc
%s: 日誌序列號
%S:日誌序列號(帶有前導0)。
%t: 重做執行緒編號。
%T: 重做執行緒編號(帶有前導0)
%a: %A:資料庫ID號
%d: 資料庫ID號
%r: RESETLOGS的id值
四、為RAC資料庫開啟歸檔
1、關閉所有節點資料庫例項
$ srvctl stop database -d RACDB
$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....B1.inst application OFFLINE OFFLINE
ora....B2.inst application ONLINE OFFLINE
ora.RACDB.db application OFFLINE OFFLINE
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
2、在其中一個節點上開歸檔
SYS@RACDB1> startup mount
SYS@RACDB1> alter database archivelog;
SYS@RACDB1> alter database open;
3、開啟所有節點資料庫例項
$ srvctl stop database -d RACDB
$ srvctl start database -d RACDB;sleep 60
4、驗證歸檔是否開啟
SYS@RACDB1> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /u01/arch
Oldest online log sequence 26
Next log sequence to archive 27
Current log sequence 27
五、測試、確認以上配置達到目的
1、 當前無任何歸檔日誌
[oracle@rac1 ~]$ ls -1 /u01/arch/*
ls: /u01/arch/*: No such file or directory
[oracle@rac2 ~]$ ls -1 /u01/arch/*
ls: /u01/arch/*: No such file or directory
2、切換REDO生成歸檔
SYS@RACDB2> alter system archive log current;
3、注意事項、測試、確認以上配置達到目的
[oracle@rac1 ~]$ ls -1 /u01/arch/*
/u01/arch/arch_0000000033_0851859689_0001.arc
/u01/arch/arch_0000000038_0851859689_0002.arc
[oracle@rac2 ~]$ ls -1 /u01/arch/*
/u01/arch/arch_0000000033_0851859689_0001.arc
/u01/arch/arch_0000000038_0851859689_0002.arc
zcs0237
2014.07.06
More cleaner and more efficient!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29734436/viewspace-1212567/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- RAC歸檔配置方案:使用NFS共享儲存儲存歸檔檔案NFS
- 資料儲存(歸檔解檔,沙河儲存)
- IOS資料儲存之歸檔/解檔iOS
- rac歸檔模式/非歸檔模式下檔案建至本地儲存修復方法-ORA-01157模式
- Backup And Recovery User's Guide-為長期儲存而建立歸檔備份GUIIDE
- Oracle RAC 歸檔與非歸檔切換Oracle
- rac更改歸檔模式模式
- 塊儲存 檔案儲存 物件儲存物件
- oracle歸檔日誌儲存路徑的設定Oracle
- RAC環境中非歸檔改為歸檔模式模式
- Backup And Recovery User's Guide-為長期儲存建立資料庫備份-歸檔備份的目的GUIIDE資料庫
- RAC(ASM)歸檔模式修改ASM模式
- ORACLE RAC 設定歸檔Oracle
- ORACLE RAC 啟用歸檔Oracle
- UDEV管理RAC共享儲存dev
- openfiler配置rac共享儲存
- RAC環境歸檔NFS掛載方式RMAN備份錯誤NFS
- 簡單2步就能將大量檔案歸類儲存
- 資料儲存--檔案儲存
- 儲存遷移方案
- oracle RAC開啟歸檔模式Oracle模式
- RAC 開啟歸檔日誌
- Backup And Recovery User's Guide-為長期儲存建立資料庫備份-歸檔備份的基本概念GUIIDE資料庫
- vmware設定共享儲存(RAC)
- 小儲存容量手機有救了!Android 新歸檔功能可釋放 60% 儲存空間Android
- 檔案儲存
- 上海HP 儲存培訓歸來
- 備份歸檔日誌
- 備份歸檔日誌檔案
- Flutter持久化儲存之檔案儲存Flutter持久化
- RAC開啟資料庫歸檔資料庫
- RAC 環境下修改歸檔模式模式
- 10G RAC歸檔設定
- 物件儲存 vs 檔案儲存 vs 塊儲存,選哪個?物件
- RAC變更ASMSPFILE儲存位置(轉)ASM
- Oracle RAC 體系結構--儲存Oracle
- solaris安裝RAC的儲存配置
- 檔案儲存NAS備份服務開放公測