RMAN Backup dan Recovery Oracle 10g (2)

9 Sep

20. Apa saja yang harus dibackup ?
a. semisal ada penambahan tablespace baru, kita dapat melakukan backup hanya pada tablespace baru itu saja.
[oracle@iscdd ~]$ sqlplus / as sysdba
SQL> create tablespace senin_ts
datafile ‘/u02/oradata/iscdd/senin_ts01.dbf’
size 2M
segment space management auto;
SQL> exit;

[oracle@iscdd ~]$ cd $ORACLE_HOME/bin
[oracle@iscdd bin]$ ./rman CATALOG rman_user/rman123@iscdd TARGET sys/ora@iscdd
RMAN> report need backup;
starting full resync of recovery catalog
full resync complete
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of files with less than 1 redundant backups
File #bkps Name
—- —– —————————————————–
8    0     /u02/oradata/iscdd/senin_ts01.dbf

RMAN> backup incremental level 1 database;
Starting backup at 19-AUG-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=/u02/oradata/iscdd/system01.dbf
input datafile fno=00003 name=/u02/oradata/iscdd/sysaux01.dbf
input datafile fno=00005 name=/u02/oradata/iscdd/example01.dbf
input datafile fno=00002 name=/u02/oradata/iscdd/undotbs01.dbf
input datafile fno=00004 name=/u02/oradata/iscdd/users01.dbf
input datafile fno=00006 name=/u02/oradata/iscdd/rman_ts01.dbf
input datafile fno=00007 name=/u02/oradata/iscdd/rman_ts02.dbf
input datafile fno=00008 name=/u02/oradata/iscdd/senin_ts01.dbf
channel ORA_DISK_1: starting piece 1 at 19-AUG-08
channel ORA_DISK_1: finished piece 1 at 19-AUG-08
piece handle=/home/oracle/backup/ISCDD-id-2055978995-18.bkp tag=TAG20080819T093111 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 19-AUG-08

Starting Control File and SPFILE Autobackup at 19-AUG-08
piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154276_4bnd3pwb_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-AUG-08

b. Back Up Control Files
RMAN> backup current controlfile;
Starting backup at 19-AUG-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
channel ORA_DISK_1: starting piece 1 at 19-AUG-08
channel ORA_DISK_1: finished piece 1 at 19-AUG-08
piece handle=/home/oracle/backup/ISCDD-id-2055978995-20.bkp tag=TAG20080819T093916 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:06
Finished backup at 19-AUG-08
Starting Control File and SPFILE Autobackup at 19-AUG-08
piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154764_4bndlyw8_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-AUG-08

c. Back Up Archived Redo Log File dengan BACKUP ARCHIVELOG
RMAN> backup archivelog all;
Starting backup at 19-AUG-08
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archive log backupset
channel ORA_DISK_1: specifying archive log(s) in backup set
input archive log thread=1 sequence=6 recid=3 stamp=662902743
input archive log thread=1 sequence=7 recid=4 stamp=662987905
input archive log thread=1 sequence=8 recid=5 stamp=663112810
input archive log thread=1 sequence=9 recid=6 stamp=663154809
channel ORA_DISK_1: starting piece 1 at 19-AUG-08
channel ORA_DISK_1: finished piece 1 at 19-AUG-08
piece handle=/home/oracle/backup/ISCDD-id-2055978995-22.bkp tag=TAG20080819T094010 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:58
Finished backup at 19-AUG-08
Starting Control File and SPFILE Autobackup at 19-AUG-08
piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154869_4bndp8mq_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-AUG-08

d. Back Up Server Parameter Files
RMAN> BACKUP SPFILE;
Starting backup at 19-AUG-08
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 19-AUG-08
channel ORA_DISK_1: finished piece 1 at 19-AUG-08
piece handle=/home/oracle/backup/ISCDD-id-2055978995-24.bkp tag=TAG20080819T094220 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 19-AUG-08

Starting Control File and SPFILE Autobackup at 19-AUG-08
piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154943_4bndrlqh_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 19-AUG-08

e. Daftar backup.
RMAN> list backup summary;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
——- — — – ———– ————— ——- ——- ———- —
33      B  F  A DISK        15-AUG-08       1       1       NO         TAG20080815T103941
63      B  0  A DISK        15-AUG-08       1       1       NO         FULL_BACKUP
78      B  F  A DISK        15-AUG-08       1       1       NO         TAG20080815T110529
109     B  A  A DISK        15-AUG-08       1       1       NO         FULL_BACKUP2
110     B  0  A DISK        15-AUG-08       1       1       NO         TAG20080815T111906
131     B  A  A DISK        15-AUG-08       1       1       NO         FULL_BACKUP2
149     B  F  A DISK        15-AUG-08       1       1       NO         TAG20080815T112329
209     B  1  A DISK        19-AUG-08       1       1       NO         LEVEL_1
225     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T091455
248     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T092323
263     B  1  A DISK        19-AUG-08       1       1       NO         TAG20080819T093111
284     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T093116
317     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T093916
334     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T093924
380     B  A  A DISK        19-AUG-08       1       1       NO         TAG20080819T094010
402     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T094109
440     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T094220
461     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T094223

RMAN> list backup;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
33      Full    6.80M      DISK        00:00:03     15-AUG-08
BP Key: 39   Status: AVAILABLE  Compressed: NO  Tag: TAG20080815T103941
Piece Name: /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662812781_4b9ymzz2_.bkp
Control File Included: Ckp SCN: 545731       Ckp time: 15-AUG-08
SPFILE Included: Modification time: 15-AUG-08

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
63      Incr 0  584.06M    DISK        00:04:12     15-AUG-08
BP Key: 66   Status: AVAILABLE  Compressed: NO  Tag: FULL_BACKUP
Piece Name: /home/oracle/backup/ISCDD-id-2055978995-9.bkp
List of Datafiles in backup set 63
File LV Type Ckp SCN    Ckp Time  Name
—- — —- ———- ——— —-
1    0  Incr 547576     15-AUG-08 /u02/oradata/iscdd/system01.dbf
2    0  Incr 547576     15-AUG-08 /u02/oradata/iscdd/undotbs01.dbf
3    0  Incr 547576     15-AUG-08 /u02/oradata/iscdd/sysaux01.dbf
4    0  Incr 547576     15-AUG-08 /u02/oradata/iscdd/users01.dbf
5    0  Incr 547576     15-AUG-08 /u02/oradata/iscdd/example01.dbf
6    0  Incr 547576     15-AUG-08 /u02/oradata/iscdd/rman_ts01.dbf
7    0  Incr 547576     15-AUG-08 /u02/oradata/iscdd/rman_ts02.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
78      Full    6.80M      DISK        00:00:03     15-AUG-08
BP Key: 86   Status: AVAILABLE  Compressed: NO  Tag: TAG20080815T110529
Piece Name: /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662814329_4bb04dpp_.bkp
Control File Included: Ckp SCN: 547755       Ckp time: 15-AUG-08
SPFILE Included: Modification time: 15-AUG-08

RMAN> list backupset summary;
List of Backups
===============
Key     TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
——- — — – ———– ————— ——- ——- ———- —
33      B  F  A DISK        15-AUG-08       1       1       NO         TAG20080815T103941
63      B  0  A DISK        15-AUG-08       1       1       NO         FULL_BACKUP
78      B  F  A DISK        15-AUG-08       1       1       NO         TAG20080815T110529
109     B  A  A DISK        15-AUG-08       1       1       NO         FULL_BACKUP2
110     B  0  A DISK        15-AUG-08       1       1       NO         TAG20080815T111906
131     B  A  A DISK        15-AUG-08       1       1       NO         FULL_BACKUP2
149     B  F  A DISK        15-AUG-08       1       1       NO         TAG20080815T112329
209     B  1  A DISK        19-AUG-08       1       1       NO         LEVEL_1
225     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T091455
248     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T092323
263     B  1  A DISK        19-AUG-08       1       1       NO         TAG20080819T093111
284     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T093116
317     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T093916
334     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T093924
380     B  A  A DISK        19-AUG-08       1       1       NO         TAG20080819T094010
402     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T094109
440     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T094220
461     B  F  A DISK        19-AUG-08       1       1       NO         TAG20080819T094223

RMAN> list backupset 33;
List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
——- —- — ———- ———– ———— —————
33      Full    6.80M      DISK        00:00:03     15-AUG-08
BP Key: 39   Status: AVAILABLE  Compressed: NO  Tag: TAG20080815T103941
Piece Name: /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662812781_4b9ymzz2_.bkp
Control File Included: Ckp SCN: 545731       Ckp time: 15-AUG-08
SPFILE Included: Modification time: 15-AUG-08

21. Apakah ada yang sudah kuno ?
RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
Report of obsolete backups and copies
Type                 Key    Completion Time    Filename/Handle
——————– —— —————— ——————–
Backup Set           33     15-AUG-08
Backup Piece            39     15-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662812781_4b9ymzz2_.bkp
Backup Set           63     15-AUG-08
Backup Piece         66     15-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-9.bkp
Backup Set           78     15-AUG-08
Backup Piece         86     15-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662814329_4bb04dpp_.bkp
Backup Set           109    15-AUG-08
Backup Piece         113    15-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-11.bkp
Backup Set           149    15-AUG-08
Backup Piece         151    15-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662815409_4bb1642n_.bkp
Backup Set           225    19-AUG-08
Backup Piece         233    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663153295_4bnc521b_.bkp
Backup Set           248    19-AUG-08
Backup Piece         251    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663153803_4bncny0s_.bkp
Backup Set           284    19-AUG-08
Backup Piece         293    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154276_4bnd3pwb_.bkp
Backup Set           317    19-AUG-08
Backup Piece         320    19-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-20.bkp
Backup Set           334    19-AUG-08
Backup Piece         336    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154764_4bndlyw8_.bkp
Backup Set           402    19-AUG-08
Backup Piece         407    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154869_4bndp8mq_.bkp
Backup Set           440    19-AUG-08
Backup Piece         443    19-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-24.bkp

22. Hapus backup, khususnya yang obsolete
RMAN> delete noprompt obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 1
using channel ORA_DISK_1
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
——————– —— —————— ——————–
Backup Set           33     15-AUG-08
Backup Piece            39     15-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662812781_4b9ymzz2_.bkp
Backup Set           63     15-AUG-08
Backup Piece         66     15-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-9.bkp
Backup Set           78     15-AUG-08
Backup Piece         86     15-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662814329_4bb04dpp_.bkp
Backup Set           109    15-AUG-08
Backup Piece         113    15-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-11.bkp
Backup Set           149    15-AUG-08
Backup Piece         151    15-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662815409_4bb1642n_.bkp
Backup Set           225    19-AUG-08
Backup Piece         233    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663153295_4bnc521b_.bkp
Backup Set           248    19-AUG-08
Backup Piece         251    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663153803_4bncny0s_.bkp
Backup Set           284    19-AUG-08
Backup Piece         293    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154276_4bnd3pwb_.bkp
Backup Set           317    19-AUG-08
Backup Piece         320    19-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-20.bkp
Backup Set           334    19-AUG-08
Backup Piece         336    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154764_4bndlyw8_.bkp
Backup Set           402    19-AUG-08
Backup Piece         407    19-AUG-08          /u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154869_4bndp8mq_.bkp
Backup Set           440    19-AUG-08
Backup Piece         443    19-AUG-08          /home/oracle/backup/ISCDD-id-2055978995-24.bkp
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662812781_4b9ymzz2_.bkp recid=6 stamp=662812783
deleted backup piece
backup piece handle=/home/oracle/backup/ISCDD-id-2055978995-9.bkp recid=7 stamp=662814065
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662814329_4bb04dpp_.bkp recid=8 stamp=662814332
deleted backup piece
backup piece handle=/home/oracle/backup/ISCDD-id-2055978995-11.bkp recid=9 stamp=662815120
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_15/o1_mf_s_662815409_4bb1642n_.bkp recid=12 stamp=662815412
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663153295_4bnc521b_.bkp recid=14 stamp=663153298
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663153803_4bncny0s_.bkp recid=15 stamp=663153806
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154276_4bnd3pwb_.bkp recid=17 stamp=663154278
deleted backup piece
backup piece handle=/home/oracle/backup/ISCDD-id-2055978995-20.bkp recid=18 stamp=663154759
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154764_4bndlyw8_.bkp recid=19 stamp=663154766
deleted backup piece
backup piece handle=/u02/oradata/flash_recovery_area/ISCDD/autobackup/2008_08_19/o1_mf_s_663154869_4bndp8mq_.bkp recid=21 stamp=663154872
deleted backup piece
backup piece handle=/home/oracle/backup/ISCDD-id-2055978995-24.bkp recid=22 stamp=663154941
Deleted 12 objects

RMAN> report obsolete;
RMAN retention policy will be applied to the command
RMAN retention policy is set to recovery window of 2 days
no obsolete backups found

23. Mencatat DBID yang akan digunakan untuk recovery
SQL> select dbid from v$database;
DBID
———-
2055978995

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: