11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

292 CHAPTER 6 ■ BACKUP AND RECOVERYUse the <strong>Oracle</strong>-recommended spfile clause in the duplicate command to set all necessaryparameters involving file names for the duplicate database. This is by far more straightforwardand easier than using the alternative technique of db_file_name_convert and other file name–converting parameters. The following are the various options you can use to rename files whenyou’re duplicating a database:• spfile ... parameter_value_convert 'string_pattern' specifies conversion strings forall initialization parameters specifying path names, except two: db_file_name_convertand log_file_name_convert. In addition to specifying path names, the parameter_value_convert clause also lets you update any string values.• Use spfile ... set 'string_pattern' to set the log_file_name_convert parameter forthe online redo log files. The set clause lets you specify initialization parameters to thevalues you want. For example, you can use the set clause to specify initialization parameterssuch as sga_target or turn off replication options. In essence, the set functionalityamounts to temporarily stopping the database duplication process in midstream afterrestoring the server parameter file and issuing the alter system set statement to changethe initialization parameter values. The parameter_value_convert clause is processedbefore the set clauses, and values you set for an initialization parameter using the setclause will override any identical initialization parameter settings that you specify throughthe parameter_value_convert clause.• Use the db_file_name_convert 'string_pattern' to specify file-naming rules for creatingthe duplicate database’s datafiles and tempfiles.Here’s a simple example that shows how to use the spfile clause within the duplicatecommand to name datafiles and log files of the duplicate database during the duplicationprocess:RMAN> duplicate database to dupdb2> from active database3> db_file_name_convert '/u01/app/oracle','/u05/app/oracle'4> spfile5> parameter_value_convert '/u01/app/oracle','/u05/app/oracle'6> set log_file_name_convert '/u01/app/oracle','/u05/app/oracle'7> set sga_max_size '3000m'8> set sga_target '2000m';The db_file_name_convert clause substitutes the string /u05/app/oracle in the names ofthe duplicate database’s datafiles (and tempfiles). The parameter_value_convert clause in ourexample specifies the string /u05/app/oracle to be used in all initialization parameters thatspecify file names for the duplicate database, except the db_file_name_convert and log_file_name_convert parameters. Note the use of the multiple set clauses to specify various initializationparameters, including the log_file_name_convert parameter, which specifies the substitution of/u05/app/oracle in the file names of the duplicate database’s online redo log files.Performing Active DuplicationYou use the familiar RMAN command, duplicate database, to perform active database duplication,with one important modification—you add the new clause from active database to

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!