Rman Cloning - what am i doing wrong? [message #484551] |
Wed, 01 December 2010 09:42 |
chris32680
Messages: 92 Registered: January 2006 Location: Charlotte
|
Member |
|
|
Hi all,
I'm attempting to teach myself RMAN with the hopes that we can eventually use it to clone our production DB to a production support DB and a QA DB.
We don't use RMAN for our backups, we have our on process for that, so I've attempted to use the 'duplicate ... from active database' command so that the backups aren't needed (if that's a problem, feel free to say so).
So i wrote my cloning script and was able to connect to both the target and the auxiliary db's (i'm running the RMAN session from the auxiliary db).
Here's some info:
10:30:45 >select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Solaris: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
(both target and aux db's are the exact same installation)
rman script:
run
{
set newname for datafile 1 to '/data2/oracle/QAdms/systemQAdms.dbf';
set newname for datafile 2 to '/data3/oracle/QAdms/sysauxQAdms.dbf';
set newname for datafile 3 to '/data3/oracle/QAdms/tsundoQAdms.dbf';
set newname for datafile 4 to '/data1/oracle/QAdms/ts1QAdms.dbf';
set newname for datafile 5 to '/data2/oracle/QAdms/ts2QAdms.dbf';
set newname for datafile 6 to '/data3/oracle/QAdms/ts3QAdms.dbf';
set newname for datafile 7 to '/data3/oracle/QAdms/ts4QAdms.dbf';
set newname for datafile 8 to '/data3/oracle/QAdms/ts5QAdms.dbf';
set newname for datafile 9 to '/data1/oracle/QAdms/tsarchQAdms.dbf';
set newname for datafile 10 to '/data1/oracle/QAdms/tsarchinxQAdms.dbf';
set newname for datafile 11 to '/data2/oracle/QAdms/tsidhQAdms.dbf';
set newname for datafile 12 to '/backup/oracle/QAdms/tsimagesQAdms.dbf';
set newname for tempfile 1 to '/data1/oracle/QAdms/tstempQAdms.dbf';
duplicate target database to QAdms from active database
pfile = /oracle/oracle11g_db/11.2.0/dbs/initQAdms.ora
LOGFILE
'/oracle/oracle11g_db/11.2.0/dbs/log1QAdms.dbf' size 100M,
'/oracle/oracle11g_db/11.2.0/dbs/log2QAdms.dbf' size 100M;
}
Auxiliary tnsnames.ora:
QA11.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = qazone.world)
(PROTOCOL = TCP)
(Host = qazone)
(Port = 1521)
)
)
(CONNECT_DATA =
(SID = QAdms)
(GLOBAL_NAME = QA11.world)
)
)
PRODdb =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = LHTECH11.world)
(PROTOCOL = TCP)
(Host = lancelot)
(Port = 1521)
)
)
(CONNECT_DATA =
(SID = Lhtech2)
(GLOBAL_NAME = PRODdb)
)
)
qazone_tcp_QAdms=
(DESCRIPTION=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=qazone)
(PORT=1521))
(CONNECT_DATA=(SID=QAdms))
Target tnsnames.ora: (irrelevant entries removed)
QA11.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = qazone.world)
(PROTOCOL = TCP)
(Host = qazone)
(Port = 1521)
)
)
(CONNECT_DATA =
(SERVICE_NAME = QAdms.lhtech.com)
)
)
so i created a password file on the auxiliary db. Started the db in nomount mode.
Then executed my RMAN script. Here is the output.
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Dec 1 10:22:41 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: LHTECH2 (DBID=1305885601)
connected to auxiliary database: QADMS (not mounted)
RMAN>
RMAN> run
2> {
3> set newname for datafile 1 to '/data2/oracle/QAdms/systemQAdms.dbf';
4> set newname for datafile 2 to '/data3/oracle/QAdms/sysauxQAdms.dbf';
5> set newname for datafile 3 to '/data3/oracle/QAdms/tsundoQAdms.dbf';
6> set newname for datafile 4 to '/data1/oracle/QAdms/ts1QAdms.dbf';
7> set newname for datafile 5 to '/data2/oracle/QAdms/ts2QAdms.dbf';
8> set newname for datafile 6 to '/data3/oracle/QAdms/ts3QAdms.dbf';
9> set newname for datafile 7 to '/data3/oracle/QAdms/ts4QAdms.dbf';
10> set newname for datafile 8 to '/data3/oracle/QAdms/ts5QAdms.dbf';
11> set newname for datafile 9 to '/data1/oracle/QAdms/tsarchQAdms.dbf';
12> set newname for datafile 10 to '/data1/oracle/QAdms/tsarchinxQAdms.dbf';
13> set newname for datafile 11 to '/data2/oracle/QAdms/tsidhQAdms.dbf';
14> set newname for datafile 12 to '/backup/oracle/QAdms/tsimagesQAdms.dbf';
15> set newname for tempfile 1 to '/data1/oracle/QAdms/tstempQAdms.dbf';
16> duplicate target database to QAdms from active database
17> pfile = /oracle/oracle11g_db/11.2.0/dbs/initQAdms.ora
18> LOGFILE
19> '/oracle/oracle11g_db/11.2.0/dbs/log1QAdms.dbf' size 100M,
20> '/oracle/oracle11g_db/11.2.0/dbs/log2QAdms.dbf' size 100M;
21> }
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting Duplicate Db at 01-DEC-10
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:
{
sql clone "create spfile from memory";
}
executing Memory Script
sql statement: create spfile from memory
contents of Memory Script:
{
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 8554127360 bytes
Fixed Size 2165208 bytes
Variable Size 4378859048 bytes
Database Buffers 4160749568 bytes
Redo Buffers 12353536 bytes
contents of Memory Script:
{
sql clone "alter system set db_name =
''LHTECH2'' comment=
''Modified by RMAN duplicate'' scope=spfile";
sql clone "alter system set db_unique_name =
''QADMS'' comment=
''Modified by RMAN duplicate'' scope=spfile";
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format '/oracle/oracle11g_db/11.2.0/dbs/cntrlQAdms.dbf';
restore clone controlfile to '/oracle/oracle11g_db/11.2.0/dbs/QAdms/cntrl2QAdms.dbf' from
'/oracle/oracle11g_db/11.2.0/dbs/cntrlQAdms.dbf';
restore clone controlfile to '/data3/oracle/QAdms/cntrl3QAdms.dbf' from
'/oracle/oracle11g_db/11.2.0/dbs/cntrlQAdms.dbf';
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ''LHTECH2'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set db_unique_name = ''QADMS'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 8554127360 bytes
Fixed Size 2165208 bytes
Variable Size 4378859048 bytes
Database Buffers 4160749568 bytes
Redo Buffers 12353536 bytes
Starting backup at 01-DEC-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=13 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 12/01/2010 10:23:29
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 12/01/2010 10:23:29
ORA-17629: Cannot connect to the remote database server
ORA-17627: ORA-01017: invalid username/password; logon denied
ORA-17629: Cannot connect to the remote database server
RMAN> **end-of-file**
RMAN>
RMAN>
Recovery Manager complete.
I can't seem to find anywhere what is causing this error. The passwords used to connect to the target and auxiliary DB's ARE correct. I'm also not sure WHICH database server this is referring to.
Any idea?
Thanks!
|
|
|
|
Re: Rman Cloning - what am i doing wrong? [message #484555 is a reply to message #484553] |
Wed, 01 December 2010 10:03 |
chris32680
Messages: 92 Registered: January 2006 Location: Charlotte
|
Member |
|
|
BlackSwan wrote on Wed, 01 December 2010 10:57With V11 by default passwords are NOW case sensitive.
Just asking. Might this be your problem?
Thanks for the reply. I actually thought about that, so i made sure that the passwords were all lowercase to remove any variables.
So no, i don't think that's it.
|
|
|
|
Re: Rman Cloning - what am i doing wrong? [message #484562 is a reply to message #484561] |
Wed, 01 December 2010 10:50 |
chris32680
Messages: 92 Registered: January 2006 Location: Charlotte
|
Member |
|
|
hmm..
Well i've created a password file on both servers (one for the target and one for the aux).
I made sure to be consistent with case.
and the "cannot connect to the remote database server" error is still happening.
Any idea which server it's talking about? I would assume that since i'm running RMAN from the aux server, that it's referring to the target server...but i could be wrong i guess.
Thanks
|
|
|
|
|
|
Re: Rman Cloning - what am i doing wrong? [message #484579 is a reply to message #484577] |
Wed, 01 December 2010 12:45 |
chris32680
Messages: 92 Registered: January 2006 Location: Charlotte
|
Member |
|
|
John Watson wrote on Wed, 01 December 2010 13:28I think you've hit two problems. First you must connect to the target locally, and to the auxilliary through SQL*Net. This is documented,
http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmdupdb.htm#CHDCAIAB
and last time I tested it didn't work the other way round (as you are doing). Secondly, there are known bugs with the 11g password file, you must create it with ignorecase and it is not enough to have the smae password both sides: you must copy and rename it.
Hope this helps.
John.
John, i think you got it. For some reason i was under the impression that i had to initiate this from the auxiliary server. I read it somewhere...but that's not an issue i suppose. The processess appears to be moving along now.
EDIT. oh...and thanks a TON!
[Updated on: Wed, 01 December 2010 13:21] Report message to a moderator
|
|
|
|
Re: Rman Cloning - what am i doing wrong? [message #499652 is a reply to message #499262] |
Tue, 15 March 2011 11:40 |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
Quote:Contents of memory scripts:
{
Shutdown clone;
Startup clone nomount;
}
Executing memory script
now it is taking too much time
Do u have any idea about it?how much time it will take?
Ensure that there are no other sessions logged into the database. "SHUTDOWN CLONE" is the same as a normal "SHUTDOWN" so will wait on any logged in sessions before closing the database.
HTH
-g
|
|
|