Active Database Cloning fails with RMAN-05001

I am trying to clone a Production database which is of 1.5 TB to our test server , I can even do this with the backup based duplication using RMAN , but there will some huge time which spends on my database backup and the network transfer of my backup file to my test server.

So i decided to use a cool feature of Active database duplication in 11g R2 . There main advantage of active db duplication is there is no need source database backup , RMAN will take care of coping the files from the source to the destination server .

Source DB Name = Prod
Destination DB name = Clone

I have copied the Password file of the source database to the destination server and

$ scp orapwProd oracle@hostname.localdomain.com:/opt/oracle/app/11.2.0.3/dbs/

I have created a pfile for my clone database as follows in the default location of /opt/oracle/app/11.2.0.3/dbs/

$ cat initclone.ora

*.control_files='/opt/oracle/clone/control01.ctl','/opt/oracle/clone/control02.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='clone'
*.db_file_name_convert='/opt/oracle/oradata/prd/datafile/','/opt/oracle/clone'
*.log_file_name_convert='/opt/oracle/oradata/prd/onlinelog/','/opt/oracle/clone'
*.diagnostic_dest='/opt/oracle/app'

Start the instance in the nomount stage

$ export ORACLE_SID=clone
$sqlplus / as sysdba

sql> startup nomount

sql> exit

Make sure you have configured the Listener.ora with the STATIC registration of the Cloned instance.

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = clone)
(ORACLE_HOME = /opt/oracle/app/11.2.0.3)
(SID_NAME = clone)
)
)

Reload the Listener and verify the registration

$ lsnrctl reload

Configure the TNSNAMES connectivity for both the sides of source and destination server.

$ tnsping clone ----- from the source and destination
$ tnsping prod ----- from the source and destination

Connect to RMAN and start the duplication process.
Note: Iam using target control file instead of a recovery catalog

#rman target sys/orcl@prod
RMAN> connect auxiliary sys/orcl@clone

RMAN> DUPLICATE TARGET DATABASE TO 'clone' FROM ACTIVE DATABASE;

At some poing the duplication fails with the below error

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/30/2008 17:12:42
RMAN-05501: aborting duplication of target database
RMAN-05001: auxiliary file name /u01/oradata/prod/redo03.log conflicts with a file used by the target database
RMAN-05001: auxiliary file name /u01/oradata/prod/redo02.log conflicts with a file used by the target database
RMAN-05001: auxiliary file name /u01/oradata/prod/redo01.log conflicts with a file used by the target database

My source database is using the OMF files. So you cant able to use db_file_name_convert and log_file_name_convert parameter to clone the database when there source database files are Oracle Managed Files.

Quoting the official documentation:

If the source database files are in the Oracle Managed Files (OMF) format, then you cannot use the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT initialization parameters or the fileNameConversionSpec clause to generate new OMF filenames for the duplicate database. OMF filenames are unique and generated by Oracle Database.

The only exception to this rule is when changing only an ASM disk group name. Assume that source datafiles and online redo log files are stored in ASM disk group +SOURCEDSK. You want to store the duplicate database files in ASM disk group +DUPDSK. In this case, you can set the initialization parameters as follows:

DB_FILE_NAME_CONVERT = (“+SOURCEDSK”,”+DUPDSK”)
LOG_FILE_NAME_CONVERT = (“+SOURCEDSK”,”+DUPDSK”)
RMAN uses DB_FILE_NAME_CONVERT or LOG_FILE_NAME_CONVERT to convert the disk group name, and then generates a new, valid filename based on the converted disk group name.

You have the following other supported options for naming datafiles when the source files are in the Oracle Managed Files format:

Use SET NEWNAME to specify names for individual datafiles.

Set DB_FILE_CREATE_DEST to make all datafiles of the new database Oracle-managed files, with the exception of the files for which SET NEWNAME is used. You should not set DB_FILE_NAME_CONVERT if you set DB_FILE_CREATE_DEST.

Supported options for naming online redo logs duplicated from Oracle-managed files are DB_CREATE_FILE_DEST, DB_RECOVERY_FILE_DEST, or DB_CREATE_ONLINE_LOG_DEST_n.

So shutdown the cloned instance and make sure you have removed the DB_FILE_NAME_CONVERT and LOG_FILE_NAME_CONVERT parameterb from the pfile and set the DB_FILE_CREATE_DEST parameter ,
start the database in the nomount stage and proceed with the RMAN duplicate database creation

RMAN> connect auxiliary sys/orcl@clone

RMAN> DUPLICATE TARGET DATABASE TO 'clone' FROM ACTIVE DATABASE;

contents of Memory Script:
{
Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 28-FEB-14

Export Error

Oracle Version- 10.2.0.4

I Have taken an export of a particular user  which dump size is nearly to 14 gb.

While I am importing it  , i got an import error which says ,

illegal lob length marker 65279
bytesread = 00000000000
TABLE =cm_test
IMP-00098: INTERNAL ERROR: impgst2
IMP-00018: partial import of previous table completed: 2031183 rows imported
IMP-00008: unrecognized statement in the export file:
ÿþÿþÿþÿ
IMP-00008: unrecognized statement in the export file:
IMP-00008: unrecognized statement in the export file:
IMP-00008: unrecognized statement in the export file:
IMP-00008: unrecognized statement in the export file:
IMP-00008: unrecognized statement in the export file:

All the  googles and forums mentioned that the export dump file is corrupted .

So  later i have taken an export once again with the large buffer size (buffer=300000000)

And then the export has been taken successfully ,

Later i try to import it by setting the same buffer parameter (buffer=300000000) and the import error message seems to be vanished .

This  same issue is been reported as a Bug by oracle support in 10.1.0.3, But this  bug has been fixed in 10.1.0.4 and Later.

Bug no: 3890213  IMP-98 possible importing zero length Lobs with CHUNKSIZE > 32767

_kgl_large_heap_warning_threshold

hi,
Today Morning i have found that the  message “Memory Notification: Library Cache Object Loaded Into SGA” is been written  in alert log file.Last week this database has been  upgraded to 10g.

To  avoid these messages being generated, we need to adjust the size of a hidden initialization parameter “_kgl_large_heap_warning_threshold” to a high value or zero.

To find out a hidden parameter value in the database.

SQL> SELECT a.ksppinm “Parameter”,
  2  b.ksppstvl “Session Value”,
  3  c.ksppstvl “Instance Value”
  4  FROM x$ksppi a, x$ksppcv b, x$ksppsv c
  5  WHERE a.indx = b.indx AND
  6  a.indx = c.indx AND
  7  a.ksppinm LIKE ‘%kgl_large_heap%’;

Parameter
————————————————–
Session Value
————————————————–
Instance Value
————————————————–
_kgl_large_heap_warning_threshold
2097152
2097152

To modify this parameter:

login as sysdba

SQL> connect sys as sysdba
SQL> alter system set “_kgl_large_heap_warning_threshold”=8388608 scope=spfile ;

System altered.

 

SQL> SHUTDOWN IMMEDIATE;

SQL> STARTUP;

SQL> SELECT a.ksppinm “Parameter”,
  2  b.ksppstvl “Session Value”,
  3  c.ksppstvl “Instance Value”
  4  FROM x$ksppi a, x$ksppcv b, x$ksppsv c
  5  WHERE a.indx = b.indx AND
  6  a.indx = c.indx AND
  7  a.ksppinm LIKE ‘%kgl_large_heap%’;

Parameter
————————————————–
Session Value
————————————————–
Instance Value
————————————————–
_kgl_large_heap_warning_threshold
8388608
8388608