Wednesday, 7 October 2015

RMAN DUPLICATE CHANGES DB_NAME DB_UNIQUE_NAME TO UPPERCASE FOR CLONE DATABASE (Doc ID 2050095.1)

Symptoms

 RMAN DUPLICATE always changed DB_NAME / DB_UNIQUE_NAME parameter value to UPPERCASE, even with below attempts:

+ In aux init<SID>.ora, mention db_name = db_unique_name = "lower_case_name"

+ In DUPLICATE command, mention :

DUPLICATE TARGET DATABASE TO "lower_case_db_name" ......

+ Setting explicit value for spfile clause of DUPLICATE command:

DUPLICATE TARGET DATABASE TO "lower_case_db_name".....
....
SPFILE
..
..
  set db_name="lower_case_db_name"
  set db_unique_name="lower_case_db_unique_name"

+ Also, single quote (') or double quotes (") doesn't make any difference in results.

Changes

 RMAN DUPLICATE is performed.

Example Script with lower case name for db_name and db_unique_name:
RMAN> run {
2> allocate channel tgt1 device type disk ;
3> allocate auxiliary channel aux1 device type disk ;
4> allocate auxiliary channel aux2 device type disk ;
5> debug on ;
6> duplicate target database to "cdup1212" from active database using
backupset
7> spfile
8>       parameter_value_convert 'cprm', 'cdup'
9>   set db_file_name_convert='cprm', 'cdup'
10>   set log_file_name_convert='cprm', 'cdup'
11>   set db_name="cdup1212"
12>   set db_unique_name="cdup1212"
13>   reset log_archive_config
14>   reset standby_file_management
15>   reset fal_client
16>   reset fal_server
17>   reset log_archive_dest_2
18>   reset log_archive_dest_state_2
19> ;
20> debug off ;
21> }


+ Excerpt of output:
...
...
RMAN-08161: contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''CPRM1212'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''CDUP1212'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone from service  'CPRM1212_TNS' primary controlfile;
   alter clone database mount;
}
RMAN-08162: executing Memory Script

RMAN-06162: sql statement: alter system set  db_name =  ''CPRM1212'' comment=
''Modified by RMAN duplicate'' scope=spfile

RMAN-06162: sql statement: alter system set  db_unique_name =  ''CDUP1212''
comment= ''Modified by RMAN duplicate'' scope=spfile

RMAN-06402: Oracle instance shut down

RMAN-06196: Oracle instance started
....
....

Cause

 Due to many dependencies, RMAN needs to convert DB_NAME and DB_UNIQUE_NAME to UPPER case. This is confirmed by Development via Bug 21193086 raised for this issue.

Solution

Change the dependent automation scripts / procedures to adapt for UPPERCASE name for DB_NAME and DB_UNIQUE_NAME in cloned database.

Thanks
Srini

No comments:

Post a Comment


No one has ever become poor by giving