- 论坛徽章:
- 0
|
结论::
这种交叉存储备份集的方法,不实用!
如果当其中的一个节点掉电,该节点上的一个备份集就不可访问,
那么在正常节点恢复时,该节点也没有完整的备份集,所以不可恢复!
在RAC环境中进行多结点的备份以及交叉存储备份集!
(1)RMAN备份脚本:
脚本关键:a.在各节点分配通道;b.重写默认的自动定位功能,指定从哪里备份文件
run{
allocate channel c1 type disk connect 'sys/sys@game2_rman';
allocate channel c2 type disk connect 'sys/sys@game1_rman';
BACKUP
tag AAAA
(DATAFILE 1,2,3 CHANNEL c1)
(DATAFILE 4,5,6 CHANNEL c2);
BACKUP
tag BBBB
(DATAFILE 1,2,3 CHANNEL c2)
(DATAFILE 4,5,6 CHANNEL c1);
}
注意:tag AAAA是一个完整备份,但分布在了两个节点,tag BBBB也是!
(2)注意要配置net为专有服务器模式:
说明:RMAN连接非常苛刻,必须配置成专有服务器模式,否则报错RMAN-03009和ORA-19550!
配置只需要添加一个专门的RMAN连接就行,如下GAME1_RMAN和GAME2_RMAN就是针对RMAN特意添加的连接项
[oracle@orac1 admin]$ cat tnsnames.ora
# TNSNAMES.ORA Network Configuration File: /opt/oracle/product/9i/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
GAME2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orac2)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = game)
(INSTANCE_NAME = game2)
)
)
GAME2_RMAN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orac2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = game)
(INSTANCE_NAME = game2)
)
)
GAME1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orac1)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = game)
(INSTANCE_NAME = game1)
)
)
GAME1_RMAN =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = orac1)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = game)
(INSTANCE_NAME = game1)
)
)
LISTENERS_GAME =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = orac1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = orac2)(PORT = 1521))
)
GAME =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = orac1)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = orac2)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVICE_NAME = game)
)
)
(3)在其中一个节点(节点一orac1)执行脚本:
[oracle@orac1 oracle]$ rman target/
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: GAME (DBID=4226673132)
RMAN> run{
2> allocate channel c1 type disk connect 'sys/sys@game2_rman';
3> allocate channel c2 type disk connect 'sys/sys@game1_rman';
4> BACKUP
5> tag AAAA
6> (DATAFILE 1,2,3 CHANNEL c1)
7> (DATAFILE 4,5,6 CHANNEL c2);
8> BACKUP
9> tag BBBB
10> (DATAFILE 1,2,3 CHANNEL c2)
11> (DATAFILE 4,5,6 CHANNEL c1);
12> }
allocated channel: c1
channel c1: sid=19 devtype=DISK
allocated channel: c2
channel c2: sid=19 devtype=DISK
Starting backup at 20-DEC-06
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
input datafile fno=00005 name=/opt/oracle/oradata/game/undotbs02.dbf
input datafile fno=00006 name=/opt/oracle/oradata/game/users01.dbf
input datafile fno=00004 name=/opt/oracle/oradata/game/tools01.dbf
channel c2: starting piece 1 at 20-DEC-06
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00001 name=/opt/oracle/oradata/game/system01.dbf
input datafile fno=00002 name=/opt/oracle/oradata/game/undotbs01.dbf
input datafile fno=00003 name=/opt/oracle/oradata/game/indx01.dbf
channel c1: starting piece 1 at 20-DEC-06
channel c1: finished piece 1 at 20-DEC-06
piece handle=/opt/oracle/product/9i/dbs/0di5ebur_1_1 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:36
channel c2: finished piece 1 at 20-DEC-06
piece handle=/opt/oracle/product/9i/dbs/0ei5ebtt_1_1 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:36
Finished backup at 20-DEC-06
Starting backup at 20-DEC-06
channel c1: starting full datafile backupset
channel c1: specifying datafile(s) in backupset
input datafile fno=00005 name=/opt/oracle/oradata/game/undotbs02.dbf
input datafile fno=00006 name=/opt/oracle/oradata/game/users01.dbf
input datafile fno=00004 name=/opt/oracle/oradata/game/tools01.dbf
channel c1: starting piece 1 at 20-DEC-06
channel c2: starting full datafile backupset
channel c2: specifying datafile(s) in backupset
including current SPFILE in backupset
including current controlfile in backupset
input datafile fno=00001 name=/opt/oracle/oradata/game/system01.dbf
input datafile fno=00002 name=/opt/oracle/oradata/game/undotbs01.dbf
input datafile fno=00003 name=/opt/oracle/oradata/game/indx01.dbf
channel c2: starting piece 1 at 20-DEC-06
channel c1: finished piece 1 at 20-DEC-06
piece handle=/opt/oracle/product/9i/dbs/0fi5ebvv_1_1 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:27
channel c2: finished piece 1 at 20-DEC-06
piece handle=/opt/oracle/product/9i/dbs/0gi5ebv1_1_1 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:27
Finished backup at 20-DEC-06
released channel: c1
released channel: c2
RMAN>
(4)查看备份集信息:
(4.1)查各节点中的备份集
orac1:
[oracle@orac1 dbs]$ pwd
/opt/oracle/product/9i/dbs
[oracle@orac1 dbs]$ ls -l
total 1962772
-rw-r----- 1 oracle dba 238419968 Dec 20 13:58 05i5e72v_1_1
-rw-r----- 1 oracle dba 260472832 Dec 20 13:58 06i5e72v_1_1
-rw-r----- 1 oracle dba 260472832 Dec 20 13:58 07i5e73p_1_1
-rw-r----- 1 oracle dba 238419968 Dec 20 13:58 08i5e73p_1_1
-rw-r----- 1 oracle dba 260472832 Dec 20 14:45 0ai5e9s1_1_1
-rw-r----- 1 oracle dba 238419968 Dec 20 14:46 0ci5e9sr_1_1
-rw-r----- 1 oracle dba 260472832 Dec 20 15:20 0ei5ebtt_1_1
-rw-r----- 1 oracle dba 238419968 Dec 20 15:21 0gi5ebv1_1_1
-rw-r--r-- 1 oracle dba 1419 Dec 18 22:34 bak_initgame1.ora
-rw-r----- 1 oracle dba 3584 Dec 18 21:53 bak_spfilegame1.ora
-rw-r--r-- 1 oracle dba 8385 Mar 9 2002 init.ora
-rw-r--r-- 1 oracle dba 12920 Mar 8 2002 initdw.ora
-rw-r--r-- 1 oracle dba 49 Dec 18 22:34 initgame1.ora
-rwSr----- 1 oracle dba 1536 Dec 20 14:19 orapwgame1
-rw-r----- 1 oracle dba 12247040 Dec 20 15:21 snapcf_game1.f
[oracle@orac1 dbs]$
orac2:
[oracle@orac2 dbs]$ pwd
/opt/oracle/product/9i/dbs
[oracle@orac2 dbs]$ ls -l
total 987396
-rw-r----- 1 oracle dba 238419968 Dec 20 14:46 09i5e9sv_1_1
-rw-r----- 1 oracle dba 260472832 Dec 20 14:46 0bi5e9tp_1_1
-rw-r----- 1 oracle dba 238419968 Dec 20 15:21 0di5ebur_1_1
-rw-r----- 1 oracle dba 260472832 Dec 20 15:22 0fi5ebvv_1_1
-rw-r--r-- 1 oracle dba 1419 Dec 18 22:35 bak_initgame2.ora
-rw-r----- 1 oracle dba 3584 Dec 18 21:53 bak_spfilegame2.ora
-rw-r--r-- 1 oracle dba 8385 Mar 9 2002 init.ora
-rw-r--r-- 1 oracle dba 12920 Mar 8 2002 initdw.ora
-rw-r--r-- 1 oracle dba 49 Dec 18 22:36 initgame2.ora
-rwSr----- 1 oracle dba 1536 Dec 20 14:20 orapwgame2
-rw-r----- 1 oracle dba 12247040 Dec 20 15:21 snapcf_game2.f
[oracle@orac2 dbs]$
(4.2)查具体的备份信息:
RMAN> list backup summary;
List of Backups
===============
Key TY LV S Device Type Completion Time #Pieces #Copies Tag
------- -- -- - ----------- --------------- ------- ------- ---
1 B 0 A DISK 18-DEC-06 1 1 INC_L0_ORCL_BACKUP
2 B 0 A DISK 18-DEC-06 1 1 INC_L0_ORCL_BACKUP
3 B 0 A DISK 18-DEC-06 1 1 INC_L0_ORCL_BACKUP
4 B 0 A DISK 18-DEC-06 1 1 INC_L0_ORCL_BACKUP
5 B F A DISK 20-DEC-06 1 1 TAG20061220T135751
6 B F A DISK 20-DEC-06 1 1 TAG20061220T135751
7 B F A DISK 20-DEC-06 1 1 TAG20061220T135817
8 B F A DISK 20-DEC-06 1 1 TAG20061220T135817
9 B F A DISK 20-DEC-06 1 1 TAG20061220T144521
10 B F A DISK 20-DEC-06 1 1 TAG20061220T144521
11 B F A DISK 20-DEC-06 1 1 TAG20061220T144547
12 B F A DISK 20-DEC-06 1 1 TAG20061220T144547
13 B F A DISK 20-DEC-06 1 1 AAAA
14 B F A DISK 20-DEC-06 1 1 AAAA
15 B F A DISK 20-DEC-06 1 1 BBBB
16 B F A DISK 20-DEC-06 1 1 BBBB
RMAN>
说明:Key =13,14,15,16为此次备份
控制文件的备份信息:
RMAN> list backup of controlfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Incr 0 11M DISK 00:00:14 18-DEC-06
BP Key: 1 Status: AVAILABLE Tag: INC_L0_ORCL_BACKUP
Piece Name: /home/oracle/fullbak/L0_GAME_20061218_01i5a0oe_1_1
Controlfile Included: Ckp SCN: 1916695 Ckp time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Incr 0 11M DISK 00:00:12 18-DEC-06
BP Key: 3 Status: AVAILABLE Tag: INC_L0_ORCL_BACKUP
Piece Name: /home/oracle/fullbak/L0_GAME_20061218_03i5a0tk_1_1
Controlfile Included: Ckp SCN: 1916882 Ckp time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Full 11M DISK 00:00:20 20-DEC-06
BP Key: 5 Status: AVAILABLE Tag: TAG20061220T135751
Piece Name: /opt/oracle/product/9i/dbs/05i5e72v_1_1
Controlfile Included: Ckp SCN: 2250036 Ckp time: 20-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8 Full 11M DISK 00:00:22 20-DEC-06
BP Key: 8 Status: AVAILABLE Tag: TAG20061220T135817
Piece Name: /opt/oracle/product/9i/dbs/08i5e73p_1_1
Controlfile Included: Ckp SCN: 2250079 Ckp time: 20-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9 Full 11M DISK 00:00:22 20-DEC-06
BP Key: 9 Status: AVAILABLE Tag: TAG20061220T144521
Piece Name: /opt/oracle/product/9i/dbs/09i5e9sv_1_1
Controlfile Included: Ckp SCN: 2258524 Ckp time: 20-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12 Full 11M DISK 00:00:24 20-DEC-06
BP Key: 12 Status: AVAILABLE Tag: TAG20061220T144547
Piece Name: /opt/oracle/product/9i/dbs/0ci5e9sr_1_1
Controlfile Included: Ckp SCN: 2258564 Ckp time: 20-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Full 11M DISK 00:00:26 20-DEC-06
BP Key: 13 Status: AVAILABLE Tag: AAAA
Piece Name: /opt/oracle/product/9i/dbs/0di5ebur_1_1
Controlfile Included: Ckp SCN: 2263477 Ckp time: 20-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15 Full 11M DISK 00:00:25 20-DEC-06
BP Key: 15 Status: AVAILABLE Tag: BBBB
Piece Name: /opt/oracle/product/9i/dbs/0gi5ebv1_1_1
Controlfile Included: Ckp SCN: 2263523 Ckp time: 20-DEC-06
RMAN>
说明:key=13,15中含有控制文件的备份信息,
分别在orac2:/opt/oracle/product/9i/dbs/0di5ebur_1_1和
orac1:/opt/oracle/product/9i/dbs/0gi5ebv1_1_1
参数文件的备份信息:
RMAN> list backup of spfile;
List of Backup Sets
===================
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1 Incr 0 0 DISK 00:00:14 18-DEC-06
BP Key: 1 Status: AVAILABLE Tag: INC_L0_ORCL_BACKUP
Piece Name: /home/oracle/fullbak/L0_GAME_20061218_01i5a0oe_1_1
SPFILE Included: Modification time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3 Incr 0 0 DISK 00:00:12 18-DEC-06
BP Key: 3 Status: AVAILABLE Tag: INC_L0_ORCL_BACKUP
Piece Name: /home/oracle/fullbak/L0_GAME_20061218_03i5a0tk_1_1
SPFILE Included: Modification time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5 Full 0 DISK 00:00:20 20-DEC-06
BP Key: 5 Status: AVAILABLE Tag: TAG20061220T135751
Piece Name: /opt/oracle/product/9i/dbs/05i5e72v_1_1
SPFILE Included: Modification time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8 Full 0 DISK 00:00:22 20-DEC-06
BP Key: 8 Status: AVAILABLE Tag: TAG20061220T135817
Piece Name: /opt/oracle/product/9i/dbs/08i5e73p_1_1
SPFILE Included: Modification time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9 Full 0 DISK 00:00:22 20-DEC-06
BP Key: 9 Status: AVAILABLE Tag: TAG20061220T144521
Piece Name: /opt/oracle/product/9i/dbs/09i5e9sv_1_1
SPFILE Included: Modification time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
12 Full 0 DISK 00:00:24 20-DEC-06
BP Key: 12 Status: AVAILABLE Tag: TAG20061220T144547
Piece Name: /opt/oracle/product/9i/dbs/0ci5e9sr_1_1
SPFILE Included: Modification time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
13 Full 0 DISK 00:00:26 20-DEC-06
BP Key: 13 Status: AVAILABLE Tag: AAAA
Piece Name: /opt/oracle/product/9i/dbs/0di5ebur_1_1
SPFILE Included: Modification time: 18-DEC-06
BS Key Type LV Size Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
15 Full 0 DISK 00:00:25 20-DEC-06
BP Key: 15 Status: AVAILABLE Tag: BBBB
Piece Name: /opt/oracle/product/9i/dbs/0gi5ebv1_1_1
SPFILE Included: Modification time: 18-DEC-06
RMAN>
说明:key=13,15中含有参数文件的备份信息,
分别在orac2:/opt/oracle/product/9i/dbs/0di5ebur_1_1和
orac1:/opt/oracle/product/9i/dbs/0gi5ebv1_1_1
[[i] 本帖最后由 tsingsong99 于 2006-12-20 18:15 编辑 [/i]] |
|