I dynamically generate this:
But you don't need to do all of that, you can also do this:Code:run { set newname for datafile 1 to '/oracle/oradata/db_name/system01.dbf'; set newname for datafile 2 to '/oracle/oradata/db_name/undo01.dbf'; set newname for datafile 3 to '/oracle/oradata/db_name/sysaux01.dbf'; set newname for datafile 4 to '/oracle/oradata/db_name/data.dbf'; set newname for datafile 5 to '/oracle/oradata/db_name/users01.dbf'; set newname for datafile 6 to '/oracle/oradata/db_name/indx01.dbf'; set newname for tempfile 1 to '/oracle/oradata/db_name/temp01.dbf'; duplicate target database to tmstr logfile group 1 ('/oracle/oradata/db_name/redo01a.log','/oracle/oradata/db_name/redo01b.log') size 52428800 reuse ,group 2 ('/oracle/oradata/db_name/redo02a.log','/oracle/oradata/db_name/redo02b.log') size 52428800 reuse ,group 3 ('/oracle/oradata/db_name/redo03a.log','/oracle/oradata/db_name/redo03b.log') size 52428800 reuse; }
The second example might be 11g only. Also I typed in the commandsCode:duplicate target database to dupdb from active database spfile parameter_value_convert 'sourcedb','dupdb' set sga_max_size=800M set sga_target=700M set log_file_name_convert= 'sourcedb','dupdb', db_file_name_convert 'sourcedb','dupdb';
and may have made mistakes. So you will need to test everything.![]()




Reply With Quote