Home » RDBMS Server » Backup & Recovery » Duplicate target database unable to open database (10g, 10.2.0.1, OEL)
Duplicate target database unable to open database [message #589181] Wed, 03 July 2013 03:46 Go to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
Dear All,

I ran the script "Duplicate target database for standby" but it unable to open the database. Please let us know where is problem I have done. Below are the rman scripts -



calhost dbs]$ rman target sys/oracle@PRODDB auxiliary sys/oracle

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jun 25 06:09:33 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: PRODDB (DBID=558988263)
connected to auxiliary database: PRODDB (not mounted)

RMAN> duplicate target database for standby;

Starting Duplicate Db at 25-JUN-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK

contents of Memory Script:
{
   restore clone standby controlfile;
   sql clone 'alter database mount standby database';
}
executing Memory Script

Starting restore at 25-JUN-13
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: copied control file copy
input filename=/u01/ora10g/oradata/proddb/stancontrol.ctl
output filename=/u01/ora10g/oradata/standdb/control01.ctl
output filename=/u01/ora10g/oradata/standdb/control02.ctl
output filename=/u01/ora10g/oradata/standdb/control03.ctl
Finished restore at 25-JUN-13

sql statement: alter database mount standby database
released channel: ORA_AUX_DISK_1

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/ora10g/oradata/standdb/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/ora10g/oradata/standdb/system01.dbf";
   set newname for datafile  2 to
 "/u01/ora10g/oradata/standdb/undotbs01.dbf";
   set newname for datafile  3 to
 "/u01/ora10g/oradata/standdb/sysaux01.dbf";
   set newname for datafile  4 to
 "/u01/ora10g/oradata/standdb/users01.dbf";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to /u01/ora10g/oradata/standdb/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 25-JUN-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=159 devtype=DISK

channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u01/ora10g/oradata/standdb/undotbs01.dbf
restoring datafile 00003 to /u01/ora10g/oradata/standdb/sysaux01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u02/archive/02od1sku_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u02/archive/02od1sku_1_1 tag=TAG20130625T035922
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:37
channel ORA_AUX_DISK_1: starting datafile backupset restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/ora10g/oradata/standdb/system01.dbf
restoring datafile 00004 to /u01/ora10g/oradata/standdb/users01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u02/archive/01od1sks_1_1
channel ORA_AUX_DISK_1: restored backup piece 1
piece handle=/u02/archive/01od1sks_1_1 tag=TAG20130625T035922
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:56
Finished restore at 25-JUN-13

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy recid=5 stamp=819007950 filename=/u01/ora10g/oradata/standdb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=6 stamp=819007950 filename=/u01/ora10g/oradata/standdb/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=7 stamp=819007950 filename=/u01/ora10g/oradata/standdb/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=8 stamp=819007950 filename=/u01/ora10g/oradata/standdb/users01.dbf
Finished Duplicate Db at 25-JUN-13

RMAN> exit


Recovery Manager complete.
[kumar@localhost dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 25 06:12:54 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-16004: backup database requires recovery
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '/u01/ora10g/oradata/standdb/system01.dbf'



Though I have taken the same backup but it's suggesting about the system datafile.

Require your kind response on the same..

Regards,
Ishika
Re: Duplicate target database unable to open database [message #589189 is a reply to message #589181] Wed, 03 July 2013 04:13 Go to previous messageGo to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
I tried to ran the duplicate script after transferring new rman backup to standby. Even after transferring the backup, duplicate command unable to open the database.

Regards,
Ishika
Re: Duplicate target database unable to open database [message #589190 is a reply to message #589189] Wed, 03 July 2013 04:19 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Expected behavior.
You did the duplication for standby without performing recovery.
http://docs.oracle.com/cd/B19306_01/server.102/b14239/rcmbackp.htm#i637825
Re: Duplicate target database unable to open database [message #589212 is a reply to message #589190] Wed, 03 July 2013 06:11 Go to previous messageGo to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
Dear Mahesh,

Thanks for the link.

I tried but still facing problem. Please help me out

SQL> startup nomount;
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              83888372 bytes
Database Buffers           79691776 bytes
Redo Buffers                2973696 bytes
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[kumar@localhost dbs]$ rman target sys/oracle@PRODDB auxiliary sys/oracle

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jun 25 07:07:14 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: PRODDB (DBID=558988263)
connected to auxiliary database: PRODDB (not mounted)

RMAN> duplicate target database for standby nofilenamecheck;

Starting Duplicate Db at 25-JUN-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK

contents of Memory Script:
{
   restore clone standby controlfile;
   sql clone 'alter database mount standby database';
}
executing Memory Script

Starting restore at 25-JUN-13
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: copied control file copy
input filename=/u01/ora10g/oradata/proddb/stancontrol.ctl
output filename=/u01/ora10g/oradata/standdb/control01.ctl
output filename=/u01/ora10g/oradata/standdb/control02.ctl
output filename=/u01/ora10g/oradata/standdb/control03.ctl
Finished restore at 25-JUN-13

sql statement: alter database mount standby database
released channel: ORA_AUX_DISK_1

contents of Memory Script:
{
   set newname for tempfile  1 to
 "/u01/ora10g/oradata/standdb/temp01.dbf";
   switch clone tempfile all;
   set newname for datafile  1 to
 "/u01/ora10g/oradata/standdb/system01.dbf";
   set newname for datafile  2 to
 "/u01/ora10g/oradata/standdb/undotbs01.dbf";
   set newname for datafile  3 to
 "/u01/ora10g/oradata/standdb/sysaux01.dbf";
   set newname for datafile  4 to
 "/u01/ora10g/oradata/standdb/users01.dbf";
   restore
   check readonly
   clone database
   ;
}
executing Memory Script

executing command: SET NEWNAME

renamed temporary file 1 to /u01/ora10g/oradata/standdb/temp01.dbf in control file

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 25-JUN-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=159 devtype=DISK

skipping datafile 2; already restored to file /u01/ora10g/oradata/standdb/undotbs01.dbf
skipping datafile 3; already restored to file /u01/ora10g/oradata/standdb/sysaux01.dbf
skipping datafile 1; already restored to file /u01/ora10g/oradata/standdb/system01.dbf
skipping datafile 4; already restored to file /u01/ora10g/oradata/standdb/users01.dbf
restore not done; all files readonly, offline, or already restored
Finished restore at 25-JUN-13

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy recid=1 stamp=819011298 filename=/u01/ora10g/oradata/standdb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy recid=2 stamp=819011298 filename=/u01/ora10g/oradata/standdb/undotbs01.dbf
datafile 3 switched to datafile copy
input datafile copy recid=3 stamp=819011298 filename=/u01/ora10g/oradata/standdb/sysaux01.dbf
datafile 4 switched to datafile copy
input datafile copy recid=4 stamp=819011298 filename=/u01/ora10g/oradata/standdb/users01.dbf
Finished Duplicate Db at 25-JUN-13

RMAN> exit


Recovery Manager complete.
[kumar@localhost dbs]$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Tue Jun 25 07:08:58 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> shut immediate;
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size                  1218316 bytes
Variable Size              83888372 bytes
Database Buffers           79691776 bytes
Redo Buffers                2973696 bytes
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[kumar@localhost dbs]$ rman target sys/oracle@PRODDB auxiliary sys/oracle

Recovery Manager: Release 10.2.0.1.0 - Production on Tue Jun 25 07:09:43 2013

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

connected to target database: PRODDB (DBID=558988263)
connected to auxiliary database: PRODDB (not mounted)

RMAN> duplicate target database for standby nofilenamecheck dorecover;

Starting Duplicate Db at 25-JUN-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: sid=156 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 06/25/2013 07:10:20
ORA-01405: fetched column value is NULL

RMAN>



Regards,
Ishika
Re: Duplicate target database unable to open database [message #589216 is a reply to message #589212] Wed, 03 July 2013 06:25 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
In your Target, switch logfile and startover again.
 Alter system switch logfile

and
then duplicate with dorecover option.

[Updated on: Wed, 03 July 2013 06:44]

Report message to a moderator

Re: Duplicate target database unable to open database [message #589260 is a reply to message #589216] Wed, 03 July 2013 17:31 Go to previous messageGo to next message
crispinux
Messages: 4
Registered: July 2010
Location: Cd. Juarez
Junior Member
you need to take a backup of your archive log and datafiles

in the primary:

backup as compressed backupset database;
backup as compressed backupset archivelog all not backed up 1 times;

transfer the backupset to your standby server.

rman target sys/oracle@PRODDB auxiliary sys/oracle
duplicate target database for standby dorecover nofilenamecheck;

the file structure has to be the same in both servers if not use the newname option.

Re: Duplicate target database unable to open database [message #589277 is a reply to message #589216] Thu, 04 July 2013 00:52 Go to previous messageGo to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
Dear Mr. Mahesh,

Your suggestion is valuable. When I tried to run command "ALTER SYSTEM SWITCH LOGFILE;", system gets hanged for long time.
In the alert log it refer that unable to archived.

I am trying to do it again from the scratch. Will come back to you once duplicate steps are over.

Regards,
Ishika
Re: Duplicate target database unable to open database [message #589332 is a reply to message #589277] Thu, 04 July 2013 07:56 Go to previous messageGo to next message
ishika_20
Messages: 339
Registered: December 2006
Location: delhi
Senior Member
Dear Mr. Mahesh,

As per your suggestion, I have started it from the scratch.

1) I have updated the recovery path & V$archive_dest path then did the changes in the system parameter level.
2) Made system into force logging and the into archivelog mode.
3) issue comman "ALTER SYSTEM SWITCH LOGFILE" to check whether there are any problem while doing archiving or not.

Then atlast, issued the duplicate command. It finished duplicate but database is in mount position.

Again, I need to issued "ALTER DATABASE OPEN" at standby side to make it open.

My doubt is - whether duplicate command is opening database or it will bring database up to mount position only?

Regards,
Ishika
Re: Duplicate target database unable to open database [message #589339 is a reply to message #589332] Thu, 04 July 2013 08:19 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Standby database will be left in mount state. You can open it only in read-only state.
Everything is documented.
Please check here
http://docs.oracle.com/cd/B19306_01/server.102/b14239/create_ps.htm#i57454
http://docs.oracle.com/cd/B19306_01/server.102/b14239/create_ps.htm#i77231
Previous Topic: Topic:Backup on DB Instance "A" , Restore&Recover on DB instance "B"
Next Topic: rman restore
Goto Forum:
  


Current Time: Tue Nov 26 22:22:23 CST 2024