Search This Blog

Tuesday, 30 June 2020

Block Change Tracking (BCT)

 Enabling Block Change Tracking



Block changing tracking improves the performance of incremental backups by recording changed blocks in the block change tracking file. During an incremental backup, instead of scanning all data blocks to identify which blocks have changed, RMAN uses this file to identify the changed blocks that need to be backed up.
You can enable block change tracking when the database is either open or mounted. This section assumes that you intend to create the block change tracking file as an Oracle Managed File in the database area, which is where the database maintains active database files such as data files, control files, and online redo log files.
To determine if block change tracking is enabled, check the STATUS and FILENAME columns in the V$BLOCK_CHANGE_TRACKING view, using the following statement from the SQL or RMAN prompt:
SELECT status, filename FROM V$BLOCK_CHANGE_TRACKING;

To enable block change tracking:

Connect RMAN to the target database as described in "Connecting to the Target Database Using RMAN."
Determine the current location of the database data files by submitting the following query:
RMAN> SELECT NAME FROM V$DATAFILE;

******************************************************************************

Action Plan Implementation :


Microsoft Windows [Version 10.0.18362.904]
(c) 2019 Microsoft Corporation. All rights reserved.

C:\Users\mmussaib>sqlplus / as sysdba

SQL*Plus: Release 12.2.0.1.0 Production on Tue Jun 30 14:02:39 2020

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SQL> SELECT status  FROM v$block_change_tracking;

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

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

C:\Users\mmussaib>rman target /

Recovery Manager: Release 12.2.0.1.0 - Production on Tue Jun 30 14:03:00 2020

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

connected to target database: MUSAIB (DBID=42443199)

RMAN> SELECT NAME FROM V$DATAFILE;

using target database control file instead of recovery catalog


NAME
--------------------------------------------------------------------------------

C:\APP\MMUSSAIB\VIRTUAL\ORADATA\MUSAIB\SYSTEM01.DBF


C:\APP\MMUSSAIB\VIRTUAL\ORADATA\MUSAIB\SYSAUX01.DBF


C:\APP\MMUSSAIB\VIRTUAL\ORADATA\MUSAIB\UNDOTBS01.DBF


C:\APP\MMUSSAIB\VIRTUAL\ORADATA\MUSAIB\USERS01.DBF


RMAN> ALTER SYSTEM SET DB_CREATE_FILE_DEST ='C:\APP\MMUSSAIB\VIRTUAL\ORADATA\MUSAIB';

Statement processed

RMAN> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;

Statement processed

RMAN> SELECT status  FROM v$block_change_tracking;

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

Wednesday, 24 June 2020

RMAN LEVEL0 BACKUP FAILED ORA-19504 ,ORA-27040

Log File Error


channel ORA_DISK_5: backup set complete, elapsed time: 01:41:25
channel ORA_DISK_2: finished piece 1 at 24-JUN-20
piece handle=/u01/TEST/TEST_LVL0_20200624_o2v3j678_s54018_p11 tag=TAG20200624T111720 comment=NONE
channel ORA_DISK_2: backup set complete, elapsed time: 01:30:02
Finished backup at 24-JUN-20

Starting Control File and SPFILE Autobackup at 24-JUN-20
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of Control File and SPFILE Autobackup command on ORA_DISK_1 channel at 06/24/2020 22:58:13
ORA-19504: failed to create file "/u01/TEST/autobackup/c-3117373769-20200624-00"
ORA-27040: file create error, unable to create file
Linux-x86_64 Error: 2: No such file or directory
Additional information: 1

Recovery Manager complete.

Cause:


There was no directory /autobackup/ ,So control file backup got failed.

Resolution:

1) Create directory under /u01/TEST/autobackup/

2) RMAN TARGET /

RMAN>backup archivelog all;

Output of last lines:


piece handle=/TEST/TEST/00v3jfin_1_1 tag=TAG20200624T235145 comment=                                                                                        NONE
channel ORA_DISK_2: backup set complete, elapsed time: 00:00:05
channel ORA_DISK_4: finished piece 1 at 25-JUN-20
piece handle=/TEST/TEST/01v3jfip_1_1 tag=TAG20200624T235145 comment=                                                                                        NONE
channel ORA_DISK_4: backup set complete, elapsed time: 00:00:03
Finished backup at 25-JUN-20

Starting Control File and SPFILE Autobackup at 25-JUN-20
piece handle=/TEST/TEST/autobackup/c-3117373769-20200625-00 comment=                                                                                        NONE
Finished Control File and SPFILE Autobackup at 25-JUN-20


Query To Check Backup Status:


set linesize 500 pagesize 2000
col Hours format 9999.99
col STATUS format a10
select SESSION_KEY, INPUT_TYPE, STATUS,
to_char(START_TIME,'mm-dd-yyyy hh24:mi:ss') as RMAN_Bkup_start_time,
to_char(END_TIME,'mm-dd-yyyy hh24:mi:ss') as RMAN_Bkup_end_time,
elapsed_seconds/3600 Hours from V$RMAN_BACKUP_JOB_DETAILS
order by session_key;

Saturday, 20 June 2020

RMAN LEVEL0 BACKUP FAILED ORA-19599

RMAN LEVEL0 BACKUP FAILED



Log File Error:

input archived log thread=1 sequence=5407 RECID=5466 STAMP=1033629855
channel ORA_DISK_7: starting piece 1 at 19-JUN-20
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of backup command on ORA_DISK_7 channel at 06/19/2020 03:23:11
ORA-19599: block number 3328 is corrupt in archived log /u01/xyz/1_5407_19263.dbf


+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Old Locations:/u01/xyz/1_5407_19263.dbf

New Location: /u01/abc/1_5407_19263.dbf

Archive Location : /u01/xyz/

Resolution:

1.Move Corrupted Archive log to other destination

2. Cross check archive.

3. Delete Expired backup

4.Re-Trigger Backup once again.
/u01/xyz/ls -ltr * 1_5407_19263.dbf

$mv  /u01/xyz/ls -ltr * 1_5407_19263.dbf  /u01/abc/ls -ltr * 1_5407_19263.dbf


$RMAN TARGET /

RMAN> crosscheck archivelog all;
RMAN> delete noprompt expired archivelog all;
RMAN>backup archivelog all;

Done.