Windows Primary database and Linux Active Standby
This note describes the procedure of configuring a cross platform using the 11g RMAN Active Duplicate as well as an Active Standby Database setup over a Windows and Linux platform.
The Metalink note Data Guard Support for Heterogeneous Primary and Physical Standbys in Same Data Guard Configuration [ID 413484.1] describes the supported cross platform. combinations between a primary and standby database.
The environment used is as follows:
Primary :
-
Windows xp 32 bit
-
11g Release 2
- DB_NAME=ygzhou
-
ORACLE_SID=ygzhou
-
service_names=ygzhou
-
DB_UNIQUE_NAME=ygzhou
Active Standby:
-
Oracle Enterprise Linux 5.3 32 bit
-
11g Release 2
- DB_NAME=ygzhou
-
ORACLE_SID=ygzhou
-
service_names=ygzhou
-
DB_UNIUE_NAME=ygzhoudg
· Add static entry in listener.ora -------靜態監聽
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME =ygzhoudg)
(ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME =ygzhou)
)
)
· Reload listener or stop and start listener
· Add entries in tnsnames.ora on both source and target
ygzhoudg=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.202.73.172)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ygzhoudg)
)
)
ygzhou =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.204.54.51)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ygzhou)
)
)
[oracle@ygzhou518 dbs]$ rman target sys/system@ygzhou auxiliary sys/system@ygzhoudg
Recovery Manager: Release 11.2.0.1.0 - Production on Wed Dec 14 11:17:22 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: YGZHOU (DBID=498101983)
connected to auxiliary database: YGZHOU (not mounted)
RMAN> duplicate target database for standby from active database nofilenamecheck;
Starting Duplicate Db at 14-DEC-11
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK
contents of Memory Script.:
{
backup as copy reuse
targetfile 'D:\OraServer\product\11.2.0\dbhome_1\DATABASE\PWDygzhou.ORA' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwygzhou' ;
}
executing Memory Script
Starting backup at 14-DEC-11
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=172 device type=DISK
Finished backup at 14-DEC-11
contents of Memory Script.:
{
backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/ygzhou/control01.ctl';
restore clone controlfile to '/u01/app/oracle/oradata/ygzhou/control02.ctl' from
'/u01/app/oracle/oradata/ygzhou/control01.ctl';
}
executing Memory Script
Starting backup at 14-DEC-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=D:\ORASERVER\PRODUCT\11.2.0\DBHOME_1\DATABASE\SNCFYGZHOU.ORA tag=TAG20111214T144217 RECID=1 STAMP=769876938
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:09
Finished backup at 14-DEC-11
Starting restore at 14-DEC-11
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 14-DEC-11
contents of Memory Script.:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of Memory Script.:
{
set newname for tempfile 1 to
"D:\ORASERVER\ORADATA\YGZHOU\TEMP01.DBF";
switch clone tempfile all;
set newname for datafile 1 to
"D:\ORASERVER\ORADATA\YGZHOU\SYSTEM01.DBF";
set newname for datafile 2 to
"D:\ORASERVER\ORADATA\YGZHOU\SYSAUX01.DBF";
set newname for datafile 3 to
"D:\ORASERVER\ORADATA\YGZHOU\UNDOTBS01.DBF";
set newname for datafile 4 to
"D:\ORASERVER\ORADATA\YGZHOU\USERS01.DBF";
set newname for datafile 5 to
"D:\ORASERVER\ORADATA\YGZHOU\TODAY01.DBF";
backup as copy reuse
datafile 1 auxiliary format
"D:\ORASERVER\ORADATA\YGZHOU\SYSTEM01.DBF" datafile
2 auxiliary format
"D:\ORASERVER\ORADATA\YGZHOU\SYSAUX01.DBF" datafile
3 auxiliary format
"D:\ORASERVER\ORADATA\YGZHOU\UNDOTBS01.DBF" datafile
4 auxiliary format
"D:\ORASERVER\ORADATA\YGZHOU\USERS01.DBF" datafile
5 auxiliary format
"D:\ORASERVER\ORADATA\YGZHOU\TODAY01.DBF" ;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to D:\ORASERVER\ORADATA\YGZHOU\TEMP01.DBF in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 14-DEC-11
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=D:\ORASERVER\ORADATA\YGZHOU\SYSTEM01.DBF
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUSYSTEM01.DBF tag=TAG20111214T144239
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:55
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=D:\ORASERVER\ORADATA\YGZHOU\SYSAUX01.DBF
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUSYSAUX01.DBF tag=TAG20111214T144239
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:27
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=D:\ORASERVER\ORADATA\YGZHOU\UNDOTBS01.DBF
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUUNDOTBS01.DBF tag=TAG20111214T144239
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:24
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=D:\ORASERVER\ORADATA\YGZHOU\TODAY01.DBF
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUTODAY01.DBF tag=TAG20111214T144239
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=D:\ORASERVER\ORADATA\YGZHOU\USERS01.DBF
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUUSERS01.DBF tag=TAG20111214T144239
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 14-DEC-11
sql statement: alter system archive log current
contents of Memory Script.:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=1 STAMP=769864815 file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUSYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=2 STAMP=769864815 file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUSYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=3 STAMP=769864815 file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUUNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=4 STAMP=769864815 file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUUSERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=5 STAMP=769864816 file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/D:ORASERVERORADATAYGZHOUTODAY01.DBF
Finished Duplicate Db at 14-DEC-11