Sunteți pe pagina 1din 2

Oracle Database Clone using RMAN

--------------------------------1. Create PFILE for clone database and copy it to clone server
2. Take backup of Production Database and copy it to Clone Server
3. Start Auxillary Instance on Clone Server and Restore the database.
4. Open the Database in Reset Logs
5. Test Clonedb
1-creating pfile for clone database from production spfile.
SQL> create pfile='tmp/initclonedb.ora' from spfile;
copy created spfile to clone DB, ORACLE_HOME/dbs location.
$> SCP 'tmp/initclonedb.ora' oracle@192.82.164.7:/O_H/dbs
c) change Database name in the Parameter file
Change Location details as per Clone DB on Parameter file.
Create all Directories
Edit the /etc/oratab with clone DB details
-- clonedb:)RACL
E_HOME_LOCATION:N
2-Take Backup of Production Database
$> rman target /
RMAN> backup database plus archivelog;
Copy all backup sets to clone server.
scp -r backupset oracle@192.82.164.7:/O_H/flash-recovery/
3-Create a TNS service name on Clonedb
first test,
$> tnsping prodb
il fail

//this w

Create new Service


$>netmgr
// this will open window, create
service name to access DATABSE in other network
NET SERVICE NAME: prodb
Connection type: TCP/IP
--first option
HOSTNAME: IP Address
Service Name: prodb
Test Connectivity
st failes, make sure Listener is running in production DB.
$> tnsping prodb
il be Success
4-Start up CloneDB in NOMOUNT state

-- If te

//this w

SQL> startup nomount


SQL> rman
RMAN> connect auxiliary /
--connect to Auxiliary Database
RMAN> connect target username/password@prodb
duction Database

--connect to Pro

RMAN> run
{
allocate auxiliary channel c1 device type disk;
allocate channel c2 device type disk;
duplicate target database to 'clonedb';
}
--This will create all directory structure in cloedb comparing with Production D
B
--DB files will be automatically detected and copied due to DB_CONVERT parameter
RMAN> exit

$> SQLPLUS / as sysdba


SQL> select instance_name,status from v$instance;
-- clonedb, OPEN
SQL> select name, open_mode from v$database;
-- clonedb , READ / WRITE

S-ar putea să vă placă și