Migrating from Windows to Linux with Active Duplicate for standby – problem with 11.2.0.4

Recently I was working on migrating Oracle 11.2.0.4 database running on Windows, to new hardware infrastructure on Linux. This Oracle version is with us for quite a long time, plus migration from Windows to Linux is quite common (fortunately in that direction…;)), so when I got an error while trying to use Active Duplicate feature to create a standby database, I was quite sure I’ll be able to quickly find the solution either in MOS or elsewhere. Indeed, I found several blog posts with exactly the same error, but solution mentioned there was not working for me.

Please find below the problem I got:

$ rman

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Oct 11 08:07:34 2018

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

RMAN> connect target sys/******@MYDB01

connected to target database: MYDB01 (DBID=5722248372)

RMAN> connect auxiliary sys/******@MYDB01_STB

connected to auxiliary database: MYDB01 (not mounted)

RMAN> run {
2>      allocate channel prim1 type disk;
3>      allocate channel prim2 type disk;
4>      allocate channel prim3 type disk;
5>      allocate channel prim4 type disk;
6>      allocate auxiliary channel stby type disk;
7> 
8>      duplicate target database for standby from active database nofilenamecheck;
9> }

using target database control file instead of recovery catalog
allocated channel: prim1
channel prim1: SID=11 device type=DISK

allocated channel: prim2
channel prim2: SID=100 device type=DISK

allocated channel: prim3
channel prim3: SID=203 device type=DISK

allocated channel: prim4
channel prim4: SID=302 device type=DISK

allocated channel: stby
channel stby: SID=760 device type=DISK

Starting Duplicate Db at Oct 11 2018 08:07:48

contents of Memory Script:
{
   backup as copy reuse
   targetfile  'D:\app\oracle\product\11.2.0\db_1\DATABASE\PWDMYDB01.ORA' auxiliary format 
 '/u01/app/oracle/product/11.2.0.4/db_1/dbs/orapwMYDB01'   ;
}
executing Memory Script

Starting backup at Oct 11 2018 08:07:48
Finished backup at Oct 11 2018 08:07:49

contents of Memory Script:
{
   backup as copy current controlfile for standby auxiliary format  '/u02/MYDB01/controlfile/ctl01.ora';
   restore clone controlfile to  '/u03/MYDB01/controlfile/ctl02.ora' from 
 '/u02/MYDB01/controlfile/ctl01.ora';
}
executing Memory Script

Starting backup at Oct 11 2018 08:07:49
channel prim1: starting datafile copy
copying standby control file
output file name=D:\APP\ORACLE\PRODUCT\11.2.0\DB_1\DATABASE\SNCFMYDB01.ORA tag=TAG20181011T080749 RECID=15732 STAMP=989233256
channel prim1: datafile copy complete, elapsed time: 00:00:01
Finished backup at Oct 11 2018 08:07:51

Starting restore at Oct 11 2018 08:07:51

channel stby: copied control file copy
Finished restore at Oct 11 2018 08:07:52

contents of Memory Script:
{
   sql clone 'alter database mount standby database';
}
executing Memory Script

sql statement: alter database mount standby database
released channel: prim1
released channel: prim2
released channel: prim3
released channel: prim4
released channel: stby
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 10/11/2018 08:07:52
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of sql command on clone_default channel at 10/11/2018 08:07:52
RMAN-11003: failure during parse/execution of SQL statement: alter database mount standby database
ORA-00205: error in identifying control file, check alert log for more info

I saw that control file had been restored successfully, but only to one location (I had multiplexed it in initialisation file). Re-running the commands ended up with below error:

DBGSQL:     TARGET> begin :fhdbi := dbms_rcvcat.getDbid; end;
DBGSQL:        sqlcode = 6550
DBGSQL:         B :fhdbi = 32764
released channel: prim1
released channel: prim2
released channel: prim3
released channel: prim4
released channel: stby
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 10/11/2018 08:08:04
RMAN-05501: aborting duplication of target database
RMAN-03015: error occurred in stored script Memory Script
ORA-06550: line 1, column 17:
PLS-00201: identifier 'DBMS_RCVCAT.GETDBID' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

Google search for PLS-00201: identifier 'DBMS_RCVCAT.GETDBID' must be declared while running RMAN duplicate, pointed me to sources telling that adding nocatalog option to the RMAN invocation should solve the issue. But in my case it did not work. Having in mind that the control file has been successfully restored, I found exact statement which was failing:

RMAN> restore clone controlfile to  '/u03/MYDB01/controlfile/ctl02.ora' from '/u02/MYDB01/controlfile/ctl01.ora';

So, I’ve decided to re-try the duplicate with just one control file location and…it worked :). I hope you can do the same if you get similar problems, please just don’t forget to multiplex your control files after the duplication is finished.

Advertisements

One thought on “Migrating from Windows to Linux with Active Duplicate for standby – problem with 11.2.0.4”

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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s