I Want to clone a database from one computer to another computer, both computer connected with lan.
The database which i have to clone is available on computer 2. on computer 1 i have created an instance using oradim utility
On computer 2
oradim -new -sid newappdb
Then i created password file
orapwd password=1234 file='location'
i can connect to database on computer1 as i have already configured tnsnames.ora
created pfile and entered db_name='newclonedb'
startup nomount pfile='location'
database started
then
C:\Windows\system32>rman target=sys/oracle@appdb auxiliary sys/1234@newappdb;
Recovery Manager: Release 11.2.0.1.0 - Production on Sat Jul 16 17:29:22 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: APPDB (DBID=123456789)
connected to auxiliary database: NEWAPP (not mounted)
RMAN> DUPLICATE target database to newappdb from active database
2> nofilenamecheck
3> spfile set control_files 'C:\oradata\newappdb\control01.ctl', 'C:\oradata\newappdb\control02.ctl'
4> set db_file_name_convert 'D:\app\Admin\oradata\appdb','C:\oradata\newappdb'
5> set log_file_name_convert 'D:\app\Admin\oradata\appdb','C:\oradata\newappdb';
Starting Duplicate Db at 16-JUL-16
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile 'D:\APP\ADMIN\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEAPPDB.ORA' auxiliary format
'C:\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILENEWAPPDB.ORA' ;
sql clone "alter system set spfile= ''C:\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILENEWAPPDB.ORA''";
}
executing Memory Script
Starting backup at 16-JUL-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=70 device type=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/16/2016 17:30:18
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/16/2016 17:30:18
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-12154: TNS:could not resolve the connect identifier specified
ORA-17629: Cannot connect to the remote database server
This often catches me out as well. During an RMAN duplicate, we connect to both instances in both "directions"..
So before you start the duplicate make sure you can successfully do:
connect sys/oracle@appdb
connect sys/1234@newappdb
from both the primary node *and* the new node.
Hope this helps.