12c New Features : Pluggable Database Restore – Recover

Aslında bu yazıyıda bir anlamda new features olarak düşünebiliriz. Sonuçda container database 12c ile birlikte geldi. 12c öncesindeki versiyonlarda standalone database yapısı olduğundan her bir database için ayrı bir backup alır ve o backup’ ı kullanarakda yine o database için restore işlemlerimizi yapıyoruz. 12c ile bilirkte yapı RMAN tarafında biraz değişti. Örneğin bir container database’ iniz ve altında bir sürü pluggable database’leriniz olduğunu düşünürsek burda sadece container database’ in backupını alıp sonrasında bu backup içerisinden istenilen pluggable database’ i restore edebilirsiniz. Yani sizin bir container db altında 10 tane ppluggable db’ iniz varsa her biri için ayrıca backup almanız gerekmiyor. İsterseniz tabi ayrı ayrı da alabilirisiniz.

Container database’ in backupı alındığında burada kullanılan pluggable database’ lerden bir tanesini nasıl restore edebiliriz ona bakalım ;

Spfile ve controlfile container bazında olduğu için onları sonrasında anlatıyor oluruz. Şimdi databafile’ lerden başlayarak testimizi yapmaya çalışalım ;

Restore testi yapacağımız database’ i mount moda alıyoruz;

SQL> alter session set container=pdbt11;
Session altered.

SQL> shu immediate
Pluggable Database closed.

SQL> select name,dbid,open_mode from v$pdbs where name =’PDBT11′;
NAME DBID OPEN_MODE
—————————— ———- ———-
PDBT11 87534229 MOUNTED

Restore sonrasında da recover edelim ;

[oracle@Redhat70 rman]$ rman target /
Recovery Manager: Release 12.1.0.2.0 – Production on Fri Jun 5 16:51:31 2015
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
connected to target database: T1 (DBID=2690208568)
RMAN> RUN
{
ALLOCATE CHANNEL ch00 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
ALLOCATE CHANNEL ch01 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
ALLOCATE CHANNEL ch02 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
ALLOCATE CHANNEL ch03 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
ALLOCATE CHANNEL ch04 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
ALLOCATE CHANNEL ch05 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
ALLOCATE CHANNEL ch06 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
RESTORE PLUGGABLE DATABASE PDBT11;
RECOVER PLUGGABLE DATABASE PDBT11;
}

RMAN> RUN
2> {
3> ALLOCATE CHANNEL ch00 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
4> ALLOCATE CHANNEL ch01 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
5> ALLOCATE CHANNEL ch02 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
6> ALLOCATE CHANNEL ch03 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
7> ALLOCATE CHANNEL ch04 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
8> ALLOCATE CHANNEL ch05 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
9> ALLOCATE CHANNEL ch06 DEVICE TYPE sbt_tape PARMS=’ENV=(SBT_LIBRARY=/u01/app/oracle/db/12cR1/lib/libobk.so,NB_ORA_CLIENT=Redhat70, NB_ORA_SERV=veritas))’;
10> RESTORE PLUGGABLE DATABASE PDBT11 ;
11> RECOVER PLUGGABLE DATABASE PDBT11;
12> }

using target database control file instead of recovery catalog
allocated channel: ch00
channel ch00: SID=378 device type=SBT_TAPE
channel ch00: Veritas NetBackup for Oracle – Release 7.5 (2013061020)

allocated channel: ch01
channel ch01: SID=24 device type=SBT_TAPE
channel ch01: Veritas NetBackup for Oracle – Release 7.5 (2013061020)

allocated channel: ch02
channel ch02: SID=141 device type=SBT_TAPE
channel ch02: Veritas NetBackup for Oracle – Release 7.5 (2013061020)

allocated channel: ch03
channel ch03: SID=254 device type=SBT_TAPE
channel ch03: Veritas NetBackup for Oracle – Release 7.5 (2013061020)

allocated channel: ch04
channel ch04: SID=366 device type=SBT_TAPE
channel ch04: Veritas NetBackup for Oracle – Release 7.5 (2013061020)

allocated channel: ch05
channel ch05: SID=20 device type=SBT_TAPE
channel ch05: Veritas NetBackup for Oracle – Release 7.5 (2013061020)

allocated channel: ch06
channel ch06: SID=133 device type=SBT_TAPE
channel ch06: Veritas NetBackup for Oracle – Release 7.5 (2013061020)

Starting restore at 05-JUN-15

channel ch00: starting datafile backup set restore
channel ch00: specifying datafile(s) to restore from backup set
channel ch00: restoring datafile 00010 to /u02/oradata/t1/dbf/t1/pdbt11/pdbt11_users01.dbf
channel ch00: restoring datafile 00018 to /u02/oradata/t1/dbf/t1/pdbt11/pdbt11_index_02.dbf
channel ch00: reading from backup piece bk_475_1_881575292
channel ch01: starting datafile backup set restore
channel ch01: specifying datafile(s) to restore from backup set
channel ch01: restoring datafile 00009 to /u02/oradata/t1/dbf/t1/pdbt11/sysaux01.dbf
channel ch01: restoring datafile 00017 to /u02/oradata/t1/dbf/t1/pdbt11/pdbt11_data_01.dbf
channel ch01: reading from backup piece bk_474_1_881575292
channel ch02: starting datafile backup set restore
channel ch02: specifying datafile(s) to restore from backup set
channel ch02: restoring datafile 00008 to /u02/oradata/t1/dbf/t1/pdbt11/system01.dbf
channel ch02: restoring datafile 00023 to /u02/oradata/t1/dbf/t1/pdbt11/compressed.dbf
channel ch02: reading from backup piece bk_473_1_881575291
channel ch03: starting datafile backup set restore
channel ch03: specifying datafile(s) to restore from backup set
channel ch03: restoring datafile 00016 to /u02/oradata/t1/dbf/t1/pdbt11/pdbt11_data_02.dbf
channel ch03: restoring datafile 00019 to /u02/oradata/t1/dbf/t1/pdbt11/pdbt11_index_01.dbf
channel ch03: reading from backup piece bk_472_1_881575291
channel ch04: starting datafile backup set restore
channel ch04: specifying datafile(s) to restore from backup set
channel ch04: restoring datafile 00020 to /u02/oradata/t1/dbf/t1/pdbt11/pdbt11_data2_02.dbf
channel ch04: restoring datafile 00024 to /u02/oradata/t1/dbf/t1/pdbt11/compall.dbf
channel ch04: reading from backup piece bk_469_1_881575291
channel ch05: starting datafile backup set restore
channel ch05: specifying datafile(s) to restore from backup set
channel ch05: restoring datafile 00021 to /u02/oradata/t1/dbf/t1/pdbt11/pdbt11_data2_01.dbf
channel ch05: restoring datafile 00025 to /u02/oradata/t1/dbf/t1/pdbt11/compdir.dbf
channel ch05: reading from backup piece bk_470_1_881575291
channel ch00: piece handle=bk_475_1_881575292 tag=T1_TEST_20150605
channel ch00: restored backup piece 1
channel ch00: restore complete, elapsed time: 00:00:35
channel ch03: piece handle=bk_472_1_881575291 tag=T1_TEST_20150605
channel ch03: restored backup piece 1
channel ch03: restore complete, elapsed time: 00:00:45
channel ch01: piece handle=bk_474_1_881575292 tag=T1_TEST_20150605
channel ch01: restored backup piece 1
channel ch01: restore complete, elapsed time: 00:01:15
channel ch02: piece handle=bk_473_1_881575291 tag=T1_TEST_20150605
channel ch02: restored backup piece 1
channel ch02: restore complete, elapsed time: 00:01:45
channel ch04: piece handle=bk_469_1_881575291 tag=T1_TEST_20150605
channel ch04: restored backup piece 1
channel ch04: restore complete, elapsed time: 00:06:05
channel ch05: piece handle=bk_470_1_881575291 tag=T1_TEST_20150605
channel ch05: restored backup piece 1
channel ch05: restore complete, elapsed time: 00:06:05
Finished restore at 05-JUN-15

Starting recover at 05-JUN-15

starting media recovery

archived log file name=/u04/oradata/t1/archive/t1_arch_1_2382_879417466.arc thread=1 sequence=2382
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2383_879417466.arc thread=1 sequence=2383
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2384_879417466.arc thread=1 sequence=2384
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2385_879417466.arc thread=1 sequence=2385
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2386_879417466.arc thread=1 sequence=2386
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2387_879417466.arc thread=1 sequence=2387
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2388_879417466.arc thread=1 sequence=2388
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2389_879417466.arc thread=1 sequence=2389
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2390_879417466.arc thread=1 sequence=2390
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2391_879417466.arc thread=1 sequence=2391
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2392_879417466.arc thread=1 sequence=2392
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2393_879417466.arc thread=1 sequence=2393
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2394_879417466.arc thread=1 sequence=2394
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2395_879417466.arc thread=1 sequence=2395
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2396_879417466.arc thread=1 sequence=2396
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2397_879417466.arc thread=1 sequence=2397
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2398_879417466.arc thread=1 sequence=2398
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2399_879417466.arc thread=1 sequence=2399
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2400_879417466.arc thread=1 sequence=2400
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2401_879417466.arc thread=1 sequence=2401
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2402_879417466.arc thread=1 sequence=2402
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2403_879417466.arc thread=1 sequence=2403
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2404_879417466.arc thread=1 sequence=2404
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2405_879417466.arc thread=1 sequence=2405
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2406_879417466.arc thread=1 sequence=2406
archived log file name=/u04/oradata/t1/archive/t1_arch_1_2407_879417466.arc thread=1 sequence=2407
media recovery complete, elapsed time: 00:00:16
Finished recover at 05-JUN-15
released channel: ch00
released channel: ch01
released channel: ch02
released channel: ch03
released channel: ch04
released channel: ch05
released channel: ch06

Database’ imizi açalım ;

RMAN> alter pluggable database pdbt11 open ;
Statement processed

Check edelim ;

RMAN> select name,dbid,open_mode from v$pdbs where name =’PDBT11′;
NAME DBID OPEN_MODE
—————————— ———- ———-
PDBT11 87534229 READ WRITE

Bu arada ikinci bir bilgi artık 12c ile bilirlikte rman komut satırını da artık sqlplus gibi kullanabiliriz. Tüm komutların rman ‘ de herhangi bir deüğişik yapmadan (eskiden başına sql koyup tırnak içinde yazarak çalıştırabiliyorduk) burada da çalıştırabilirsiniz.

Rman ile sadece pluggable değil container database’ inin de nasıl restore edileceği ile ilgili yazılarıma devam etmeyi planlıyorum.

Be Sociable, Share!

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir


+ 3 = oniki