Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

41

积分

0

好友

15

主题
1#
发表于 2012-6-27 11:36:03 | 查看: 5846| 回复: 5
os:Red Hat Enterprise Linux Server release 5.4 (Tikanga)
db:11.2.0.1.0

两个节点rac

用户
[oracle@syk1 rman_backup]$ id oracle
uid=1101(oracle) gid=1000(oinstall) groups=1000(oinstall),1201(asmdba),1300(dba),1301(oper)
[oracle@syk1 rman_backup]$ id grid
uid=1100(grid) gid=1000(oinstall) groups=1000(oinstall),1200(asmadmin),1201(asmdba),1202(asmoper),1300(dba)

归档在每个节点本地
syk1上是/arch/sykdb
syk2上是/arch/sykdb

备份过程如下:
RMAN> run{
2> allocate channel ch1 type disk;
3> allocate channel ch2 type disk;
4> backup incremental level 0 database format '/rman_backup/db_level0_%d_%T_%s_%p_%t' tag 'db_level0';
5> sql 'alter system archive log current';
6> release channel ch2;
7> release channel ch1;
8> }
released channel: ORA_DISK_1
allocated channel: ch1
channel ch1: SID=80 instance=sykdb1 device type=DISK
allocated channel: ch2
channel ch2: SID=141 instance=sykdb1 device type=DISK
Starting backup at 27-JUN-2012 11:14:08
channel ch1: starting incremental level 0 datafile backup set
channel ch1: specifying datafile(s) in backup set
input datafile file number=00002 name=+SYKDB_DATA/sykdb/datafile/sysaux.260.778361943
input datafile file number=00004 name=+SYKDB_DATA/sykdb/datafile/undotbs2.263.778361987
input datafile file number=00005 name=+SYKDB_DATA/sykdb/datafile/users.264.778361995
channel ch1: starting piece 1 at 27-JUN-2012 11:14:09
channel ch2: starting incremental level 0 datafile backup set
channel ch2: specifying datafile(s) in backup set
input datafile file number=00003 name=+SYKDB_DATA/sykdb/datafile/undotbs1.261.778361967
input datafile file number=00001 name=+SYKDB_DATA/sykdb/datafile/system.259.778361915
channel ch2: starting piece 1 at 27-JUN-2012 11:14:09
channel ch2: finished piece 1 at 27-JUN-2012 11:14:54
piece handle=/rman_backup/db_level0_SYKDB_20120627_98_1_787058049 tag=DB_LEVEL0 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:45
channel ch2: starting incremental level 0 datafile backup set
channel ch2: specifying datafile(s) in backup set
including current control file in backup set
channel ch2: starting piece 1 at 27-JUN-2012 11:15:02
channel ch2: finished piece 1 at 27-JUN-2012 11:15:05
piece handle=/rman_backup/db_level0_SYKDB_20120627_99_1_787058095 tag=DB_LEVEL0 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:03
channel ch2: starting incremental level 0 datafile backup set
channel ch2: specifying datafile(s) in backup set
including current SPFILE in backup set
channel ch2: starting piece 1 at 27-JUN-2012 11:15:06
channel ch2: finished piece 1 at 27-JUN-2012 11:15:09
piece handle=/rman_backup/db_level0_SYKDB_20120627_100_1_787058105 tag=DB_LEVEL0 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:03
channel ch1: finished piece 1 at 27-JUN-2012 11:15:13
piece handle=/rman_backup/db_level0_SYKDB_20120627_97_1_787058048 tag=DB_LEVEL0 comment=NONE
channel ch1: backup set complete, elapsed time: 00:01:04
Finished backup at 27-JUN-2012 11:15:13
sql statement: alter system archive log current
released channel: ch2
released channel: ch1

RMAN> crosscheck backup;
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=80 instance=sykdb1 device type=DISK
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_98_1_787058049 RECID=97 STAMP=787058050
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_99_1_787058095 RECID=98 STAMP=787058102
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_100_1_787058105 RECID=99 STAMP=787058106
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_97_1_787058048 RECID=100 STAMP=787058050
Crosschecked 4 objects
数据文件备份没问题

下面是备份归档:
RMAN> run{
2> allocate channel ch1 type disk connect [email=sys/admin123@sykdb1]sys/admin123@sykdb1[/email];
3> allocate channel ch2 type disk connect [email=sys/admin123@sykdb2]sys/admin123@sykdb2[/email];
4> backup archivelog all format '/rman_backup/arch_level0_%s_%p_%t' tag 'arch_level0' delete all input;
5> crosscheck backup;
6> delete noprompt expired backup;
7> delete noprompt obsolete;
8> release channel ch2;
9> release channel ch1;
10> }
released channel: ORA_DISK_1
allocated channel: ch1
channel ch1: SID=198 instance=sykdb1 device type=DISK
allocated channel: ch2
channel ch2: SID=200 instance=sykdb2 device type=DISK
Starting backup at 27-JUN-2012 11:18:07
current log archived
channel ch2: starting archived log backup set
channel ch2: specifying archived log(s) in backup set
input archived log thread=2 sequence=139 RECID=278 STAMP=787057967
channel ch2: starting piece 1 at 27-JUN-2012 11:18:10
channel ch1: starting archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=1 sequence=261 RECID=277 STAMP=787057962
input archived log thread=1 sequence=262 RECID=280 STAMP=787058118
channel ch1: starting piece 1 at 27-JUN-2012 11:18:10
channel ch1: finished piece 1 at 27-JUN-2012 11:18:11
piece handle=/rman_backup/arch_level0_102_1_787058290 tag=ARCH_LEVEL0 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
channel ch1: deleting archived log(s)
archived log file name=/arch/sykdb/1_261_778361898.dbf RECID=277 STAMP=787057962
archived log file name=/arch/sykdb/1_262_778361898.dbf RECID=280 STAMP=787058118
channel ch2: finished piece 1 at 27-JUN-2012 11:18:11
piece handle=/rman_backup/arch_level0_101_1_787058290 tag=ARCH_LEVEL0 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:01
channel ch2: deleting archived log(s)
archived log file name=/arch/sykdb/2_139_778361898.dbf RECID=278 STAMP=787057967
channel ch2: starting archived log backup set
channel ch2: specifying archived log(s) in backup set
input archived log thread=2 sequence=140 RECID=279 STAMP=787058118
input archived log thread=2 sequence=141 RECID=282 STAMP=787058289
channel ch2: starting piece 1 at 27-JUN-2012 11:18:12
channel ch1: starting archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=1 sequence=263 RECID=281 STAMP=787058289
channel ch1: starting piece 1 at 27-JUN-2012 11:18:12
channel ch1: finished piece 1 at 27-JUN-2012 11:18:13
piece handle=/rman_backup/arch_level0_104_1_787058292 tag=ARCH_LEVEL0 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
channel ch1: deleting archived log(s)
archived log file name=/arch/sykdb/1_263_778361898.dbf RECID=281 STAMP=787058289
channel ch2: finished piece 1 at 27-JUN-2012 11:18:13
piece handle=/rman_backup/arch_level0_103_1_787058292 tag=ARCH_LEVEL0 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:01
channel ch2: deleting archived log(s)
archived log file name=/arch/sykdb/2_140_778361898.dbf RECID=279 STAMP=787058118
archived log file name=/arch/sykdb/2_141_778361898.dbf RECID=282 STAMP=787058289
Finished backup at 27-JUN-2012 11:18:13
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_98_1_787058049 RECID=97 STAMP=787058050
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_99_1_787058095 RECID=98 STAMP=787058102
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_100_1_787058105 RECID=99 STAMP=787058106
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/db_level0_SYKDB_20120627_97_1_787058048 RECID=100 STAMP=787058050
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/arch_level0_102_1_787058290 RECID=102 STAMP=787058290
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/arch_level0_104_1_787058292 RECID=104 STAMP=787058292
Crosschecked 6 objects
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/arch_level0_101_1_787058290 RECID=101 STAMP=787058290
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=/rman_backup/arch_level0_103_1_787058292 RECID=103 STAMP=787058292
Crosschecked 2 objects

specification does not match any backup in the repository
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Backup Set           101    27-JUN-2012 11:18:10
  Backup Piece       101    27-JUN-2012 11:18:10 /rman_backup/arch_level0_101_1_787058290
deleted backup piece
backup piece handle=/rman_backup/arch_level0_101_1_787058290 RECID=101 STAMP=787058290
Deleted 1 objects


released channel: ch2
released channel: ch1
RMAN>

为什么arch_level0_101_1_787058290 会是被 看成obsolete呢???
rman配置采用默认。
2#
发表于 2012-6-27 13:17:49
action plan:


rman target /

show all;

report obsolete;


贴出以上输出

回复 只看该作者 道具 举报

3#
发表于 2012-6-27 13:19:07
RMAN> show all;

RMAN configuration parameters for database with db_unique_name SYKDB are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/home/oracle/ctl_%F.ctl';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_sykdb1.f'; # default

RMAN> report obsolete;

RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
no obsolete backups found

回复 只看该作者 道具 举报

4#
发表于 2012-6-27 13:21:48
/rman_backup/arch_level0_101_1_787058290 是什么备份?

这个已经被你删除了,是否是归档日志

你的 redundancy 是1 ,有其他冗余 上面的这个 obsolete很正常

回复 只看该作者 道具 举报

5#
发表于 2012-6-27 13:31:20
这个是节点2上对139归档的备份
current log archived
channel ch2: starting archived log backup set
channel ch2: specifying archived log(s) in backup set
input archived log thread=2 sequence=139 RECID=278 STAMP=787057967
channel ch2: starting piece 1 at 27-JUN-2012 11:18:10
channel ch1: starting archived log backup set
channel ch1: specifying archived log(s) in backup set
input archived log thread=1 sequence=261 RECID=277 STAMP=787057962
input archived log thread=1 sequence=262 RECID=280 STAMP=787058118
channel ch1: starting piece 1 at 27-JUN-2012 11:18:10
channel ch1: finished piece 1 at 27-JUN-2012 11:18:11
piece handle=/rman_backup/arch_level0_102_1_787058290 tag=ARCH_LEVEL0 comment=NONE
channel ch1: backup set complete, elapsed time: 00:00:01
channel ch1: deleting archived log(s)
archived log file name=/arch/sykdb/1_261_778361898.dbf RECID=277 STAMP=787057962
archived log file name=/arch/sykdb/1_262_778361898.dbf RECID=280 STAMP=787058118
channel ch2: finished piece 1 at 27-JUN-2012 11:18:11
piece handle=/rman_backup/arch_level0_101_1_787058290 tag=ARCH_LEVEL0 comment=NONE
channel ch2: backup set complete, elapsed time: 00:00:01
channel ch2: deleting archived log(s)
archived log file name=/arch/sykdb/2_139_778361898.dbf RECID=278 STAMP=787057967

回复 只看该作者 道具 举报

6#
发表于 2012-6-27 13:33:11
其他冗余?这个没有,我也没找到关于2_139_778361898.dbf这个归档备份的冗余

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-12-26 02:50 , Processed in 0.047085 second(s), 21 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569