Databases Reference
In-Depth Information
If you are duplicating a database to the same Oracle home as the primary database, you must use a different
DB_UNIQUE_NAME for the duplicate database. You can have an identical DB_NAME for both the original/source
database and the duplicate/auxiliary database even if they are hosted on the same server or using the same
ORACLE_HOME, as long as they have a different DB_UNIQUE_NAME.
You must also convert the file names (as in the example shown in the Solution section) so they're different
from the source database file names. Make sure you don't specify the nofilenamecheck clause while duplicating the
database on the same host, because this may cause the duplicate command to overwrite the primary database files.
Duplicating a Database Without Using RMAN Backups
Problem
You want to duplicate a database from a source database, but realize you don't have any backups of the source
database.
Solution
Starting with Oracle Database 11g, you can duplicate a source database entirely without any premade source database
backups whatsoever, by using network-based duplication of databases. As we mentioned earlier, this capability is also
called active database duplication. The steps are essentially the same as those we showed for the older backup-based
database duplication techniques earlier in this chapter, in Recipe 15-2.
Under RMAN's active database duplication strategy, you can use the source database files to duplicate a database
directly to the auxiliary instance. In active database duplication, the service name of the auxiliary instance is utilized
to copy the source database files and send them to the destination host as either image copies or backup sets. There's
absolutely no need for any preexisting backups to duplicate the source database.
In this solution, we describe an example showing how to perform active database duplication by specifying the
active database clause of the RMAN duplicate command. In the example, the source and duplicate databases are
on the same host, so you do need to use different database file names for the two databases. The source database is
named orcl and the duplicate database is named orcl2 . Here's the process:
1.
Add the following information to the tnsnames.ora file, located in the
$ORACLE_HOME/network/admin directory:
ORCL2=
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = virtual1.vm.alapati.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl2.vm.alapati.com)
)
)
2.
We're going to specify the spfile during our database duplication. You need only one
parameter, db_name , to denote the name of your new duplicate database. You don't need
to set the initialization parameters such as db_file_name_convert and log_file_name_
convert , because you're going to set these parameters directly in the duplicate database
command itself. So, the contents of the SPFILE for the auxiliary instance will look like this:
db_name = orcl2
 
Search WWH ::




Custom Search