Quantcast
Channel: Doyensys Allappsdba Blog..
Viewing all articles
Browse latest Browse all 1640

Block Change Tracking

$
0
0
Block Change Tracking:


Rman's change tracking feature for incremental backups improves incremental backup performance by recording changed blocks in each datafile in a change tracking file. If change tracking is enabled,Rman uses the change traching file to identify changed blocks for incremental backup,thus avoiding the need to scan every block in the datafile. 

One change tracking file is created for the whole database. By default, the change tracking file is created as an Oracle managed file in DB_CREATE_FILE_DEST. We can also specify the name of the block change tracking file, placing it in any desired location. 

Using change tracking in no way changes the commands used to perform incremental backups, and the change tracking files themselves generally require little maintenance after initial configuration. 

From Oracle 10g, the background process Block Change Tracking Writer (CTWR) will do the job of writing modified block details to block change tracking file. In a Real Applications Clusters (RAC) environment, the change tracking file must be located on shared storage accessible from all nodes in the cluster. 

Enabling and Disabling Change Tracking We can enable or disable change tracking when the database is either open or mounted. To alter the change tracking setting, we must use SQL*Plus to connect to the target database with administrator privileges. To store the change tracking file in the database area, set DB_CREATE_FILE_DEST in the target database.

 Then issue the following SQL statement to enable change tracking: 

SQL> alter database enable block change tracking; 

create the change tracking file in a desired location, using the following SQL statement: 

SQL> alter database enable block change tracking using file
         '/home/oracle/dg_1/oradata/data/bc_track.dbf';

Database altered. 

The REUSE option tells Oracle to overwrite any existing file with the specified name. 

SQL> alter database enable block change tracking using file '/home/oracle/dg_1/oradata/data/bc_track.dbf' reuse; 

To disable change tracking, use this SQL statement:

SQL> alter database disable block change tracking;

Database altered. 

Checking Whether Change Tracking is enabled

SQL> select status from V$BLOCK_CHANGE_TRACKING;

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

 SQL> alter database enable block change tracking using file
'/home/oracle/dg_1/oradata/data/bc_track.dbf';

Database altered. 

SQL> select * from V$BLOCK_CHANGE_TRACKING; 

STATUS                    FILENAME                                                  BYTES
---------             -----------------------------------------                      ------------
ENABLED    /home/oracle/dg_1/oradata/data/bc_track.dbf         11599872

Moving the Change Tracking File If you need to move the change tracking file, the ALTER DATABASE RENAME FILE command updates the control file to refer to the new location.

 If necessary, determine the current name of the change tracking file: 

step1

SQL> select FILENAME from V$BLOCK_CHANGE_TRACKING;
FILENAME
 --------------------------------------------------------------------- /home/oracle/dg_1/oradata/data/bc_track.dbf 

SQL> select FILENAME from V$BLOCK_CHANGE_TRACKING;
FILENAME
---------------------------------------------------------------------
/home/oracle/dg_1/oradata/data/bc_track.dbf 

step 2

Shutdown the database.
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down. 

step 3 

Using host os commands, move the change tracking file to its new location.
 [oracle@ramkumar ~]$ mv /home/oracle/dg_1/oradata/data/bc_track.dbf
/home/oracle/dg_1/oradata/bc_new_trac.dbf 

step 4 

Mount the database and move the change tracking file to a location that
has more space. 
SQL> startup mount
ORACLE instance started. Total System Global Area 939495424 bytes
Fixed Size 2258840 bytes
Variable Size 570427496 bytes
Database Buffers 360710144 bytes
Redo Buffers 6098944 bytes
Database mounted. SQL> alter database rename file '/home/oracle/dg_1/oradata/data/bc_track.dbf'
to '/home/oracle/dg_1/oradata/bc_new_trac.dbf'; Database altered. 

step 5 

Open the database. 
SQL> alter database open; 
SQL> select FILENAME from V$BLOCK_CHANGE_TRACKING;
 FILENAME
---------------------------------------------------------------------
/home/oracle/dg_1/oradata/bc_new_track.dbf




Viewing all articles
Browse latest Browse all 1640

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>