rman incremental backup level 0,1 backup

Just check out nls_date_format and set or export nls_date_format to your expected date format before start working with rman.


SQL> select * from nls_database_parameters;

PARAMETER                      VALUE
------------------------------ ----------------------------------------
NLS_LANGUAGE                   AMERICAN
NLS_TERRITORY                  AMERICA
NLS_CURRENCY                   $
NLS_ISO_CURRENCY               AMERICA
NLS_NUMERIC_CHARACTERS         .,
NLS_CHARACTERSET               WE8MSWIN1252
NLS_CALENDAR                   GREGORIAN
NLS_DATE_FORMAT                DD-MON-RR
NLS_DATE_LANGUAGE              AMERICAN
NLS_SORT                       BINARY
NLS_TIME_FORMAT                HH.MI.SSXFF AM
NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
NLS_DUAL_CURRENCY              $
NLS_COMP                       BINARY
NLS_LENGTH_SEMANTICS           BYTE
NLS_NCHAR_CONV_EXCP            FALSE
NLS_NCHAR_CHARACTERSET         AL16UTF16
NLS_RDBMS_VERSION              10.2.0.1.0


C:\Documents and Settings\A Rahim Khan>set oracle_sid =orcl1

C:\Documents and Settings\A Rahim Khan>set nls_date_format=dd-mon-rr hh24:mi:ss

C:\Documents and Settings\A Rahim Khan>rman target /

Recovery Manager: Release 10.2.0.1.0 - Production on Fri Apr 27 12:31:56 2012

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: ORCL1 (DBID=1163774759)


While working with incremental level 1 backup, you should enable block_change_tracking to have faster backup. it's a light weight process, keep track of data block changes. However, if you are using OMF (Oracle Managed Files) , don't need use using file clause while enabling block change tracking.


SQL> select status from v$block_change_tracking;

STATUS
----------
DISABLED


SQL> alter database enable block change tracking using file 'c:\block_change_tracking.trc';

Database altered.


SQL> select status from v$block_change_tracking;

STATUS
----------
ENABLED

both two of those takes backup of full database. But the second one is preferable as far as restoring level 1 incremental backup is concerned.


RMAN> backup database;

Starting backup at 27-apr-12 12:39:19
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSTEM01.DBF
input datafile fno=00003 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSAUX01.DBF
input datafile fno=00005 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\EXAMPLE01.DBF
input datafile fno=00002 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\UNDOTBS01.DBF
input datafile fno=00004 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 27-apr-12 12:39:20
channel ORA_DISK_1: finished piece 1 at 27-apr-12 12:40:15
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_27\O1_MF_NNNDF_TAG20120427T123920_7SOXH8QG_.BKP tag=TAG20120427T123920 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 27-apr-12 12:40:17
channel ORA_DISK_1: finished piece 1 at 27-apr-12 12:40:18
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_27\O1_MF_NCSNF_TAG20120427T123920_7SOXK1SD_.BKP tag=TAG20120427T123920 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 27-apr-12 12:40:18


RMAN> backup incremental level 0 database;

Starting backup at 28-apr-12 08:50:55
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 devtype=DISK
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSTEM01.DBF
input datafile fno=00003 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSAUX01.DBF
input datafile fno=00005 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\EXAMPLE01.DBF
input datafile fno=00002 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\UNDOTBS01.DBF
input datafile fno=00004 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:50:57
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:51:52
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NNND0_TAG20120428T085056_7SR4H2YR_.BKP tag=TAG20120428T085056 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting incremental level 0 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:51:54
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:51:57
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NCSN0_TAG20120428T085056_7SR4JTX9_.BKP tag=TAG20120428T085056 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 28-apr-12 08:51:57

RMAN> backup incremental level 1 database;

Starting backup at 28-apr-12 08:52:32
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=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSTEM01.DBF
input datafile fno=00003 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSAUX01.DBF
input datafile fno=00005 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\EXAMPLE01.DBF
input datafile fno=00002 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\UNDOTBS01.DBF
input datafile fno=00004 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:52:33
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:52:58
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NNND1_TAG20120428T085232_7SR4L14W_.BKP tag=TAG20120428T085232 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:53:00
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:53:03
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NCSN1_TAG20120428T085232_7SR4LW5V_.BKP tag=TAG20120428T085232 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:05
Finished backup at 28-apr-12 08:53:03


Now, if you want restore this following level 1 incremental backup, you have to restore the prior level 1 incremental backup first after restoring level o backup, then you can start restoring this following one. However, if you consider this cumulative one, this takes backup of changes from last level 0 backup, so you can restore this cumulative level 1 backup directly after restoring last level 0 backup.


RMAN> backup incremental level 1 database;

Starting backup at 28-apr-12 08:53:13
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=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSTEM01.DBF
input datafile fno=00003 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSAUX01.DBF
input datafile fno=00005 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\EXAMPLE01.DBF
input datafile fno=00002 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\UNDOTBS01.DBF
input datafile fno=00004 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:53:14
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:53:39
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NNND1_TAG20120428T085313_7SR4MB7T_.BKP tag=TAG20120428T085313 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:26
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:53:41
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:53:42
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NCSN1_TAG20120428T085313_7SR4N5HN_.BKP tag=TAG20120428T085313 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 28-apr-12 08:53:42

RMAN> backup incremental level 1 cumulative database;

Starting backup at 28-apr-12 08:56:37
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=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSTEM01.DBF
input datafile fno=00003 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\SYSAUX01.DBF
input datafile fno=00005 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\EXAMPLE01.DBF
input datafile fno=00002 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\UNDOTBS01.DBF
input datafile fno=00004 name=G:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL1\USERS01.DBF
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:56:38
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:57:03
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NNND1_TAG20120428T085638_7SR4SPY8_.BKP tag=TAG20120428T085638 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting incremental level 1 datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
including current control file in backupset
including current SPFILE in backupset
channel ORA_DISK_1: starting piece 1 at 28-apr-12 08:57:06
channel ORA_DISK_1: finished piece 1 at 28-apr-12 08:57:07
piece handle=G:\ORACLE\PRODUCT\10.2.0\FLASH_RECOVERY_AREA\ORCL1\BACKUPSET\2012_04_28\O1_MF_NCSN1_TAG20120428T085638_7SR4TL1G_.BKP tag=TAG20120428T085638 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:03
Finished backup at 28-apr-12 08:57:07

Thanks
A Rahim Khan

Advertisements
  1. No trackbacks yet.

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: