Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle 11g rman backup related

2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

1. Verify that the backup can be successfully restored, and full restore determines which backup sets and archive logs need to be applied.

RMAN > restore database preview Starting restore at 07-OCT-15using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=202 device type=DISKallocated channel: ORA_DISK_2channel ORA_DISK_2: SID=138 device type=DISKList of Backup Sets=BS Key Type LV Size Device Type Elapsed Time Completion Time-- -57 Incr 0 363.33M DISK 00:01:26 05-OCT-15 List of Datafiles in backup set 57 File LV Type Ckp SCN Ckp Time Name-10 Incr 3687271 05-OCT-15 + DATA/phub/datafile/system.271.891340857 2 0 Incr 3687271 05-OCT-15 + DATA/phub/datafile/sysaux.272.891340857 40 Incr 3687271 05-OCT-15 + DATA/phub/datafile/users.269.891340843 7 0 Incr 3687271 05-OCT-15 + DATA/phub/datafile/idx01.dbf Backup Set Copy # 1 of backup set 57 Device Type Elapsed Time Completion Time Compressed Tag- -DISK 00:01:26 05-OCT-15 YES DB0 List of Backup Pieces for backup set 57 Copy # 1 BP Key Pc# Status Piece Name-64 1 AVAILABLE / home/oracle/backup/data_51qiv187_1_1 .bak 65 2 AVAILABLE / home/oracle/backup/data_51qiv187_2_1.bak 66 3 AVAILABLE / home/oracle/backup/data_51qiv187_3_1.bak 67 4 AVAILABLE / home/oracle/backup/data_51qiv187_4_1.bakBS Key Type LV Size Device Type Elapsed Time Completion Time-- -55 Incr 0 215.65M DISK 00:01:06 05-OCT-15 List of Datafiles in backup set 55 File LV Type Ckp SCN Ckp Time Name-3 0 Incr 3687269 05-OCT-15 + DATA/phub/datafile/undotbs1.260.891340857 5 0 Incr 3687269 05-OCT-15 + DATA/phub/datafile/example.287.891340843 60 Incr 3687269 05-OCT-15 + DATA/phub/datafile/llc01.dbf Backup Set Copy # 1 of backup set 55 Device Type Elapsed Time Completion Time Compressed Tag- -DISK 00:01:06 05-OCT-15 YES DB0 List of Backup Pieces for backup set 55 Copy # 1 BP Key Pc# Status Piece Name-60 1 AVAILABLE / home/oracle/backup/data_50qiv187_1_ 1.bak 61 2 AVAILABLE / home/oracle/backup/data_50qiv187_2_1.bak 62 3 AVAILABLE / home/oracle/backup/data_50qiv187_3_1.bakusing channel ORA_DISK_1using channel ORA_DISK_2List of Archived Log Copies for database with db_unique_name PHUB====Key Thrd Seq S Low Time---552 1 276 A 05-OCT-15 Name: + DATA/phub/archivelog/2015_10_05/thread_1_seq_276.374.892332021554 1 277 A 05-OCT-15 Name: + DATA/phub/archivelog/2015_10_06/thread_1_seq_277.372.892352657556 1 278 A 06-OCT-15 Name: + DATA/phub/archivelog/2015_10_06/thread_1_seq_278.370 892370685557 1 279 A 06-OCT-15 Name: + DATA/phub/archivelog/2015_10_06/thread_1_seq_279.368.892385187559 1 280 A 06-OCT-15 Name: + DATA/phub/archivelog/2015_10_06/thread_1_seq_280.365.892385193562 1 281 A 06-OCT-15 Name: + DATA/phub/archivelog/2015_10_06/thread_1_seq_281 .285.892411985564 1 282 A 06-OCT-15 Name: + DATA/phub/archivelog/2015_10_07/thread_1_seq_282.290.892428501566 1 283 A 07-OCT-15 Name: + DATA/phub/archivelog/2015_10_07/thread_1_seq_283.300.892458049Media recovery start SCN is 3687269Recovery must be done beyond SCN 3687271 to clear datafile fuzzinessFinished restore at 07-OCT-15

two。 Check the latest backup set used to restore the database to confirm that the backup is complete, and check the copies of data files and archive log backup sets required for recovery.

RMAN > restore database validate Starting restore at 07-OCT-15using channel ORA_DISK_1using channel ORA_DISK_2channel ORA_DISK_1: starting validation of datafile backup setchannel ORA_DISK_2: starting validation of datafile backup setchannel ORA_DISK_1: reading from backup piece / home/oracle/backup/data_50qiv187_1_1.bakchannel ORA_DISK_2: reading from backup piece / home/oracle/backup/data_51qiv187_1_1.bakchannel ORA_DISK_1: piece handle=/home/oracle/backup/data_50qiv187_1_1.bak Tag=DB0channel ORA_DISK_1: restored backup piece 1channel ORA_DISK_1: reading from backup piece / home/oracle/backup/data_50qiv187_2_1.bakchannel ORA_DISK_2: piece handle=/home/oracle/backup/data_51qiv187_1_1.bak tag=DB0channel ORA_DISK_2: restored backup piece 1channel ORA_DISK_2: reading from backup piece / home/oracle/backup/data_51qiv187_2_1.bakchannel ORA_DISK_2: piece handle=/home/oracle/backup/data_51qiv187_2_1 .bak tag=DB0channel ORA_DISK_2: restored backup piece 2channel ORA_DISK_2: reading from backup piece / home/oracle/backup/data_51qiv187_3_1.bakchannel ORA_DISK_1: piece handle=/home/oracle/backup/data_50qiv187_2_1.bak tag=DB0channel ORA_DISK_1: restored backup piece 2channel ORA_DISK_1: reading from backup piece / home/oracle/backup/data_50qiv187_3_1.bakchannel ORA_DISK_2: piece handle=/home/oracle/backup/data_51qiv187_3 _ 1.bak tag=DB0channel ORA_DISK_2: restored backup piece 3channel ORA_DISK_2: reading from backup piece / home/oracle/backup/data_51qiv187_4_1.bakchannel ORA_DISK_1: piece handle=/home/oracle/backup/data_50qiv187_3_1.bak tag=DB0channel ORA_DISK_1: restored backup piece 3channel ORA_DISK_1: validation complete Elapsed time: 00:01:03channel ORA_DISK_2: piece handle=/home/oracle/backup/data_51qiv187_4_1.bak tag=DB0channel ORA_DISK_2: restored backup piece 4channel ORA_DISK_2: validation complete, elapsed time: 00:01:12Finished restore at 07-OCT-15

3. Verify that there is a bad block in the data file:

RMAN > backup check logical validate database Starting backup at 07-OCT-15using channel ORA_DISK_1using channel ORA_DISK_2channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00006 name=+DATA/phub/datafile/llc01.dbfinput datafile file number=00005 name=+DATA/phub/datafile/example.287.891340843input datafile file number=00003 name=+DATA/phub/datafile/undotbs1.260.891340857channel ORA_DISK_2: starting full datafile backup setchannel ORA_DISK_2: specifying datafile (s) in backup setinput datafile file number=00007 name=+DATA/phub/datafile/idx01 .dbfinput datafile file number=00002 name=+DATA/phub/datafile/sysaux.272.891340857input datafile file number=00001 name=+DATA/phub/datafile/system.271.891340857input datafile file number=00004 name=+DATA/phub/datafile/users.269.891340843channel ORA_DISK_2: backup set complete Elapsed time: 00:00:55List of Datafiles=File Status Marked Corrupt Empty Blocks Blocks Examined High SCN-----1 OK 0 14660 98639 3880208 File Name: + DATA/phub/datafile/system .271.891340857 Block Type Blocks Failing Blocks Processed-Data 0 65879 Index 0 13480 Other 0 4541 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN -- 2 OK 0 23933 120381 3880206 File Name: + DATA/phub/datafile/sysaux.272.891340857 Block Type Blocks Failing Blocks Processed- -- Data 0 35531 Index 0 30258 Other 0 30598 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN -4 OK 0 4478 87390 3006034 File Name: + DATA/phub/datafile/users.269.891340843 Block Type Blocks Failing Blocks Processed- -Data 0 81242 Index 0 730 Other 0910 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN -7 OK 0 98073 131072 3010614 File Name: + DATA/phub/datafile/idx01.dbf Block Type Blocks Failing Blocks Processed-Data 0 0 Index 0 32360 Other 0639 channel ORA_DISK_2: starting full datafile backup setchannel ORA_DISK_2: specifying datafile (s) in backup setincluding current control file in backup setchannel ORA_DISK_2: backup set complete Elapsed time: 00:00:01List of Control File and SPFILE==File Type Status Blocks Failing Blocks Examined--Control File OK 0646 channel ORA_DISK_1: backup set complete Elapsed time: 00:00:59List of Datafiles=File Status Marked Corrupt Empty Blocks Blocks Examined High SCN-----3 OK 0 1 18560 3880208 File Name: + DATA/phub/datafile / undotbs1.260.891340857 Block Type Blocks Failing Blocks Processed-Data 0 0 Index 0 0 Other 0 18559 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN-----5 OK 2192 31371 44325 3819558 File Name: + DATA/phub/datafile/example.287.891340843 Block Type Blocks Failing Blocks Processed- -Data 0 4394 Index 0 1149 Other 0 7406 File Status Marked Corrupt Empty Blocks Blocks Examined High SCN -6 OK 0 166327 393216 3015852 File Name: + DATA/phub/datafile/llc01.dbf Block Type Blocks Failing Blocks Processed- -Data 0 192240 Index 0 32080 Other 0 2569 Finished backup at 07-OCT-15

4. Verify a single data file:

RMAN > backup check logical validate datafile 1 Starting backup at 07-OCT-15using channel ORA_DISK_1using channel ORA_DISK_2channel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00001 name=+DATA/phub/datafile/system.271.891340857channel ORA_DISK_2: starting full datafile backup setchannel ORA_DISK_2: specifying datafile (s) in backup setincluding current control file in backup setchannel ORA_DISK_2: backup set complete Elapsed time: 00:00:01List of Control File and SPFILE==File Type Status Blocks Failing Blocks Examined--Control File OK 0646 channel ORA_DISK_1: backup set complete Elapsed time: 00:00:07List of Datafiles=File Status Marked Corrupt Empty Blocks Blocks Examined High SCN-----1 OK 0 14660 98639 3880343 File Name: + DATA/phub/datafile/system .271.891340857 Block Type Blocks Failing Blocks Processed-Data 0 65879 Index 0 13480 Other 0 4541 Finished backup at 07-OCT-15

5. Backup progress query:

Select case when opname like'% aggregate%' then 'total' else opname end opname, trunc (sofar * 100 / totalwork, 2) | |'% 'progress, units from v$session_longops where opname like' RMAN%' and totalwork > sofar OPNAME PROGRESS UNITS -RMAN: incremental datafile backup 62.28% Blockstotal 0% BlocksRMAN: incremental datafile backup 75.47% Blocks

6. Recovery progress query:

SELECT sid, serial#, CONTEXT, sofar, totalwork, round (sofar / totalwork * 100,2) "% Complete" FROM v$session_longops WHERE opname LIKE 'RMAN:%' AND opname NOT LIKE' RMAN: aggregate%' SID SERIAL# CONTEXT SOFAR TOTALWORK% Complete--8 5 1 329181437312 75.27 192 31 1 2812 20456096 61.66

Restore complete:

SELECT sid, serial#, CONTEXT, sofar, totalwork, round (sofar / totalwork * 100,2) "% Complete" FROM v$session_longops WHERE opname LIKE 'RMAN:%' 9 AND opname NOT LIKE' RMAN: aggregate%' SID SERIAL# CONTEXT SOFAR TOTALWORK% Complete--8 5 1 437312437312 100 192 31 1 4560966096 100

Simple backup script:

Run {allocate channel C1 device type disk maxpiecesize=51200M;allocate channel C2 device type disk maxpiecesize=51200M;sql 'alter system switch logfile';crosscheck archivelog all;delete noprompt expired archivelog all;delete noprompt archivelog until time' sysdate-15';backup incremental level=0 tag='db0' as compressed backupset database include currentcontrolfile format'/ back/level0/df_%U.bak';release channel C1 backup;delete noprompt obsolete;delete noprompt expired backup; release channel C2scape crosscheck backup;delete noprompt obsolete;delete noprompt expired backup;}

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report