четверг, 8 октября 2009 г.

Резервное копирование баз данных RMAN

C:\Users\angor>rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Sat Jun 23 23:10:15 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TESTDB (DBID=2762894270)

RMAN> RUN {
2> ALLOCATE CHANNEL d1 TYPE DISK;
3> ALLOCATE CHANNEL d2 TYPE DISK;
4> ALLOCATE CHANNEL d3 TYPE DISK;
5> ALLOCATE CHANNEL d4 TYPE DISK;
6>
7> BACKUP
8>    FULL
9>    TAG  Daily_Full_Backup
10>    DATABASE FILESPERSET=1;
11>
12> BACKUP
13>    CURRENT CONTROLFILE;
14>
15> SQL 'alter system archive log current';
16>
17> BACKUP
18>    ARCHIVELOG ALL
19> FORMAT 'c:\backups\testdb\arch\%d_%t_%s_%p.arch';
20>
21> DELETE NOPROMPT OBSOLETE;
22> CROSSCHECK BACKUP;
23> CROSSCHECK ARCHIVELOG ALL;
24> DELETE NOPROMPT EXPIRED BACKUP;
25> DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
26> }


using target database control file instead of recovery catalog
allocated channel: d1
channel d1: SID=622 device type=DISK

allocated channel: d2
channel d2: SID=623 device type=DISK

allocated channel: d3
channel d3: SID=746 device type=DISK

allocated channel: d4
channel d4: SID=868 device type=DISK

Starting backup at 23-JUN-18
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00003 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_UNDOTBS1_FLW93Q12_.DBF
channel d1: starting piece 1 at 23-JUN-18
channel d2: starting full datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_SYSTEM_FLW91VTY_.DBF
channel d2: starting piece 1 at 23-JUN-18
channel d3: starting full datafile backup set
channel d3: specifying datafile(s) in backup set
input datafile file number=00002 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_SYSAUX_FLW931TG_.DBF
channel d3: starting piece 1 at 23-JUN-18
channel d4: starting full datafile backup set
channel d4: specifying datafile(s) in backup set
input datafile file number=00004 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_USERS_FLW94PXT_.DBF
channel d4: starting piece 1 at 23-JUN-18
channel d1: finished piece 1 at 23-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCLFP_.BKP tag=DAILY_FULL_BACKUP comment=NONE
channel d1: backup set complete, elapsed time: 00:00:09
channel d4: finished piece 1 at 23-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCRRP_.BKP tag=DAILY_FULL_BACKUP comment=NONE
channel d4: backup set complete, elapsed time: 00:00:28
channel d2: finished piece 1 at 23-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCMBW_.BKP tag=DAILY_FULL_BACKUP comment=NONE
channel d2: backup set complete, elapsed time: 00:01:29
channel d3: finished piece 1 at 23-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCQMS_.BKP tag=DAILY_FULL_BACKUP comment=NONE
channel d3: backup set complete, elapsed time: 00:01:28
Finished backup at 23-JUN-18

Starting backup at 23-JUN-18
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
including current control file in backup set
channel d1: starting piece 1 at 23-JUN-18
channel d1: finished piece 1 at 23-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NCNNF_TAG20180623T231301_FLXBGGCC_.BKP tag=TAG20180623T231301 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:03
Finished backup at 23-JUN-18

Starting Control File and SPFILE Autobackup at 23-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979600385_FLXBGLOJ_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 23-JUN-18

sql statement: alter system archive log current

Starting backup at 23-JUN-18
current log archived
channel d1: starting archived log backup set
channel d1: specifying archived log(s) in backup set
input archived log thread=1 sequence=1 RECID=23 STAMP=979600059
channel d1: starting piece 1 at 23-JUN-18
channel d2: starting archived log backup set
channel d2: specifying archived log(s) in backup set
input archived log thread=1 sequence=3 RECID=25 STAMP=979600389
channel d2: starting piece 1 at 23-JUN-18
channel d3: starting archived log backup set
channel d3: specifying archived log(s) in backup set
input archived log thread=1 sequence=2 RECID=24 STAMP=979600060
channel d3: starting piece 1 at 23-JUN-18
channel d4: starting archived log backup set
channel d4: specifying archived log(s) in backup set
input archived log thread=1 sequence=4 RECID=26 STAMP=979600390
channel d4: starting piece 1 at 23-JUN-18
channel d1: finished piece 1 at 23-JUN-18
piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600390_100_1.ARCH tag=TAG20180623T231310 comment=NONE
channel d1: backup set complete, elapsed time: 00:00:03
channel d2: finished piece 1 at 23-JUN-18
piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600390_101_1.ARCH tag=TAG20180623T231310 comment=NONE
channel d2: backup set complete, elapsed time: 00:00:02
channel d3: finished piece 1 at 23-JUN-18
piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600392_102_1.ARCH tag=TAG20180623T231310 comment=NONE
channel d3: backup set complete, elapsed time: 00:00:00
channel d4: finished piece 1 at 23-JUN-18
piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600393_103_1.ARCH tag=TAG20180623T231310 comment=NONE
channel d4: backup set complete, elapsed time: 00:00:01
Finished backup at 23-JUN-18

Starting Control File and SPFILE Autobackup at 23-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979600394_FLXBGVTF_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 23-JUN-18

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           23     23-JUN-18
  Backup Piece       23     23-JUN-18          C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0J4Q_.BKP
Backup Set           26     23-JUN-18
  Backup Piece       26     23-JUN-18          C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0JW1_.BKP
Backup Set           25     23-JUN-18
  Backup Piece       25     23-JUN-18          C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0RGD_.BKP
Backup Set           24     23-JUN-18
  Backup Piece       24     23-JUN-18          C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0SMZ_.BKP
Archive Log          23     23-JUN-18          C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_23\O1_MF_1_1_FLXB4B5O_.ARC
Archive Log          24     23-JUN-18          C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_23\O1_MF_1_2_FLXB4DGL_.ARC
Backup Set           29     23-JUN-18
  Backup Piece       29     23-JUN-18          C:\BACKUPS\TESTDB\ARCH\TESTDB_979600061_89_1.ARCH
Backup Set           39     23-JUN-18
  Backup Piece       39     23-JUN-18          C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NCNNF_TAG20180623T231301_FLXBGGCC_.BKP
Backup Set           41     23-JUN-18
  Backup Piece       41     23-JUN-18          C:\BACKUPS\TESTDB\ARCH\TESTDB_979600390_100_1.ARCH
Backup Set           43     23-JUN-18
  Backup Piece       43     23-JUN-18          C:\BACKUPS\TESTDB\ARCH\TESTDB_979600392_102_1.ARCH
deleted backup piece
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0J4Q_.BKP RECID=23 STAMP=979599936
deleted backup piece
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0JW1_.BKP RECID=26 STAMP=979599936
deleted backup piece
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0RGD_.BKP RECID=25 STAMP=979599939
deleted backup piece
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXB0SMZ_.BKP RECID=24 STAMP=979599945
deleted archived log
archived log file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_23\O1_MF_1_1_FLXB4B5O_.ARC RECID=23 STAMP=979600059
deleted archived log
archived log file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_23\O1_MF_1_2_FLXB4DGL_.ARC RECID=24 STAMP=979600060
deleted backup piece
backup piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600061_89_1.ARCH RECID=29 STAMP=979600064
deleted backup piece
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NCNNF_TAG20180623T231301_FLXBGGCC_.BKP RECID=39 STAMP=979600382
deleted backup piece
backup piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600390_100_1.ARCH RECID=41 STAMP=979600391
deleted backup piece
backup piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600392_102_1.ARCH RECID=43 STAMP=979600393
Deleted 10 objects


crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979573499_FLWJ6DOO_.BKP RECID=10 STAMP=979579523
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979579669_FLWP79OC_.BKP RECID=11 STAMP=979579673
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979580029_FLWPLGGQ_.BKP RECID=20 STAMP=979586478
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979586772_FLWX57NP_.BKP RECID=22 STAMP=979586775
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979600054_FLXB47LV_.BKP RECID=28 STAMP=979600055
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979600082_FLXB53Y6_.BKP RECID=34 STAMP=979600083
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCLFP_.BKP RECID=35 STAMP=979600290
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCRRP_.BKP RECID=36 STAMP=979600295
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCQMS_.BKP RECID=37 STAMP=979600295
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_23\O1_MF_NNNDF_DAILY_FULL_BACKUP_FLXBCMBW_.BKP RECID=38 STAMP=979600291
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979600385_FLXBGLOJ_.BKP RECID=40 STAMP=979600386
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600390_101_1.ARCH RECID=42 STAMP=979600392
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\BACKUPS\TESTDB\ARCH\TESTDB_979600393_103_1.ARCH RECID=44 STAMP=979600393
crosschecked backup piece: found to be 'AVAILABLE'
backup piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_23\O1_MF_S_979600394_FLXBGVTF_.BKP RECID=45 STAMP=979600395
Crosschecked 14 objects


validation succeeded for archived log
archived log file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_23\O1_MF_1_3_FLXBGO7P_.ARC RECID=25 STAMP=979600389
validation succeeded for archived log
archived log file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_23\O1_MF_1_4_FLXBGP1W_.ARC RECID=26 STAMP=979600390
Crosschecked 2 objects


specification does not match any backup in the repository

specification does not match any archived log in the repository
released channel: d1
released channel: d2
released channel: d3
released channel: d4

RMAN>



Резервирование базы данных перед UPGRADE

Microsoft Windows [Version 10.0.17134.112]
(c) 2018 Microsoft Corporation. All rights reserved.

C:\Users\angor>rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Mon Jun 25 12:06:10 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TESTDB (DBID=2762894270)

RMAN> RUN
2> {
3> ALLOCATE CHANNEL d1 TYPE DISK;
4> ALLOCATE CHANNEL d2 TYPE DISK;
5> ALLOCATE CHANNEL d3 TYPE DISK;
6> ALLOCATE CHANNEL d4 TYPE DISK;
7>
8> BACKUP
9>      INCREMENTAL LEVEL 0 AS COMPRESSED BACKUPSET
10> DATABASE
11>      TAG BEFORE_UPGRADE_DB;
12>
13> SQL 'alter system archive log current';
14>
15> BACKUP
16> ARCHIVELOG ALL
17>      TAG BEFORE_UPGRADE_ALOG;
18>
19> BACKUP
20> CURRENT CONTROLFILE
21>      TAG BEFORE_UPGRADE_CTRL;
22> }


using target database control file instead of recovery catalog
allocated channel: d1
channel d1: SID=748 device type=DISK

allocated channel: d2
channel d2: SID=870 device type=DISK

allocated channel: d3
channel d3: SID=7 device type=DISK

allocated channel: d4
channel d4: SID=133 device type=DISK

Starting backup at 25-JUN-18
channel d1: starting compressed incremental level 0 datafile backup set
channel d1: specifying datafile(s) in backup set
input datafile file number=00003 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_UNDOTBS1_FLW93Q12_.DBF
channel d1: starting piece 1 at 25-JUN-18
channel d2: starting compressed incremental level 0 datafile backup set
channel d2: specifying datafile(s) in backup set
input datafile file number=00001 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_SYSTEM_FLW91VTY_.DBF
channel d2: starting piece 1 at 25-JUN-18
channel d3: starting compressed incremental level 0 datafile backup set
channel d3: specifying datafile(s) in backup set
input datafile file number=00002 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_SYSAUX_FLW931TG_.DBF
channel d3: starting piece 1 at 25-JUN-18
channel d4: starting compressed incremental level 0 datafile backup set
channel d4: specifying datafile(s) in backup set
input datafile file number=00004 name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_USERS_FLW94PXT_.DBF
channel d4: starting piece 1 at 25-JUN-18
channel d1: finished piece 1 at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D59MO_.BKP tag=BEFORE_UPGRADE_DB comment=NONE
channel d1: backup set complete, elapsed time: 00:00:10
channel d4: finished piece 1 at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5F1X_.BKP tag=BEFORE_UPGRADE_DB comment=NONE
channel d4: backup set complete, elapsed time: 00:00:24
channel d2: finished piece 1 at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5BL9_.BKP tag=BEFORE_UPGRADE_DB comment=NONE
channel d2: backup set complete, elapsed time: 00:00:56
channel d3: finished piece 1 at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5CLT_.BKP tag=BEFORE_UPGRADE_DB comment=NONE
channel d3: backup set complete, elapsed time: 00:00:56
Finished backup at 25-JUN-18

Starting Control File and SPFILE Autobackup at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_25\O1_MF_S_979733266_FM1D73MS_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 25-JUN-18

sql statement: alter system archive log current

Starting backup at 25-JUN-18
current log archived
channel d1: starting archived log backup set
channel d1: specifying archived log(s) in backup set
input archived log thread=1 sequence=8 RECID=30 STAMP=979733281
channel d1: starting piece 1 at 25-JUN-18
channel d2: starting archived log backup set
channel d2: specifying archived log(s) in backup set
input archived log thread=1 sequence=9 RECID=31 STAMP=979733281
channel d2: starting piece 1 at 25-JUN-18
channel d1: finished piece 1 at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_ANNNN_BEFORE_UPGRADE_ALOG_FM1D7LDQ_.BKP tag=BEFORE_UPGRADE_ALOG comment=NONE
channel d1: backup set complete, elapsed time: 00:00:10
channel d2: finished piece 1 at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_ANNNN_BEFORE_UPGRADE_ALOG_FM1D7PM6_.BKP tag=BEFORE_UPGRADE_ALOG comment=NONE
channel d2: backup set complete, elapsed time: 00:00:07
Finished backup at 25-JUN-18

Starting backup at 25-JUN-18
channel d1: starting full datafile backup set
channel d1: specifying datafile(s) in backup set
including current control file in backup set
channel d1: starting piece 1 at 25-JUN-18
channel d1: finished piece 1 at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1D7ZG4_.BKP tag=BEFORE_UPGRADE_CTRL comment=NONE
channel d1: backup set complete, elapsed time: 00:00:01
Finished backup at 25-JUN-18

Starting Control File and SPFILE Autobackup at 25-JUN-18
piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_25\O1_MF_S_979733296_FM1D81TH_.BKP comment=NONE
Finished Control File and SPFILE Autobackup at 25-JUN-18
released channel: d1
released channel: d2
released channel: d3
released channel: d4

 
RMAN> list backup summary tag=BEFORE_UPGRADE_DB;

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
72      B  0  A DISK        25-JUN-18       1       1       YES        BEFORE_UPGRADE_DB
73      B  0  A DISK        25-JUN-18       1       1       YES        BEFORE_UPGRADE_DB
74      B  0  A DISK        25-JUN-18       1       1       YES        BEFORE_UPGRADE_DB
75      B  0  A DISK        25-JUN-18       1       1       YES        BEFORE_UPGRADE_DB

 
RMAN> list backup summary tag=BEFORE_UPGRADE_ALOG;

List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
77      B  A  A DISK        25-JUN-18       1       1       NO         BEFORE_UPGRADE_ALOG
78      B  A  A DISK        25-JUN-18       1       1       NO         BEFORE_UPGRADE_ALOG

 
RMAN> list backup summary tag=BEFORE_UPGRADE_CTRL;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
70      B  F  A DISK        25-JUN-18       1       1       NO         BEFORE_UPGRADE_CTRL
71      B  F  A DISK        25-JUN-18       1       1       NO         BEFORE_UPGRADE_CTRL
79      B  F  A DISK        25-JUN-18       1       1       NO         BEFORE_UPGRADE_CTRL


Содержимое зарегистрированного “бакапа” в контрольном файле:

RMAN> list backupset tag=BEFORE_UPGRADE_CTRL;
List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
70      Full    10.31M     DISK        00:00:04     25-JUN-18
        BP Key: 70   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE_CTRL
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1CNQ5Z_.BKP
  Control File Included: Ckp SCN: 948823       Ckp time: 25-JUN-18

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
71      Full    10.31M     DISK        00:00:04     25-JUN-18
        BP Key: 71   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE_CTRL
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1CPQL0_.BKP
  Control File Included: Ckp SCN: 948859       Ckp time: 25-JUN-18

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
79      Full    10.31M     DISK        00:00:02     25-JUN-18
        BP Key: 79   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE_CTRL
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1D7ZG4_.BKP
  Control File Included: Ckp SCN: 949494       Ckp time: 25-JUN-18

RMAN>

Находим имя зарезервированного CONTROLFILE:

RMAN> LIST BACKUP OF CONTROLFILE;

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
70      Full    10.31M     DISK        00:00:04     25-JUN-18
        BP Key: 70   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE_CTRL
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1CNQ5Z_.BKP
  Control File Included: Ckp SCN: 948823       Ckp time: 25-JUN-18

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
71      Full    10.31M     DISK        00:00:04     25-JUN-18
        BP Key: 71   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE_CTRL
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1CPQL0_.BKP
  Control File Included: Ckp SCN: 948859       Ckp time: 25-JUN-18

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
76      Full    10.34M     DISK        00:00:02     25-JUN-18
        BP Key: 76   Status: AVAILABLE  Compressed: NO  Tag: TAG20180625T120746
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_25\O1_MF_S_979733266_FM1D73MS_.BKP
  Control File Included: Ckp SCN: 949440       Ckp time: 25-JUN-18

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
79      Full    10.31M     DISK        00:00:02     25-JUN-18
        BP Key: 79   Status: AVAILABLE  Compressed: NO  Tag: BEFORE_UPGRADE_CTRL
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1D7ZG4_.BKP
  Control File Included: Ckp SCN: 949494       Ckp time: 25-JUN-18

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
80      Full    10.34M     DISK        00:00:02     25-JUN-18
        BP Key: 80   Status: AVAILABLE  Compressed: NO  Tag: TAG20180625T120816
        Piece Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_25\O1_MF_S_979733296_FM1D81TH_.BKP
  Control File Included: Ckp SCN: 949500       Ckp time: 25-JUN-18

RMAN>

RMAN> SHUTDOWN IMMEDIATE;

database closed
database dismounted
Oracle instance shut down

RMAN>exit;

==========
Установка обновлений
==========


Откат изменений с использованием hot backup (RMAN)


 C:\Users\angor>rman target=/ nocatalog

Recovery Manager: Release 12.2.0.1.0 - Production on Mon Jun 25 12:26:01 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database (not started)

RMAN> STARTUP NOMOUNT;
Oracle instance started

Total System Global Area    7734296576 bytes

Fixed Size                     8764936 bytes
Variable Size               1543504376 bytes
Database Buffers            6174015488 bytes
Redo Buffers                   8011776 bytes

RMAN> RESTORE CONTROLFILE FROM  'C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1D7ZG4_.BKP';
Starting restore at 25-JUN-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=251 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
output file name=C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\CONTROLFILE\O1_MF_FLW90GMT_.CTL
output file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\CONTROLFILE\O1_MF_FLW90GWM_.CTL
Finished restore at 25-JUN-18

RMAN> ALTER DATABASE MOUNT;
Statement processed
released channel: ORA_DISK_1

RMAN> RESTORE DATABASE FORCE FROM tag=BEFORE_UPGRADE_DB;

Starting restore at 25-JUN-18
Starting implicit crosscheck backup at 25-JUN-18
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=5 device type=DISK
Crosschecked 9 objects
Finished implicit crosscheck backup at 25-JUN-18

Starting implicit crosscheck copy at 25-JUN-18
using channel ORA_DISK_1
Finished implicit crosscheck copy at 25-JUN-18

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\AUTOBACKUP\2018_06_25\O1_MF_S_979733296_FM1D81TH_.BKP
File Name: C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NCNNF_BEFORE_UPGRADE_CTRL_FM1D7ZG4_.BKP

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00003 to C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_UNDOTBS1_FLW93Q12_.DBF
channel ORA_DISK_1: reading from backup piece C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D59MO_.BKP
channel ORA_DISK_1: piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D59MO_.BKP tag=BEFORE_UPGRADE_DB
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00004 to C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_USERS_FLW94PXT_.DBF
channel ORA_DISK_1: reading from backup piece C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5F1X_.BKP
channel ORA_DISK_1: piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5F1X_.BKP tag=BEFORE_UPGRADE_DB
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_SYSTEM_FLW91VTY_.DBF
channel ORA_DISK_1: reading from backup piece C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5BL9_.BKP
channel ORA_DISK_1: piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5BL9_.BKP tag=BEFORE_UPGRADE_DB
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00002 to C:\APP\ORACLE\ORADATA\TESTDB_OMEGA\DATAFILE\O1_MF_SYSAUX_FLW931TG_.DBF
channel ORA_DISK_1: reading from backup piece C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5CLT_.BKP
channel ORA_DISK_1: piece handle=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\BACKUPSET\2018_06_25\O1_MF_NNND0_BEFORE_UPGRADE_DB_FM1D5CLT_.BKP tag=BEFORE_UPGRADE_DB
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 25-JUN-18

RMAN> RECOVER DATABASE;

Starting recover at 25-JUN-18
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_25\O1_MF_1_8_FM1D778O_.ARC
archived log for thread 1 with sequence 9 is already on disk as file C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_25\O1_MF_1_9_FM1D7KM6_.ARC
archived log for thread 1 with sequence 10 is already on disk as file C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ONLINELOG\O1_MF_1_FLW90QW4_.LOG
archived log file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_25\O1_MF_1_8_FM1D778O_.ARC thread=1 sequence=8
archived log file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ARCHIVELOG\2018_06_25\O1_MF_1_9_FM1D7KM6_.ARC thread=1 sequence=9
archived log file name=C:\APP\ORACLE\FAST_RECOVERY_AREA\TESTDB_OMEGA\TESTDB_OMEGA\ONLINELOG\O1_MF_1_FLW90QW4_.LOG thread=1 sequence=10
media recovery complete, elapsed time: 00:00:03
Finished recover at 25-JUN-18

RMAN> ALTER DATABASE OPEN RESETLOGS;
Statement processed

RMAN>

RMAN> select instance_name, status from v$instance;
INSTANCE_NAME    STATUS
---------------- ------------
testdb           OPEN

RMAN> 

Определим на какое время восстановлена БД:

RMAN> SELECT SCN_TO_TIMESTAMP(RESETLOGS_CHANGE#)
2>                FROM (SELECT RESETLOGS_CHANGE#
3>                      FROM V$DATABASE_INCARNATION
4>                      WHERE STATUS='CURRENT');


SCN_TO_TIMESTAMP(RESETLOGS_CHAN
-------------------------------
25-JUN-18 12.23.02.000000000 PM

RMAN>




Комментариев нет:

Отправить комментарий