In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces "the method of rman backup archived log". In the daily operation, I believe that many people have doubts about the method of rman backup archived log. The editor consulted all kinds of materials and sorted out a simple and easy-to-use operation method. I hope it will be helpful to answer the doubt of "rman backup archived log method". Next, please follow the editor to study!
The recovery of the database needs to take advantage of the backup of the database and use archive logs to recover the scn and change the data after the backup point. If the archive log is lost, the database can be recovered, but there will still be data loss after the backup point, so it is also important to back up the archive log.
Display and archiving
RMAN > list archivelog all
List of Archived Log Copies for database with db_unique_name TEST
=
Key Thrd Seq S Low Time
-
5 1 62 X 2017-07-23 22:09:22
Name: / home/oracle/1_62_947085344.dbf
6 1 63 X 2017-07-25 14:19:26
Name: / home/oracle/1_63_947085344.dbf
... .
60 1 108 A 2017-07-29 17:27:50
Name: / home/oracle/1_108_947085344.dbf
61 1 109A 2017-07-29 17:27:56
Name: / home/oracle/1_109_947085344.dbf
Back up the archive log directly
RMAN > backup archivelog all format'/ home/oracle/archbak/rman_arch_%T_%u'
Starting backup at 2017-07-30 11:01:48
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=100 RECID=43 STAMP=950632615
Input archived log thread=1 sequence=101 RECID=44 STAMP=950633981
Input archived log thread=1 sequence=102 RECID=45 STAMP=950634100
Input archived log thread=1 sequence=103 RECID=46 STAMP=950634284
Input archived log thread=1 sequence=104 RECID=47 STAMP=950634446
Input archived log thread=1 sequence=105 RECID=48 STAMP=950635334
Input archived log thread=1 sequence=106 RECID=49 STAMP=950635622
Input archived log thread=1 sequence=107 RECID=57 STAMP=950635670
Input archived log thread=1 sequence=108 RECID=60 STAMP=950635676
Input archived log thread=1 sequence=109 RECID=61 STAMP=950697941
Input archived log thread=1 sequence=110 RECID=62 STAMP=950698908
Channel ORA_DISK_1: starting piece 1 at 2017-07-30 11:01:48
Channel ORA_DISK_1: finished piece 1 at 2017-07-30 11:01:49
Piece handle=/home/oracle/archbak/rman_arch_20170730_0vsal0ss tag=TAG20170730T110148 comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-30 11:01:49
Specify sequence
Back up from 108 to the longest seq archive
RMAN > backup archivelog from sequence 108 format'/ home/oracle/archbak/rman_arch_seq5_%T_%u'
Starting backup at 2017-07-30 11:04:38
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=108 RECID=60 STAMP=950635676
Input archived log thread=1 sequence=109 RECID=61 STAMP=950697941
Input archived log thread=1 sequence=110 RECID=62 STAMP=950698908
Input archived log thread=1 sequence=111 RECID=63 STAMP=950699078
Channel ORA_DISK_1: starting piece 1 at 2017-07-30 11:04:38
Channel ORA_DISK_1: finished piece 1 at 2017-07-30 11:04:39
Piece handle=/home/oracle/archbak/rman_arch_seq5_20170730_10sal126 tag=TAG20170730T110438 comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-30 11:04:39
Specify time
Such as backing up the archives of the last 3 days
RMAN > backup archivelog from time 'sysdate-3' format' / home/oracle/archbak/rman_arch_seq5_%T_%u'
Starting backup at 2017-07-30 11:08:45
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=100 RECID=43 STAMP=950632615
Input archived log thread=1 sequence=101 RECID=44 STAMP=950633981
Input archived log thread=1 sequence=102 RECID=45 STAMP=950634100
Input archived log thread=1 sequence=103 RECID=46 STAMP=950634284
Input archived log thread=1 sequence=104 RECID=47 STAMP=950634446
Input archived log thread=1 sequence=105 RECID=48 STAMP=950635334
Input archived log thread=1 sequence=106 RECID=49 STAMP=950635622
Input archived log thread=1 sequence=107 RECID=57 STAMP=950635670
Input archived log thread=1 sequence=108 RECID=60 STAMP=950635676
Input archived log thread=1 sequence=109 RECID=61 STAMP=950697941
Input archived log thread=1 sequence=110 RECID=62 STAMP=950698908
Input archived log thread=1 sequence=111 RECID=63 STAMP=950699078
Input archived log thread=1 sequence=112 RECID=64 STAMP=950699325
Channel ORA_DISK_1: starting piece 1 at 2017-07-30 11:08:45
Channel ORA_DISK_1: finished piece 1 at 2017-07-30 11:08:46
Piece handle=/home/oracle/archbak/rman_arch_seq5_20170730_11sal19t tag=TAG20170730T110845 comment=NONE
Channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-30 11:08:46
Add plus archvielog backup archive logs when backing up the database
RMAN > @ / home/oracle/backup_full_arch.sql
RMAN > run {
2 > allocate channel C1 type disk
3 > allocate channel c2 type disk
4 > backup database format'/ home/oracle/rman_full_%T_%u'
5 > plus archivelog format'/ home/oracle/rman_arch_%T_%u'
6 > release channel C1
7 > release channel c2
8 >}
Released channel: ORA_DISK_1
Allocated channel: c1
Channel c1: SID=30 device type=DISK
Allocated channel: c2
Channel c2: SID=36 device type=DISK
Starting backup at 2017-07-30 11:30:50
Current log archived
Channel c1: starting archived log backup set
Channel C1: specifying archived log (s) in backup set
Input archived log thread=1 sequence=100 RECID=43 STAMP=950632615
...
Channel c2: starting piece 1 at 2017-07-30 11:31:08
Including current control file in backup set
Channel C1: starting piece 1 at 2017-07-30 11:31:09
Channel c2: finished piece 1 at 2017-07-30 11:31:09
Piece handle=/home/oracle/rman_full_20170730_18sal2js tag=TAG20170730T113053 comment=NONE
Channel c2: backup set complete, elapsed time: 00:00:01
Channel C1: finished piece 1 at 2017-07-30 11:31:10
Piece handle=/home/oracle/rman_full_20170730_17sal2js tag=TAG20170730T113053 comment=NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-30 11:31:10
Starting backup at 2017-07-30 11:31:10
Current log archived
Channel c1: starting archived log backup set
Channel C1: specifying archived log (s) in backup set
Input archived log thread=1 sequence=114 RECID=66 STAMP=950700670
Channel C1: starting piece 1 at 2017-07-30 11:31:10
Channel C1: finished piece 1 at 2017-07-30 11:31:11
Piece handle=/home/oracle/rman_arch_20170730_19sal2ju tag=TAG20170730T113110 comment=NONE
Channel c1: backup set complete, elapsed time: 00:00:01
Finished backup at 2017-07-30 11:31:11
Released channel: c1
Released channel: c2
RMAN > * * end-of-file**
Restore archive log
Set archivelog destination to'/ home/oracle/arch' specifies the directory to restore
Restore archivelog all restores all archives, similar to backup archivelog, or you can specify sequence,scn,time
RMAN > @ / home/oracle/restore_arch.sql
RMAN > run {
2 > set archivelog destination to'/ home/oracle/arch'
3 > restore archivelog all
4 >}
Executing command: SET ARCHIVELOG DESTINATION
Using target database control file instead of recovery catalog
Starting restore at 2017-07-30 11:24:43
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID=30 device type=DISK
Archived log for thread 1 with sequence 100 is already on disk as file / home/oracle/1_100_947085344.dbf
Archived log for thread 1 with sequence 101 is already on disk as file / home/oracle/1_101_947085344.dbf
Archived log for thread 1 with sequence 102 is already on disk as file / home/oracle/1_102_947085344.dbf
Archived log for thread 1 with sequence 103 is already on disk as file / home/oracle/1_103_947085344.dbf
Archived log for thread 1 with sequence 104 is already on disk as file / home/oracle/1_104_947085344.dbf
Archived log for thread 1 with sequence 105 is already on disk as file / home/oracle/1_105_947085344.dbf
Archived log for thread 1 with sequence 106 is already on disk as file / home/oracle/1_106_947085344.dbf
Archived log for thread 1 with sequence 107 is already on disk as file / home/oracle/1_107_947085344.dbf
Archived log for thread 1 with sequence 108 is already on disk as file / home/oracle/1_108_947085344.dbf
Archived log for thread 1 with sequence 109 is already on disk as file / home/oracle/1_109_947085344.dbf
Archived log for thread 1 with sequence 110 is already on disk as file / home/oracle/1_110_947085344.dbf
Archived log for thread 1 with sequence 111 is already on disk as file / home/oracle/1_111_947085344.dbf
Archived log for thread 1 with sequence 112 is already on disk as file / home/oracle/1_112_947085344.dbf
At this point, the study of "the method of rman backup and archiving logs" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.