Home » Server Options » Data Guard » Replace string (Oracle RDBMS 11g)
Replace string [message #651543] Thu, 19 May 2016 23:45 Go to previous message
Messages: 742
Registered: January 2007
Location: Ha Noi, Viet Nam
Senior Member
Good a day to everyone,

We have got a big database with 504 datafiles within, and I have got create a physical standby for it, ok, it's easy but difficult (of course, to me because of poor SQL) to convert string.

We have got datafile location as following

Primary: +DATA/wrhprim/datafile/data.279.907075777
DG: +DATA/wrhstd/datafile/data.279.907075777

The simply SQL to generate file_name location is

select 'set newname for datafile '''||file_name||''' to '''||''||file_name||''''||';'
     from dba_data_files where rownum<=10;

and the simply sql to get wrhprim is:

SELECT SUBSTR(file_name,7,7) from dba_data_files where rownum<=10;

But, I have no idea to put the convert string into one of SQL (wrhprim to wrhstd)

May you help me, thank you very much

[Updated on: Thu, 19 May 2016 23:47]

Report message to a moderator

Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Duplicate DB for Standby
Next Topic: No of archivelog generation between the period in RAC envirnoment
Goto Forum:

Current Time: Tue Sep 29 00:45:42 CDT 2020