Oracle Recovery Manager (RMAN) provides a comprehensive foundation for efficiently backing up and recovering the Oracle databases, it provides a common interface, via command line and Enterprise Manager, for backup tasks across different host operating systems, automates administration of your backup strategies.
In this scenario we are performing active duplication and source database is in no archive log mode.
When you issue the command to duplicate database from target database where source Database is running in noarchivelog mode, you will receive following error.
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
On this situation we have one solution put the target database in mount stage and perform the steps.
|
Database Name
|
dhstg
|
|
Hostname
|
Nsmdev01
|
|
Ip Address
|
172.16.110.18
|
|
OS
|
Linux
|
|
Version
|
x86_64
|
|
Datafile Location
|
/data1/dhstg
|
|
Backup Location
|
/backup/rman_backup
|
|
DHSTG =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = Nsmdev01.corp.netsoftmate.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dhstg.corp.netsoftmate.com)
)
)
|
|
Database Name
|
dhstg
|
|
Hostname
|
Nsmstg01
|
|
Ip Address
|
172.16.110.16
|
|
OS
|
Linux
|
|
Version
|
x86_64
|
|
Datafile Location
|
/data1/diff/dhstg
|
|
Backup Location
|
/backup/rman_backup
|
|
dhstg_dup =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.110.16)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dhstg_dup)
)
)
|
Pre-requisites:
- Oracle net configuration:
- Both target and destination server should have tns entries.
- Static listener registration on auxiliary site.
- Service should be register on aux listener.
- Password files from target database.
- Sqlnet.ora should have correct parameters.
- Target database should be running through spfile.
- Check connectivity between target and destination server.
- Target database instance should be in mount mode.
7. Shutdown and start the instance in mount stage.
9. put Tns entry for target(source) database in $ORACLE_HOME/network/admin directory
10. Create the directory structure different from target (source) server.
11. Set the oracle sid and start the instance in nomount stage with pfile, here start the instance with pfile is must or else you will get error.
|
Issues:
RMAN> DUPLICATE TARGET DATABASE TO dhstg FROM ACTIVE DATABASE
2> SPFILE
3> PARAMETER_VALUE_CONVERT
4> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
5> SET DB_FILE_NAME_CONVERT
6> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
7> SET LOG_FILE_NAME_CONVERT
8> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
9> NOFILENAMECHECK;
Starting Duplicate Db at 06-APR-15
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=63 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile ‘/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora’ auxiliary format
‘/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora’ ;
sql clone “alter system set spfile= ”/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora””;
}
executing Memory Script
Starting backup at 06-APR-15
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=129 device type=DISK
Finished backup at 06-APR-15
sql statement: alter system set spfile= ”/data2/app/oracle/product/11.2.0/dbs/spfiledhstg.ora”
contents of Memory Script:
{
sql clone “alter system set db_name =
”DHSTG” comment=
”duplicate” scope=spfile”;
sql clone “alter system set control_files =
”/data1/diff/dhstg/control01.ctl”, ”/data1/diff/dhstg/control02.ctl” comment=
”” scope=spfile”;
sql clone “alter system set db_file_name_convert =
”/data1/dhstg”, ”/data1/diff/dhstg” comment=
”” scope=spfile”;
sql clone “alter system set LOG_FILE_NAME_CONVERT =
”/data1/dhstg”, ”/data1/diff/dhstg” comment=
”” scope=spfile”;
shutdown clone immediate;
startup clone nomount;
}
executing Memory Script
sql statement: alter system set db_name = ”DHSTG” comment= ”duplicate” scope=spfile
sql statement: alter system set control_files = ”/data1/diff/dhstg/control01.ctl”, ”/data1/diff/dhstg/control02.ctl” comment= ”” scope=spfile
sql statement: alter system set db_file_name_convert = ”/data1/dhstg”, ”/data1/diff/dhstg” comment= ”” scope=spfile
sql statement: alter system set LOG_FILE_NAME_CONVERT = ”/data1/dhstg”, ”/data1/diff/dhstg” comment= ”” scope=spfile
Oracle instance shut down
connected to auxiliary database (not started)
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 838864728 bytes
Database Buffers 222298112 bytes
Redo Buffers 5554176 bytes
contents of Memory Script:
{
sql clone “alter system set db_name =
”DHSTG” comment=
”Modified by RMAN duplicate” scope=spfile”;
sql clone “alter system set db_unique_name =
”DHSTG” comment=
”Modified by RMAN duplicate” scope=spfile”;
shutdown clone immediate;
startup clone force nomount
backup as copy current controlfile auxiliary format ‘/data1/diff/dhstg/control01.ctl’;
restore clone controlfile to ‘/data1/diff/dhstg/control02.ctl’ from
‘/data1/diff/dhstg/control01.ctl’;
alter clone database mount;
}
executing Memory Script
sql statement: alter system set db_name = ”DHSTG” comment= ”Modified by RMAN duplicate” scope=spfile
sql statement: alter system set db_unique_name = ”DHSTG” comment= ”Modified by RMAN duplicate” scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 838864728 bytes
Database Buffers 222298112 bytes
Redo Buffers 5554176 bytes
Starting backup at 06-APR-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/data2/app/oracle/product/11.2.0/dbs/snapcf_dhstg.f tag=TAG20150406T141312 RECID=3 STAMP=876319993
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 06-APR-15
Starting restore at 06-APR-15
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=63 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 06-APR-15
database mounted
contents of Memory Script:
{
set newname for datafile 1 to
“/data1/diff/dhstg/system01.dbf”;
set newname for datafile 2 to
“/data1/diff/dhstg/sysaux01.dbf”;
set newname for datafile 3 to
“/data1/diff/dhstg/undotbs01.dbf”;
set newname for datafile 4 to
“/data1/diff/dhstg/users01.dbf”;
set newname for datafile 5 to
“/data1/diff/dhstg/example01.dbf”;
set newname for datafile 6 to
“/data1/diff/dhstg/data01.dbf”;
backup as copy reuse
datafile 1 auxiliary format
“/data1/diff/dhstg/system01.dbf” datafile
2 auxiliary format
“/data1/diff/dhstg/sysaux01.dbf” datafile
3 auxiliary format
“/data1/diff/dhstg/undotbs01.dbf” datafile
4 auxiliary format
“/data1/diff/dhstg/users01.dbf” datafile
5 auxiliary format
“/data1/diff/dhstg/example01.dbf” datafile
6 auxiliary format
“/data1/diff/dhstg/data01.dbf” ;
sql ‘alter system archive log current’;
}
executing Memory Script
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 backup at 06-APR-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/06/2015 14:21:33
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/06/2015 14:21:33
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/06/2015 14:21:33
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/06/2015 14:21:33
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/06/2015 14:21:33
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
continuing other job steps, job failed will not be re-run
channel ORA_DISK_1: starting datafile copy
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/06/2015 14:21:34
RMAN-03015: error occurred in stored script Memory Script
RMAN-03009: failure of backup command on ORA_DISK_1 channel at 04/06/2015 14:21:34
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
Solution: Work around for this is shutdown the target database and start in mount stage.
[oracle@Nsmstg01 dbs]$ export ORACLE_SID=dhstg
[oracle@Nsmstg01 dbs]$ sqlplus
SQL*Plus: Release 11.2.0.1.0 Production on Mon Apr 6 15:15:22 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2220200 bytes
Variable Size 838864728 bytes
Database Buffers 222298112 bytes
Redo Buffers 5554176 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 – 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@Nsmstg01 dbs]$ rman target sys/oracle@dhstg auxiliary sys/oracle@dhstg_dup
Recovery Manager: Release 11.2.0.1.0 – Production on Mon Apr 6 15:16:07 2015
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: DHSTG (DBID=112149522, not open)
connected to auxiliary database: DHSTG (not mounted)
RMAN>
RMAN> DUPLICATE TARGET DATABASE TO dhstg FROM ACTIVE DATABASE
2> SPFILE
3> PARAMETER_VALUE_CONVERT
4> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
5> SET DB_FILE_NAME_CONVERT
6> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
7> SET LOG_FILE_NAME_CONVERT
8> ‘/data1/dhstg’, ‘/data1/diff/dhstg’
9> NOFILENAMECHECK;
Starting Duplicate Db at 06-APR-15
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/06/2015 15:47:03
RMAN-05537: DUPLICATE without TARGET connection when auxiliary instance is started with spfile cannot use SPFILE clause
solution: Start the auxiliary instance with pfile
Conclusion BY |