In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what is the use of RMAN archive log deletion strategy, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
Starting with 11gR2, RMAN introduced the configuration of archive deletion policy. Let's discuss this feature through a simple example:
Database version:
SQL > select * from v$version
BANNER
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0-64bit Production
PL/SQL Release 11.2.0.2.0-Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0-Production
NLSRTL Version 11.2.0.2.0-Production
1. View the RMAN configuration:
RMAN > show all
RMAN configuration parameters for database with db_unique_name RACTEST are:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS
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'% favored; # default
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 apprenticespact oracleandproduct11.2.0Uniplicationdbroom1anddbsAccordractest.fallow; # default
The default archive deletion policy is not enabled.
two。 Enable the archive delete policy:
RMAN > CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK
New RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK
New RMAN configuration parameters are successfully stored
Configure an archive deletion policy that requires only one archive backup to disk, after which the archive is allowed to be deleted.
3. Archive deletion Policy Test 1:
Current archive log:
SQL >! ls-al / u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13
Total 20
Drwxr-x--- 2 oracle oinstall 4096 Sep 13 02:37.
Drwxr-x--- 4 oracle oinstall 4096 Sep 13 01:24..
-rw-r- 1 oracle oinstall 1536 Sep 13 02:37 o1_mf_1_20_76wnbnfk_.arc
-rw-r- 1 oracle oinstall 1536 Sep 13 02:37 o1_mf_1_21_76wnbrt0_.arc
-rw-r- 1 oracle oinstall 1024 Sep 13 02:37 o1_mf_1_22_76wnbrv9_.arc
RMAN > backup archivelog all delete all input
Starting backup at 2011-09-13 02:37:42
Current log archived
Using channel ORA_DISK_1
Channel ORA_DISK_1: starting archived log backup set
Channel ORA_DISK_1: specifying archived log (s) in backup set
Input archived log thread=1 sequence=20 RECID=16 STAMP=761711828
Input archived log thread=1 sequence=21 RECID=17 STAMP=761711832
Input archived log thread=1 sequence=22 RECID=18 STAMP=761711832
Input archived log thread=1 sequence=23 RECID=19 STAMP=761711862
Channel ORA_DISK_1: starting piece 1 at 2011-09-13 02:37:42
Channel ORA_DISK_1: finished piece 1 at 2011-09-13 02:37:43
Piece handle=/u01/app/oracle/fast_recovery_area/RACTEST/backupset/2011_09_13/o1_mf_annnn_TAG20110913T023742_76wncpk6_.bkp tag=TAG20110913T023742 comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Channel ORA_DISK_1: deleting archived log (s)
Archived log file name=/u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13/o1_mf_1_20_76wnbnfk_.arc RECID=16 STAMP=761711828
Archived log file name=/u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13/o1_mf_1_21_76wnbrt0_.arc RECID=17 STAMP=761711832
Archived log file name=/u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13/o1_mf_1_22_76wnbrv9_.arc RECID=18 STAMP=761711832
Archived log file name=/u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13/o1_mf_1_23_76wncpd1_.arc RECID=19 STAMP=761711862
Finished backup at 2011-09-13 02:37:43
Delete all entered archive log files while backing up the archive.
Look at the archive log file again and find that it has been deleted.
SQL >! ls-al / u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13
Total 8
Drwxr-x--- 2 oracle oinstall 4096 Sep 13 02:37.
Drwxr-x--- 4 oracle oinstall 4096 Sep 13 01:24..
4. Archive deletion Policy Test 2:
Modify the archive log deletion policy to require two copies of archive logs backed up to disk before they can be deleted:
RMAN > CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DISK
2 >
Old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK
New RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DISK
New RMAN configuration parameters are successfully stored
View the current archive log:
SQL >! ls-al / u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13
Total 60
Drwxr-x--- 2 oracle oinstall 4096 Sep 13 02:40.
Drwxr-x--- 4 oracle oinstall 4096 Sep 13 01:24..
-rw-r- 1 oracle oinstall 47104 Sep 13 02:40 o1_mf_1_24_76wnkpn2_.arc
-rw-r- 1 oracle oinstall 1024 Sep 13 02:40 o1_mf_1_25_76wnkt2l_.arc
Perform archive backups and deletions:
RMAN > backup archivelog all delete all input
Starting backup at 2011-09-13 02:41:25
Current log archived
Using channel ORA_DISK_1
Channel ORA_DISK_1: starting archived log backup set
Channel ORA_DISK_1: specifying archived log (s) in backup set
Input archived log thread=1 sequence=24 RECID=20 STAMP=761712054
Input archived log thread=1 sequence=25 RECID=21 STAMP=761712058
Input archived log thread=1 sequence=26 RECID=22 STAMP=761712087
Channel ORA_DISK_1: starting piece 1 at 2011-09-13 02:41:28
Channel ORA_DISK_1: finished piece 1 at 2011-09-13 02:41:29
Piece handle=/u01/app/oracle/fast_recovery_area/RACTEST/backupset/2011_09_13/o1_mf_annnn_TAG20110913T024128_76wnlr48_.bkp tag=TAG20110913T024128 comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Channel ORA_DISK_1: deleting archived log (s)
RMAN-08138: WARNING: archived log not deleted-must create more backups
Archived log file name=/u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13/o1_mf_1_24_76wnkpn2_.arc thread=1 sequence=24
RMAN-08138: WARNING: archived log not deleted-must create more backups
Archived log file name=/u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13/o1_mf_1_25_76wnkt2l_.arc thread=1 sequence=25
RMAN-08138: WARNING: archived log not deleted-must create more backups
Archived log file name=/u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13/o1_mf_1_26_76wnlqxq_.arc thread=1 sequence=26
Finished backup at 2011-09-13 02:41:29
Execute the same backup archive while deleting the archive command, but you can see from the returned log that the archive log has not been deleted because we modified the archive deletion policy to back up at least two copies to disk.
SQL >! ls-al / u01/app/oracle/fast_recovery_area/RACTEST/archivelog/2011_09_13
Total 64
Drwxr-x--- 2 oracle oinstall 4096 Sep 13 02:41.
Drwxr-x--- 4 oracle oinstall 4096 Sep 13 01:24..
-rw-r- 1 oracle oinstall 47104 Sep 13 02:40 o1_mf_1_24_76wnkpn2_.arc
-rw-r- 1 oracle oinstall 1024 Sep 13 02:40 o1_mf_1_25_76wnkt2l_.arc
-rw-r- 1 oracle oinstall 2048 Sep 13 02:41 o1_mf_1_26_76wnlqxq_.arc
It is true that the archive log was not deleted!
5. Archive deletion Policy Test 3:
Modify the archive log backup policy to back up 1 copy to disk:
RMAN > CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK
Old RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DISK
New RMAN configuration parameters:
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK
New RMAN configuration parameters are successfully stored
Perform an archive log backup again:
RMAN > backup archivelog all
Starting backup at 2011-09-13 02:45:36
Current log archived
Using channel ORA_DISK_1
Skipping archived log file / u01ApplicationoracleUniverse fastened recoveryAccordia races.RACTESTOnArchivelogAccording to 2011-09-13-11-11-11-9-13-01-1-1-1-24-76 wnkpn2-Arc; already backed up 1 time (s)
Skipping archived log file / u01ApplicationoracleUniverse fastening recoveryAccording to already backed up 1 time (s)
Skipping archived log file / u01ApplicationoracleUniverse fastening recoveryAccording to already backed up 1 time (s)
Channel ORA_DISK_1: starting archived log backup set
Channel ORA_DISK_1: specifying archived log (s) in backup set
Input archived log thread=1 sequence=27 RECID=23 STAMP=761712336
Channel ORA_DISK_1: starting piece 1 at 2011-09-13 02:45:36
Channel ORA_DISK_1: finished piece 1 at 2011-09-13 02:45:37
Piece handle=/u01/app/oracle/fast_recovery_area/RACTEST/backupset/2011_09_13/o1_mf_annnn_TAG20110913T024536_76wntjqk_.bkp tag=TAG20110913T024536 comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2011-09-13 02:45:37
The above is all the contents of the article "what is the use of RMAN Archive Log deletion Strategy". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.