Prior to Oracle Database 11g,database duplication through RMAN always meant backup-basedduplication,since the duplicatedatabase relied on the source data base’s datafile and archived redo log backups.
In Oracle Database 11g, you can directly duplicate a database over the network without having to back up and provide thesource database files.This direct database duplication is called active databaseduplication or network-aware database duplication.
This is definitely one of Oracle Database 11g’s more useful innovations, since you can create duplicate databases andstandby data bases directly from a live production database,with only an overhead in terms of additional CPU and networkutilization for the duplication process.RMAN simply copies the target database files to the destination server (it can be the same server) over a network connection.
Until the Oracle Database 11g release, duplicating a destination database with RMAN meantyou had to have all of the following:
When you use the network-enabled active database duplication, the process of duplicating is considerably simpler.You don’t need any previously made backup of the source database,and you are able to duplicate a live production database to a duplicateinstance or create a physical standby database over the network without actually restoring a previously existing backup.
You can perform this network-aware, backup-less databaseduplication either with Database Control or through RMAN.You still use the RMAN duplicate data base command, but with a new clause named from active data base,to let RMAN know you aren’t using backups as the source but are instead using the network for the database duplication.
The database files are directly copied over the networkconnection from the source database to the new destination database.
Unlike in the case of a normal backup-based databaseduplication,you don’t have to use the until clause when performing an active database duplication. RMAN automatically selects completed, so it can recover the datafiles to a consistent point in time.Because RMAN doesn’t copy the online redo log files and apply them to the duplicate database, it must always perform an incomplete recovery. RMAN can recover the duplicate database to the point in time of the latest archived redo log on the source database.
Here are the requirements you must satisfy before starting active database duplication over the network:
The source database remains fully accessible to users while you’re performing the database duplication,which is yet another great feature of the active database duplication technique.Of course, be prepared to take a slight hit on CPU usage andnetwork bandwidth consumption during the datafile duplication.
Necessary Spfile Modifications
In Oracle Database 10g, you didn’t copy the spfile as part of a database duplication process.You had to first copy the spfile to the destination server and modify it to suit the duplicate database’s requirements.
In Oracle Database 11g, you can specify the spfile clause in the database duplication command for both the new active database duplication (network-enabled duplication) as well as traditional backup-based database duplication. By specifying the new spfile clause,you direct RMAN to copy the source data base’s spfile to the destination server.
For this to happen,you must have started the source database with a server parameter file.Before RMAN processes the duplicate database command,it first copies over this spfile,modifies it based on the settings in the spfile clause,and starts up the auxiliary instance with this modified server para meter file.If you use the spfile command in your duplicate database command, parameter file (init.ora)
When you duplicate a database, RMAN has to generate names for the duplicate database’s data files,controlfiles,online redo log files, and tempfiles.If you’re using the same directory structure on a different host,you can use identical database file names as the source database.
You must specify the nofilenamecheck clause in the duplicate database command when you do this to avoid errors.If the duplicate host uses a diffe rent directory structure or you want to rename the database files for some reason, you must adopt a strategy to generate the new datafile names during the database duplication processThe simplest way to generate file names is to specify the spfile clause in the duplicate command, as shown here:
The spfile clause lets you set all the file name–relatedparameters (except the db_file_name_convert parameter).If you’re using the backup-based dupli cation method, RMANrestores the server parameter file from a backup of the source database server parameter file.If you are using the activedatabase duplication method,on the other hand,RMAN will copy the server parameter file currently being used by the source database.
RMAN copies or restores this spfile to the default location for the auxiliary instance on the host where it’s running.If you don’t specify the spfile clause, you must copy the server parameter file yourself.You can also specify a normal text-based initialization parameter(pfile) by speci fying the pfile parameter instead of the spfile parameter as part of the duplicate command.
You can provide values for the parameter_value_convert clause when you use the spfile to specify all path names except the db_file_name_convert and log_file_name_convert parameters.
The real purpose of the parameter_value_convert clause is to set the values of a bunch of initialization parameters when creating the duplicate database.
RMAN will update the initialization parameter values in the spfile it copied (or the backed-up spfile if you are using the backup-method of duplication) based on the values you provide for the parameter_value_convert and set parameters.RMAN will then start the new duplicate (auxiliary) instance with the updated server parameter values.
If you specify the spfile clause with the duplicate command, you must have started the auxiliary instance already with a text-based initialization para meter file (with one requiredparameter,db_name).If you haven’t specified the from active database clause in the duplicate command,RMAN will copy the binary server parameter file and restart the auxiliary instance based on the modified settings gathered from the spfile clause. If you specify the from active database clause in the duplicate command,then the source instance must be using a serverparameter file.
If you don’t want to use the spfile clause technique for naming the duplicate files, you can use alternative file-namingtechniques. You can also choose to use the spfile clause to name the files and supplement that technique with one or more of the alternative techniques.
Use the Oracle-recommended spfile clause in the duplicate command to set all necessary parameters involving file names for the duplicate database.This is by far more straightforward and easier than using the alternative technique ofdb_file_name_convert and other file name–convertingparameters.Thefollowing are the various options you can use to rename files when you’re duplicating a database:
Here’s a simple example that shows how to use the spfile clause within the duplicate command to name datafiles and log files of the duplicate database during the duplication process:
The db_file_name_convert clause substitutes the string/u05/app/oracle in the names of the duplicate database’s datafiles (and tempfiles).
The parameter_value_convert clause in our example specifies the string /u05/app/oracle to be used in all initialization parameters that specify 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 initialization parameters, including the log_file_name_convertparameter,which specifies the substitution of/u05/app/oracle in the file names of the duplicate database’s online redo log files.
Performing Active Duplication
You use the familiar RMAN command, duplicate database, to perform active database duplication,with one importantmodification—you add the new clause from active database toindicate that the source database files must be copied directly from the target database rather than from the target database backups,as is the case in normal database duplication.You can create a duplicate database on a different server using anidentical directory structure as the target database by using the following basic active database duplication command:
The spfile clause means that RMAN will copy the targetdatabase’s spfile over to the destination database.If the destination database is on a different server,the spfile is copied to the new server.Of course,since we aren’t specifying any additional subclauses under the spfile clause to either set or modify any initialization parameters,the source database’s spfile is copied intact to the destination instance.
The nofilenamecheck clause is mandatory because you’respecifying that the duplicate database’s file names be identical to those of the source database (and the two databases are on different hosts).
In the following sections, we’ll explore the specific steps you must take to perform active database duplication.
Setting Initialization Parameter Values
If you don’t have any further clauses after the spfile clause,all the settings in the source database are copied over to the destination database’s spfile.If you want to override the source database settings for any initialization parameters of thedestination database,you can do so by using one or more set clauses.The set clause specifies the value of a specifiedinitialization parameter.Here is an example showing how to set values for various parameters:
In the example shown in the previous section, since the files on the destination server and the target server are identical, you didn’t have to specify any additional clauses in your database duplication command to dictate the naming convention for the datafiles or log files.
An Active Database Duplication Example
Let’s duplicate a database to learn how powerful the activedatabase duplication feature is.For simplicity, we’ll perform the database duplication on the same server as the target database. You don’t need any backups to start the database duplication process.
In the example,the source and the duplicate databases are on the same host, so we make sure we use different through a transfer of files over the network through the Oracle Net???connection.That’s why the first step for active database duplication is to establish Oracle Net connectivity.
We’re not using a recovery catalog in this example. If you’re using the recovery catalog, you must of course also connect to the recovery catalog at this point.
RMAN automatically updates the spfile on the server hosting the duplicate database based on the values you provided through the parameter_value_convert and set clauses of the duplicate database command.RMAN then starts the auxiliary instance with the updated spfile and proceeds to copying the source database files over the network.Once this is done,it recovers the duplicate database and opens it with the resetlogs option,thus creating a new set of online redo logs.
In our simple example here,we duplicated an entire database to the same server.You can also use the active duplication technique to duplicate a database to a different server.You can also perform duplication to a past point in time,as well as file system–to–ASM and ASM-to- ASM duplications over the network,just as in the case of traditional backup-based database duplication.
How Network-Enabled Duplication Works
The from active database clause of the RMAN duplicate command starts the database duplication process.RMAN utilizes the network connection to copy the source database files to the auxiliary instance.After copying the datafiles, RMAN performs a database recovery by using a memory script (so named because it exists only in memory) before opening the duplicate database.
The following duplicate database command shows how much simpler the duplication command is when you perform the database duplication on a different host with an identical directory structure as well as datafile names:
You must specify the nofilenamecheck clause in this case, since you’re using the same directory structures for both the source and destination databases.If you want RMAN to copy the entire password file from the source database to the duplicate database,specify the optionalpassword file clause in the duplicate database command.In this example,the password file was created manually instead of specifying the password file clause.
When you perform active database duplication over the network,the various files that are part of the database duplication are copied or re-created, as shown in the following list:
To create a standby database instead of a duplicate database,just replace the to auxdb part of the duplicate database command with the for standby clause, as shown in the following example:
It’s easy to duplicate a non-ASM file-based database to an ASM file system.To do this,first create an ASM disk group,before running the duplicate database command. Here’s an example:
The duplicate database command shown here creates a database with all of its datafiles, controlfiles,and online redo logs in the ASM disk group +DISK2.
If you want faster duplication of a database,you must increase the number of disk channels on the source database,which leads to a parallel copying of the source database files.
Oracle 11g Related Interview Questions
|Oracle 10g Interview Questions||Oracle 9i Interview Questions|
|Oracle 8i Interview Questions||Informatica Interview Questions|
|PL/SQL Interview Questions||Oracle 11g Interview Questions|
|SQL Interview Questions||Oracle apps Interview Questions|
|Sybase Interview Questions||Oracle Apps ERP Interview Questions|
|Oracle 7.3 Interview Questions||Oracle Access Manager Interview Questions|
|Oracle Application Framework Interview Questions||Oracle Apps DBA Interview Questions|
Oracle 11g Related Practice Tests
|Oracle 10g Practice Tests||Oracle 9i Practice Tests|
|Oracle 8i Practice Tests||Informatica Practice Tests|
|PL/SQL Practice Tests||Oracle 11g Practice Tests|
|SQL Practice Tests||Oracle apps Practice Tests|
|Sybase Practice Tests||Oracle Apps ERP Practice Tests|
|Oracle 7.3 Practice Tests|
Oracle 11g Tutorial
Installing, Upgrading, And Managing Change
Database Diagnosability And Failure Repair
Backup And Recovery
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.