How to Enable Block Change Tracking

Check block change tracking ENABLED

SQL>SELECT status, filename FROM V$BLOCK_CHANGE_TRACKING


STATUS     FILENAME
---------- -----------------------------------------------
ENABLED    +DATA2/LG6PRDD/CHANGETRACKING/ctf.556.939400999

Check parameter ‘ DB_CREATE_FILE_DEST’

Setup this parameter if not yet:

SQL>ALTER SYSTEM SET DB_CREATE_FILE_DEST = '+DATA2';

Enable block change tracking

SQL>ALTER DATABASE ENABLE BLOCK CHANGE TRACKING;

“Duplicate from Active Database” Failed With ORA-12528 When Connecting to Auxiliary Instance

SYMPTOM

RMAN “duplicate target database for standby from active database” failed with below errors:

Connection from target database server to the auxiliary database  
fails with error:

ORA-12528: TNS:listener: all appropriate instances are blocking new 
connections.

It is a little bit tricky in RAC environment, this post will provide the solution for both single and RAC environment.

INVSTIGATIONS and SOLUTION

Subscribe to get access

Read more of this content when you subscribe today.

RMAN Backup Failed With RMAN-03014 RMAN-03009

RMAN failed with errors while resync the recovery catalog.

...
..
.
starting full resync of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03015: error occurred in stored script al_netbkup
RMAN-03002: failure of allocate command at 01/10/2018 08:52:24
RMAN-03014: implicit resync of recovery catalog failed
RMAN-03009: failure of full resync command on default channel at 01/10/2018 08:52:24
ORA-01403: no data found
RMAN>

Find there is a database guarantee restore point.

SQL> select * from v$restore_point;

SCN DATABASE_INCARNATION# GUA STORAGE_SIZE TIME
---------- --------------------- --- ------------ ---------------------------------------------------------------------------
RESTORE_POINT_TIME PRE
--------------------------------------------------------------------------- ---
NAME CON_ID
-------------------------------------------------------------------------------------------------------------------------------- ----------
 851245362 1 YES 1.9327E+10 09-JAN-18 10.46.35.000000000 AM
 YES
POINT_201801091046

Drop this restore point.

SQL> drop restore point POINT_201801091046;

Restore point dropped.

SQL> select * from v$restore_point;

no rows selected

Check again, both sync catalog and RMAN backups are successful.

RMAN> list backup of database;

starting full resync of recovery catalog
full resync complete

List of Backup Sets
===================
...
..
.

RMAN-06004: ORACLE error from recovery catalog database: ORA-01422: exact fetch returns more than requested number of rows

It is a good practice to upgrade RMAN CATLOG to the latest version in your environment

SYMPTOMS

Target Database : 12.2.0.1
RMAN Catalog  :  12.1.0.2

Trying to “upgrade catalog” from 12.2.0.1 RMAN and 12.1.0.2  RMAN catalog, then got following errors:

connected to target database: RACTEST (DBID=2073981615)
connected to recovery catalog database
PL/SQL package RMAN.DBMS_RCVCAT version 12.01.00.02. in RCVCAT database is too old

RMAN> upgrade catalog;

recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> upgrade catalog;
error creating init_nrsp_pdb_key
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06004: ORACLE error from recovery catalog database: ORA-01422: exact fetch returns more than requested number of rows

CAUSES

Bug 25852885 UPGRADE CATALOG WITH 12.2 RMAN ON 12.1 DATABASE FAILS W/ ORA-1422

SOLUTION

Backup then edit the recover.bsq file under target 12.2.0.1 ORACLE_HOME/rdbms/admin to change the following lines:

define init_nrsp_pdb_key
<<<
declare
   cursor nrsp_c is
      select distinct nrsp.rowid rid, dbinc.db_key db_key
        from nrsp, dbinc
       where nrsp.pdb_key is null
         and nrsp.dbinc_key = dbinc.dbinc_key
       order by dbinc.db_key;
   prev_db_key   number := 0;
   local_pdb_key number;
begin
   for r in nrsp_c loop
     if (r.db_key <> prev_db_key) then
        prev_db_key := r.db_key;
        select pdb_key into local_pdb_key
          from pdb
         where pdb.con_id in (1, 0);
     end if;

 TO:

define init_nrsp_pdb_key
<<<
declare
   cursor nrsp_c is
      select distinct nrsp.rowid rid, dbinc.db_key db_key
        from nrsp, dbinc
       where nrsp.pdb_key is null
         and nrsp.dbinc_key = dbinc.dbinc_key
       order by dbinc.db_key;
   prev_db_key   number := 0;
   local_pdb_key number;
begin
   for r in nrsp_c loop
     if (r.db_key <> prev_db_key) then
        prev_db_key := r.db_key;
        select pdb_key into local_pdb_key
          from pdb
         where pdb.con_id in (1, 0)
           and pdb.db_key = r.db_key;
     end if;

AND CHANGE :

define init_grsp_pdb_key
<<<
declare
   cursor grsp_c is
      select distinct grsp.rowid rid, dbinc.db_key db_key
        from grsp, dbinc
       where grsp.pdb_key is null
         and grsp.dbinc_key = dbinc.dbinc_key
       order by dbinc.db_key;
   prev_db_key   number := 0;
   local_pdb_key number;
begin
   for r in grsp_c loop
     if (r.db_key <> prev_db_key) then
        prev_db_key := r.db_key;
        select pdb_key into local_pdb_key
          from pdb
         where pdb.con_id in (1, 0);
     end if;

 TO:

define init_grsp_pdb_key
<<<
declare
   cursor grsp_c is
      select distinct grsp.rowid rid, dbinc.db_key db_key
        from grsp, dbinc
       where grsp.pdb_key is null
         and grsp.dbinc_key = dbinc.dbinc_key
       order by dbinc.db_key;
   prev_db_key   number := 0;
   local_pdb_key number;
begin
   for r in grsp_c loop
     if (r.db_key <> prev_db_key) then
        prev_db_key := r.db_key;
        select pdb_key into local_pdb_key
          from pdb
         where pdb.con_id in (1, 0)
           and pdb.db_key = r.db_key;
     end if;

Then re-run “upgrade catalog” twice:

RMAN> upgrade catalog;
recovery catalog owner is RMAN
enter UPGRADE CATALOG command again to confirm catalog upgrade

RMAN> upgrade catalog;
PL/SQL package RMAN.DBMS_BA version 12.02.00.01 in RCVCAT database is too old
recovery catalog upgraded to version 12.02.00.01
DBMS_RCVMAN package upgraded to version 12.02.00.01
DBMS_RCVCAT package upgraded to version 12.02.00.01.

RMAN> register database;
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete

Please note: As of today ( 25/09/2017), Oracle support released patch 25852885.

  1. It works for 12.2.0.1.0 only, because updated “recover.bsq” is included in patch ( p25852885_122010_Linux-x86-64.zip) .
  2. It does NOT work for 12.2.0.1.170814, because updated “recover.bsq” is not included in  patch ( p25852885_12201170718DBRU_Linux-x86-64.zip).

ORA-15001: diskgroup does not exist or is not mounted. ORA-15040: diskgroup is incomplete

Hit a bug when run RMAN command “restore controlfile to from “

SYMPTOM

              GI: 12.2.0.1.170814 (26609817)
        RAC HOME: 12.1.0.2.160419 (22291127)

Just starting to build a standby database, and trying to put standby database controlfile into ASM diskgroup by using RMAN , got the following errors:

RMAN> restore controlfile to '+DATA' from '/tmp/standby.ctl';

Starting restore at 2017-09-05 09:44:30
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1694 instance=STYTEST1 device type=DISK

channel ORA_DISK_1: restoring control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 09/05/2017 09:44:32
ORA-19870: error while restoring backup piece /tmp/standby.ctl
ORA-19504: failed to create file "+DATA"
ORA-17502: ksfdcre:4 Failed to create file +DATA
ORA-15001: diskgroup "DATA" does not exist or is not mounted
ORA-15040: diskgroup is incomplete

CAUSE

This hits the bug “21626377 – 12.2_150812: DBCA FAILS TO CREATE 12102 DB OVER 12.2 GI/ASM”

SOLUTION

1) Apply the latest PSU patch against RAC home( 12.1.0.2). For now , the latest RU for 12.1.0.2 is 12.1.0.2.170814 (26609783).

2) Retry again from RMAN successfully.

RMAN> restore controlfile to '+DATA' from '/tmp/standby.ctl';

Starting restore at 2017-09-05 10:30:39
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=989 instance=STYTEST1 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 2017-09-05 10:30:40

3) Review alert.log. The diskgroup “+DATA” was mounted successfully.

Tue Sep 05 10:30:40 2017
NOTE: ASMB mounting group 2 (DATA)
...
..
.
SUCCESS: mounted group 2 (DATA)
...
..
.