Öncelikle nasıl ve hangi detayda backup alabiliyoruz, container ve pluggable database’ lerin backuplarını ayrı ayrı veya tek bir scriptte alabiliyormuyuz ona bakalım.
Konunun daha iyi anlaşılabilmesi için aşağıdaki senaryolar yardımıyla anlatmayı planlıyorum. Sık karşılaşılabilecek senaryoları eklemeye çalıştım;
• Full database backup
• Full pluggable database backup (veya tüm pluggable db’ lerin full backupını almak);
• Root database’ inin backupı
• Sadece archivelogların backupını almak için
• Bir pluggable database’ e ait olan tablespace’ in backupı ;
• Pluggable database’ e ait olan bir tablespace’ e ait datafile’ in backupını almak
Öncelikle container database’ imiz içinde hangi plugabble database’ lerimiz var ona bakalım ;
1 2 3 4 5 6 7 |
SQL> select name from v$pdbs; NAME ------------------------------ PDB$SEED PLUG1_DB T1_PLUG2_DB T1_PLUG3_DB |
Full backup aldığımız da container db + bu 3 pluggable database’ in backupının alınıyor olması gerekiyor.
• Full database backup ;
Full database backup ile kastedilen database içerisinde yer alan tüm bileşenlerin tek bir script ile backupının alınması demek aslında, en sık kullanaılacak olan backup alma opsiyonuda bu olacaktır diye düşünüyorum.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
[oracle@ rman]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Mon Aug 24 22:11:10 2015 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: T1 (DBID=2690208568) RMAN> run 2> { 3> allocate channel disk1 device type disk format '/u03/rman/%U'; BACKUP DATABASE PLUS ARCHIVELOG; release channel disk1; }4> 5> 6> released channel: ORA_DISK_1 allocated channel: disk1 channel disk1: SID=8 device type=DISK Starting backup at 24-AUG-15 current log archived channel disk1: starting archived log backup set channel disk1: specifying archived log(s) in backup set input archived log thread=1 sequence=12466 RECID=12521 STAMP=888618768 input archived log thread=1 sequence=12467 RECID=12522 STAMP=888618777 input archived log thread=1 sequence=12468 RECID=12523 STAMP=888618784 channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/bmqfefp0_1_1 tag=TAG20150824T223304 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting backup at 24-AUG-15 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00003 name=/oradata/oracle/torcl/dbf/t1/sysaux01.dbf input datafile file number=00001 name=/oradata/oracle/torcl/dbf/t1/system01.dbf input datafile file number=00004 name=/oradata/oracle/torcl/dbf/t1/undotbs01.dbf input datafile file number=00006 name=/oradata/oracle/torcl/dbf/t1/users01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/bnqfefp1_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:15 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00042 name=/oradata/oracle/torcl/dbf/t1/t1_plug1_db/sysaux01.dbf input datafile file number=00041 name=/oradata/oracle/torcl/dbf/t1/t1_plug1_db/system01.dbf input datafile file number=00048 name=/oradata/oracle/torcl/dbf/plug1_db/data1.dbf input datafile file number=00049 name=/oradata/oracle/torcl/dbf/plug1_db/data2_01.dbf input datafile file number=00050 name=/oradata/oracle/torcl/dbf/plug1_db/index_01.dbf input datafile file number=00043 name=/oradata/oracle/torcl/dbf/t1/t1_plug1_db/t1_plug1_db_users01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/boqfefpg_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:15 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00045 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB237100E053B0060892FC59/datafile/o1_mf_sysaux_bx6479tn_.dbf input datafile file number=00054 name=/oradata/oracle/torcl/dbf/t1_plug2_db/data1_01.dbf input datafile file number=00055 name=/oradata/oracle/torcl/dbf/t1_plug2_db/data2_01.dbf input datafile file number=00056 name=/oradata/oracle/torcl/dbf/t1_plug2_db/data3_01.dbf input datafile file number=00057 name=/oradata/oracle/torcl/dbf/t1_plug2_db/index1_01.dbf input datafile file number=00058 name=/oradata/oracle/torcl/dbf/t1_plug2_db/index2_01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/bpqfefq0_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:03 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00007 name=/oradata/oracle/torcl/dbf/t1/pdbseed/sysaux01.dbf input datafile file number=00005 name=/oradata/oracle/torcl/dbf/t1/pdbseed/system01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/bqqfefq3_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:07 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00047 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB247100E053B0060892FC59/datafile/o1_mf_sysaux_bx649ppp_.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/brqfefqa_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:07 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00044 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB237100E053B0060892FC59/datafile/o1_mf_system_bx6479tl_.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/bsqfefqh_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:07 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00046 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB247100E053B0060892FC59/datafile/o1_mf_system_bx649ppn_.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/btqfefqo_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:07 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00051 name=/oradata/oracle/torcl/dbf/t1_plug3_db/data1_01.dbf input datafile file number=00052 name=/oradata/oracle/torcl/dbf/t1_plug3_db/data2_01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/buqfefqv_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00053 name=/oradata/oracle/torcl/dbf/t1_plug3_db/index1_01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/bvqfefr0_1_1 tag=TAG20150824T223305 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting backup at 24-AUG-15 current log archived channel disk1: starting archived log backup set channel disk1: specifying archived log(s) in backup set input archived log thread=1 sequence=12469 RECID=12524 STAMP=888618849 channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c0qfefr1_1_1 tag=TAG20150824T223409 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:02 Finished backup at 24-AUG-15 Starting Control File and SPFILE Autobackup at 24-AUG-15 Piece handle=/u01/sq/ora_3/oracle/fast_recovery_area/T1/autobackup/2015_08_24/o1_mf_s_888618851_bxpwfmdz_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 24-AUG-15 released channel: disk1 RMAN> |
Container içerisinde yer alan tüm instance’ ların backupını almış olduk.
• Full pluggable database backup (veya tüm pluggable db’ lerin full backupını almak);
Bizim test database’ imiz de yer alan 3 tane pluggable database’ imiz var. Sadece bu 3 pluggable database’ in backupını alalım ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
RMAN> run 2> { 3> allocate channel disk1 device type disk format '/u03/rman/%U'; BACKUP PLUGGABLE DATABASE PLUG1_DB, T1_PLUG2_DB, T1_PLUG3_DB PLUS ARCHIVELOG; release channel disk1; 4> 5> 6> } allocated channel: disk1 channel disk1: SID=8 device type=DISK Starting backup at 24-AUG-15 current log archived channel disk1: starting archived log backup set channel disk1: specifying archived log(s) in backup set input archived log thread=1 sequence=12466 RECID=12521 STAMP=888618768 input archived log thread=1 sequence=12467 RECID=12522 STAMP=888618777 input archived log thread=1 sequence=12468 RECID=12523 STAMP=888618784 input archived log thread=1 sequence=12469 RECID=12524 STAMP=888618849 input archived log thread=1 sequence=12470 RECID=12525 STAMP=888619054 channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c2qfeg1e_1_1 tag=TAG20150824T223734 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting backup at 24-AUG-15 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00042 name=/oradata/oracle/torcl/dbf/t1/t1_plug1_db/sysaux01.dbf input datafile file number=00041 name=/oradata/oracle/torcl/dbf/t1/t1_plug1_db/system01.dbf input datafile file number=00048 name=/oradata/oracle/torcl/dbf/plug1_db/data1.dbf input datafile file number=00049 name=/oradata/oracle/torcl/dbf/plug1_db/data2_01.dbf input datafile file number=00050 name=/oradata/oracle/torcl/dbf/plug1_db/index_01.dbf input datafile file number=00043 name=/oradata/oracle/torcl/dbf/t1/t1_plug1_db/t1_plug1_db_users01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c3qfeg1f_1_1 tag=TAG20150824T223735 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:07 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00045 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB237100E053B0060892FC59/datafile/o1_mf_sysaux_bx6479tn_.dbf input datafile file number=00054 name=/oradata/oracle/torcl/dbf/t1_plug2_db/data1_01.dbf input datafile file number=00055 name=/oradata/oracle/torcl/dbf/t1_plug2_db/data2_01.dbf input datafile file number=00056 name=/oradata/oracle/torcl/dbf/t1_plug2_db/data3_01.dbf input datafile file number=00057 name=/oradata/oracle/torcl/dbf/t1_plug2_db/index1_01.dbf input datafile file number=00058 name=/oradata/oracle/torcl/dbf/t1_plug2_db/index2_01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c4qfeg1m_1_1 tag=TAG20150824T223735 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:03 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00047 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB247100E053B0060892FC59/datafile/o1_mf_sysaux_bx649ppp_.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c5qfeg1p_1_1 tag=TAG20150824T223735 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:03 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00044 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB237100E053B0060892FC59/datafile/o1_mf_system_bx6479tl_.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c6qfeg1s_1_1 tag=TAG20150824T223735 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00046 name=/u03/oradata/t1/pdbt13/T1/1D94DCCFBB247100E053B0060892FC59/datafile/o1_mf_system_bx649ppn_.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c7qfeg1u_1_1 tag=TAG20150824T223735 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00051 name=/oradata/oracle/torcl/dbf/t1_plug3_db/data1_01.dbf input datafile file number=00052 name=/oradata/oracle/torcl/dbf/t1_plug3_db/data2_01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c8qfeg1v_1_1 tag=TAG20150824T223735 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00053 name=/oradata/oracle/torcl/dbf/t1_plug3_db/index1_01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/c9qfeg20_1_1 tag=TAG20150824T223735 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting backup at 24-AUG-15 current log archived channel disk1: starting archived log backup set channel disk1: specifying archived log(s) in backup set input archived log thread=1 sequence=12471 RECID=12526 STAMP=888619074 channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/caqfeg23_1_1 tag=TAG20150824T223754 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting Control File and SPFILE Autobackup at 24-AUG-15 piece handle=/u01/sq/ora_3/oracle/fast_recovery_area/T1/autobackup/2015_08_24/o1_mf_s_888619076_bxpwnngv_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 24-AUG-15 released channel: disk1 RMAN> |
• Root database’ inin backupı ;
Pluggable db’ lerin backupını aldırmadan sadece root database’ in backupını almak istersek ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
RMAN> run 2> { 3> allocate channel disk1 device type disk format '/u03/rman/%U'; BACKUP DATABASE ROOT PLUS ARCHIVELOG; 4> 5> release channel disk1; }6> using target database control file instead of recovery catalog allocated channel: disk1 channel disk1: SID=10 device type=DISK Starting backup at 24-AUG-15 current log archived channel disk1: starting archived log backup set channel disk1: specifying archived log(s) in backup set input archived log thread=1 sequence=12466 RECID=12521 STAMP=888618768 input archived log thread=1 sequence=12467 RECID=12522 STAMP=888618777 input archived log thread=1 sequence=12468 RECID=12523 STAMP=888618784 input archived log thread=1 sequence=12469 RECID=12524 STAMP=888618849 input archived log thread=1 sequence=12470 RECID=12525 STAMP=888619054 input archived log thread=1 sequence=12471 RECID=12526 STAMP=888619074 input archived log thread=1 sequence=12472 RECID=12527 STAMP=888619372 channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/ccqfegbc_1_1 tag=TAG20150824T224252 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting backup at 24-AUG-15 channel disk1: starting full datafile backup set channel disk1: specifying datafile(s) in backup set input datafile file number=00003 name=/oradata/oracle/torcl/dbf/t1/sysaux01.dbf input datafile file number=00001 name=/oradata/oracle/torcl/dbf/t1/system01.dbf input datafile file number=00004 name=/oradata/oracle/torcl/dbf/t1/undotbs01.dbf input datafile file number=00006 name=/oradata/oracle/torcl/dbf/t1/users01.dbf channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/cdqfegbe_1_1 tag=TAG20150824T224254 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:15 Finished backup at 24-AUG-15 Starting backup at 24-AUG-15 current log archived channel disk1: starting archived log backup set channel disk1: specifying archived log(s) in backup set input archived log thread=1 sequence=12473 RECID=12528 STAMP=888619389 channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/ceqfegbt_1_1 tag=TAG20150824T224309 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting Control File and SPFILE Autobackup at 24-AUG-15 piece handle=/u01/sq/ora_3/oracle/fast_recovery_area/T1/autobackup/2015_08_24/o1_mf_s_888619390_bxpwygsx_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 24-AUG-15 released channel: disk1 RMAN> |
• Sadece Archivelogların backupını almak için ;
Database’ deki sadece archivelogların backupını almak istersek ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
[oracle@ admin]$ rman target / Recovery Manager: Release 12.1.0.2.0 - Production on Tue Sep 1 14:20:28 2015 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: T1 (DBID=2690208568) RMAN> run 2> { 3> allocate channel disk1 device type disk format '/u03/rman/%U'; BACKUP ARCHIVELOG ALL; release channel disk1; }4> 5> 6> allocated channel: disk1 channel disk1: SID=10 device type=DISK Starting backup at 24-AUG-15 current log archived channel disk1: starting archived log backup set channel disk1: specifying archived log(s) in backup set input archived log thread=1 sequence=12466 RECID=12521 STAMP=888618768 channel disk1: starting piece 1 at 24-AUG-15 channel disk1: finished piece 1 at 24-AUG-15 piece handle=/u03/rman/cgqfegdn_1_1 tag=TAG20150824T224407 comment=NONE channel disk1: backup set complete, elapsed time: 00:00:01 Finished backup at 24-AUG-15 Starting Control File and SPFILE Autobackup at 24-AUG-15 piece handle=/u01/sq/ora_3/oracle/fast_recovery_area/T1/autobackup/2015_08_24/o1_mf_s_888619448_bxpx08l3_.bkp comment=NONE Finished Control File and SPFILE Autobackup at 24-AUG-15 released channel: disk1 |
• Bir pluggable database’ e ait olan tablespace’ in backupı ;
PLUG1_DB database’ indeki data1 tablespace’ inin backupını almaya çalışalım ;
Öncelikle burada yapılması muhtemel bir hatadan bahsedelim. Rman’ e aşağıdaki gibi bağlanırsanız container db’ in rman’ nine bağlanmış olursunuz, dolayısıyla burda çalıştırdığınız tüm komutlarda container db seviyesinde çalışacaktır. Örneğin aşağıdaki komut container db’ nin tablespace’ i olan USERS tbs’ inin backupını alır.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
RMAN> run 2> { 3> backup tablespace USERS ; 4> } Starting backup at 01-SEP-15 using channel ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: starting full datafile backup set channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set input datafile file number=00006 name=/oradata/oracle/torcl/dbf/t1/users01.dbf channel ORA_SBT_TAPE_1: starting piece 1 at 01-SEP-15 channel ORA_SBT_TAPE_1: finished piece 1 at 01-SEP-15 piece handle=qnqg28hb_1_1 tag=TAG20150901T103211 comment=API Version 2.0,MMS Version 5.0.0.0 channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:15 Finished backup at 01-SEP-15 Starting Control File and SPFILE Autobackup at 01-SEP-15 piece handle=c-2690208568-20150901-03 comment=API Version 2.0,MMS Version 5.0.0.0 Finished Control File and SPFILE Autobackup at 01-SEP-15 RMAN> |
Bu ekrandan bir pluggable database’ e ait bir tablespace’ in backupını almaya çalışırsanız ;
RMAN> run
2> {
3> backup tablespace DATA1 ;
4> }
Starting backup at 01-SEP-15
using target database control file instead of recovery catalog
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=364 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle – Release 7.5 (2013061020)
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of backup command at 09/01/2015 10:31:34
RMAN-20202: Tablespace not found in the recovery catalog
RMAN-06019: could not translate tablespace name “DATA1”
RMAN>
hatasını alırsınız. Pluggable database’ e ait bir tbs’ in backupını almak içinse rman’ e aşağıdaki şekilde bağlanmak gerekiyor ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
[oracle@ admin]$ rman target=sys/password1@PLUG1_DB Recovery Manager: Release 12.1.0.2.0 - Production on Tue Sep 1 11:04:15 2015 Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved. connected to target database: T1 (DBID=2690208568) RMAN> run 2> { 3> backup tablespace DATA1 ; 4> } Starting backup at 01-SEP-15 using target database control file instead of recovery catalog allocated channel: ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: SID=14 device type=SBT_TAPE channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle - Release 7.5 (2013061020) channel ORA_SBT_TAPE_1: starting full datafile backup set channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set input datafile file number=00048 name=/oradata/oracle/torcl/dbf/plug1_db/data1.dbf channel ORA_SBT_TAPE_1: starting piece 1 at 01-SEP-15 channel ORA_SBT_TAPE_1: finished piece 1 at 01-SEP-15 piece handle=qpqg2aeq_1_1 tag=TAG20150901T110458 comment=API Version 2.0,MMS Version 5.0.0.0 channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25 Finished backup at 01-SEP-15 Starting Control File and SPFILE Autobackup at 01-SEP-15 piece handle=c-2690208568-20150901-04 comment=API Version 2.0,MMS Version 5.0.0.0 Finished Control File and SPFILE Autobackup at 01-SEP-15 RMAN> |
• Pluggable database’ e ait olan bir tablespace’ e ait datafile’ in backupını almak
Burdaki durumun aynısı, tablespace ‘ in backupını alırkenki durum ile aynı aslında, rman’ e connect olurken yine hangi pluggable database’ e connect olacağımızı belirtmemiz gerekiyor.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
RMAN> run 2> { 3> backup datafile '/oradata/oracle/torcl/dbf/plug1_db/data2_01.dbf'; 4> } Starting backup at 01-SEP-15 using target database control file instead of recovery catalog allocated channel: ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: SID=260 device type=SBT_TAPE channel ORA_SBT_TAPE_1: Veritas NetBackup for Oracle - Release 7.5 (2013061020) channel ORA_SBT_TAPE_1: starting full datafile backup set channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set input datafile file number=00049 name=/oradata/oracle/torcl/dbf/plug1_db/data2_01.dbf channel ORA_SBT_TAPE_1: starting piece 1 at 01-SEP-15 channel ORA_SBT_TAPE_1: finished piece 1 at 01-SEP-15 piece handle=qrqg2khg_1_1 tag=TAG20150901T135704 comment=API Version 2.0,MMS Version 5.0.0.0 channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25 Finished backup at 01-SEP-15 Starting Control File and SPFILE Autobackup at 01-SEP-15 piece handle=c-2690208568-20150901-05 comment=API Version 2.0,MMS Version 5.0.0.0 Finished Control File and SPFILE Autobackup at 01-SEP-15 RMAN> |
Aynı backupı datafile numarasını vererek de alabiliriz ;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
RMAN> run 2> { 3> backup datafile 49; 4> } Starting backup at 01-SEP-15 using channel ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: starting full datafile backup set channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set input datafile file number=00049 name=/oradata/oracle/torcl/dbf/plug1_db/data2_01.dbf channel ORA_SBT_TAPE_1: starting piece 1 at 01-SEP-15 channel ORA_SBT_TAPE_1: finished piece 1 at 01-SEP-15 piece handle=qtqg2kqm_1_1 tag=TAG20150901T140158 comment=API Version 2.0,MMS Version 5.0.0.0 channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:25 Finished backup at 01-SEP-15 Starting Control File and SPFILE Autobackup at 01-SEP-15 piece handle=c-2690208568-20150901-06 comment=API Version 2.0,MMS Version 5.0.0.0 Finished Control File and SPFILE Autobackup at 01-SEP-15 RMAN> |
Tablo seviyesinde nasıl backup alabileceğimiz den ve yine tablo bazında nasıl restore edebileceğimiz den aşağıdaki yazımda bahsetmiştim ;
http://www.kamilturkyilmaz.com/2015/07/20/oracle-12c-new-features-tablo-bazinda-recover-islemi/
Yine almış olduğumuz bu backupları nasıl restore edebileceğimiz ile ilgili örneklere de aşağıdaki yazımda anlatmaya çalışmıştım;
http://www.kamilturkyilmaz.com/2016/03/07/oracle-12c-container-database-restore-recover-islemleri/