Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Sam.

Asked: July 16, 2016 - 11:16 am UTC

Last updated: November 15, 2017 - 1:58 am UTC

Version: Oracle 11g

Viewed 10K+ times! This question is

You Asked

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






and Connor said...

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.

Rating

  (4 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Still getting error

Sam Mathews, July 18, 2016 - 7:05 am UTC

Yes i can connect from both end i.e from primary to standby and standby to primary but now when i am running this command i am getting

RMAN> DUPLICATE target database to newappdb from active database
2> nofilenamecheck
3> spfile  set control_files 'E:\app\user\oradata\newappdb\control01.ctl', 'E:\app\user\oradata\newappdb\control02.ctl'
4> set db_file_name_convert 'D:\app\Admin\oradata\appdb','E:\app\user\oradata\newappdb'
5> set log_file_name_convert 'D:\app\Admin\oradata\appdb','E:\app\user\oradata\newappdb';


Starting Duplicate Db at 18-JUL-16
using channel ORA_AUX_DISK_1

contents of Memory Script:
{
backup as copy reuse
targetfile 'D:\APP\ADMIN\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEAPPDB.ORA' a
uxiliary format
'E:\APP\USER\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILENEWAPPDB.ORA' ;
sql clone "alter system set spfile= ''E:\APP\USER\PRODUCT\11.2.0\DBHOME_1\DAT
ABASE\SPFILENEWAPPDB.ORA''";
}
executing Memory Script

Starting backup at 18-JUL-16
using channel ORA_DISK_1
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 07/18/2016 10:38:02
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 07/18/2016 10:38:
02
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-01031: insufficient privileges
ORA-17629: Cannot connect to the remote database server


Connor McDonald
July 20, 2016 - 11:22 pm UTC

Could it be that you just *set* the password on each db that same. That's not enough, you have to *copy* the password file.

-

But why must password files actually be copied?

Thomas Gaines, December 13, 2016 - 12:35 am UTC

Connor -

I'm very familiar with the requirement to copy password files from the primary server (or servers in the case of a RAC One Node or "regular" RAC database) to the standby server (or servers). I do this semi-often and generally use the Unix cksum program to ensure that my password files are consistent.

My dumb question to you, however...

Why is this necessary? Long ago, I figured that simply creating the password file using orapwd would be sufficient as long as the identical password was specified. I know now that it's NOT sufficient. But why? Is there some super-hidden or super-secret stuff in the primary password file (DBID, for example) that the standby needs? Can you help me understand?

Thanks!

Tom G.
Connor McDonald
December 13, 2016 - 2:23 am UTC

"Can you help me understand? "

No :-)

Simply because I dont know the *why* of the rule, just that I know that the rule exists. In Oracle 9/10, the documented way was to run orapwd on each node. That changed in 11g (maybe 10.2) to "copy the file". Based on this, I have a *hypothesis* that I'll share, but I have no proof to back this up.

My *guess* is that there was a security issue found in orapwd, and thus the encryption facility was perhaps extended to add some pseudo-random "salt" into the password hashing. Thus if you repeated the orapwd on each node, the salt could be different, and hence problems could arise when one node wants to connect to the other, but uses its "local" salt.


Sunny, December 13, 2016 - 4:28 am UTC

I have little confuse with creating duplicating database.
I have two database one is primary and another is duplicate database.
Now main question is when we want to apply duplicate database operation so i need to install oracle 11g software only or creating database also using dbca utility.
In advance 10x For Solve my Problem.
:)
Connor McDonald
December 15, 2016 - 1:45 am UTC

The software must exist on both nodes.

A listener must be running on both nodes (you can setup that up 'netca')

Then you run the duplicate with rman.

Cannot connect to the remote database server

Regina Sawyer, November 14, 2017 - 3:35 pm UTC

Yes! That is the correct answer Connor McDonald!

The "Sys" passwords must be the same on BOTH target and auxiliary database. Once I made this simple change it worked like charm.

Thank You!
Connor McDonald
November 15, 2017 - 1:58 am UTC

Glad we could help

More to Explore

Backup/Recovery

Check out the complete guide to all of the Backup & Recovery techniques in the Oracle Database.