Database Reference
In-Depth Information
Step 2. Copy the RMAN Backup to the Destination Server
For this step, use a utility such as
rsync
or
scp
to copy the backup pieces from one server to another. This example
uses the
scp
command to copy the backup pieces:
$ scp rman* oracle@DEVBOX:/ora01/rman/DEVDB
In this example the
/ora01/rman/DEVDB
directory must be created on the destination server before copying the
backup files. Depending on your environment, this step might require copying the RMAN backups twice: once from
the production server to a secure server and once from the secure server to a test server.
■
If the rMaN backups are on tape instead of on disk, then the same media manager software must be installed/
configured on the destination server. also, that server must have direct access to the rMaN backups on tape.
Note
Step 3. Ensure That Oracle Is Installed
Make sure you have the same version of the Oracle binaries installed on the destination server as you do on the
originating database.
Step 4. Source the Required OS Variables
You need to establish the OS variables, such as
ORACLE_SID
,
ORACLE_HOME
, and
PATH
. Typically, the
ORACLE_SID
variable is initially set to match what it was on the original database. The database name will be changed as part of the
last step in this recipe (optional). Here are the settings for
ORACLE_SID
and
ORACLE_HOME
on the destination server:
$ echo $ORACLE_SID
O12C
$ echo $ORACLE_HOME
/ora01/app/oracle/product/12.1.0.1/db_1
At this point also consider adding the Oracle SID to the
oratab
file. If you plan on using this database after you've
replicated it, then you should have an automated method for setting the required OS variables. See Chapter 1 for
details on sourcing OS variables in conjunction with the
oratab
file.
Step 5. Create an init.ora File for the Database to Be Restored
Copy the
init.ora
file from the original server to the destination server, and modify it so that it matches the
destination box in terms of any directory paths. Ensure that you change the parameters, such as the
CONTROL_FILES
, to
reflect the new path directories on the destination server (
/ora01/dbfile/DEVDB
, in this example).
Initially, the name of the
init.ora
file is
ORACLE_HOME/dbs/inito12c.ora
, and the name of the database is
O12C
.
Both will be renamed in a later step. Here are the contents of the
init.ora
file:
control_files='/ora01/dbfile/DEVDB/control01.ctl',
'/ora01/dbfile/DEVDB/control02.ctl'
db_block_size=8192
db_name='O12C'
log_archive_dest_1='location=/ora01/arc/DEVDB'