Wednesday, December 27, 2023

Oracle: Will "set newname for database to new" work in active DB duplication?

Dears,

Today, while I was assisting my colleague to get a standby db build using active db duplication command.

Source DB is 30TB in size.

Background: the standby database was activated last saturday due to primary server hardware issue.

We were left with no flashback option, since it wasnt enabled. So db restore in the old primary was the only way to reinstate (we differed OS utilities).


Challenge: The db had a mix of non-OFM and OFM format of datafiles.

So I discussed with my colleague and proposed to move all the files to OMF format for 

  1. auto standby file management
  2. ease of datafile maintenance operations later

We noticed the DB had
  • db_file_name_convert
  • db_create_file_dest
parameters set. When I fired the active db duplication asis, with no change to these 2 param setting.
I noticed, Oracle trying to restore even the OMF files into the same path in target as if it is restoring the non-OMF files (file names had encrypted identity).

So I decided to remove db_file_name_convert, after reading oracle doc, I felt this is the main culprit.
To ensure the datafiles gets the benefit of db_create_file_dest parameter, I introduced

"set newname for database to new" as well to the duplicate rman run command.

run
{
allocate channel prmry1 type disk;
...
allocate channel auxiliary channel stby1 type disk;
...
set newname for database to new;
duplicate target database for standby from active databvase
dorecover
spfile
   parameter...
...
NOFILENAMECHECK;
}

All the files got restored to the location indicated by db_create_file_dest as I expected.
This worked perfectly fine.

Thanks

No comments:

Post a Comment

Troubleshooting the “Cannot Generate SSPI Context” Error After SQL Server Migration

  Introduction After a recent  SQL Server migration from 2012 to 2022 , our team encountered a classic authentication issue: The target prin...