Configure Oracle Dataguard Primary ASM
Configure Oracle Dataguard Primary ASM
the foregoing. The data files are stored on the file system. In the production
environment, the DBA is often faced with tens of hundreds of G data, and may even
be a T-level file system. The I/O problems of storing data files in these occasions
will gradually be exposed. Therefore, the data storage in the production
environment generally uses ASM, or bare devices. Oracle 11g does not support the
storage of data by bare devices at first, so this lecture is mainly This section
describes how to configure the Data guard physical standby database in the ASM
environment.
Environmental introduction:
Main library IP: 192.168.227.20/24
Main library SID: orcl
Main library DB_NAME: orcl
Main library DB_UNIQUE_NAME: primary
Main librarySERVICES_NAME: primary.yang.com
2 Building library
[oracle@primary ~]$ env |grep ORA
ORACLE_SID=orcl
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
FILE_NAME
------------------------------------------
+DATA/orcl/datafile/users.259.765985893
+DATA/orcl/datafile/sysaux.257.765985893
+DATA/orcl/datafile/undotbs1.258.765985893
+DATA/orcl/datafile/system.256.765985891
+DATA/orcl/datafile/example.265.765986057
MEMBER
--------------------------------------------
+DATA/orcl/onlinelog/group_3.263.765986013
+FRA/orcl/onlinelog/group_3.259.765986017
+DATA/orcl/onlinelog/group_2.262.765986005
+FRA/orcl/onlinelog/group_2.258.765986009
+DATA/orcl/onlinelog/group_1.261.765985997
+FRA/orcl/onlinelog/group_1.257.765986003
MEMBER TYPE
-------------------------------------------------- -------
+DATA/orcl/onlinelog/group_3.263.765986013 ONLINE
+FRA/orcl/onlinelog/group_3.259.765986017 ONLINE
+DATA/orcl/onlinelog/group_2.262.765986005 ONLINE
+FRA/orcl/onlinelog/group_2.258.765986009 ONLINE
+DATA/orcl/onlinelog/group_1.261.765985997 ONLINE
+FRA/orcl/onlinelog/group_1.257.765986003 ONLINE
+DATA/primary/onlinelog/group_4.268.765996737 STANDBY
+FRA/primary/onlinelog/group_4.264.765996743 STANDBY
+DATA/primary/onlinelog/group_5.269.765996751 STANDBY
+FRA/primary/onlinelog/group_5.265.765996757 STANDBY
+DATA/primary/onlinelog/group_6.270.765996763 STANDBY
MEMBER TYPE
-------------------------------------------------- -------
+FRA/primary/onlinelog/group_6.266.765996767 STANDBY
+DATA/primary/onlinelog/group_7.271.765996775 STANDBY
+FRA/primary/onlinelog/group_7.267.765996779 STANDBY
4: Configure Data guard related parameters
SQL> alter system set db_unique_name='primary' scope=spfile;
System altered.
5: Configure the listener.ora and tnsnames.ora files (you need to do the same
configuration on the standby), restart the listener and database to ensure the
database connection is normal.
[oracle@primary ~]$ cat $ORACLE_HOME/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(GLOBAL_DBNAME = primary_DGMGRL.yang.com)
(ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.227.20)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
OPEN_MODE NAME
---------- ---------
MOUNTED ORCL
SQL> alter database recover managed standby database disconnect from session;
Database altered
SQL> alter database recover managed standby database disconnect from session;
Database altered
verification:
[oracle@physical ~]$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Oct 31 17:43:16 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
SQL> conn /as sysdba
Connected.
Three: troubleshooting
1: Data is out of sync problem is wrong
SQL> select sequence#,first_time,next_time,applied from v$archived_log;
no rows selected
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 10/31/2011 17:39:52
RMAN-06026: some targets not found - aborting restore
RMAN-06025: no backup of log thread 1 seq 8 lowscn 489318 found to restore
RMAN-06025: no backup of log thread 1 seq 7 lowscn 485345 found to restore
RMAN-06025: no backup of log thread 1 seq 6 lowscn 485300 found to restore
RMAN-06025: no backup of log thread 1 seq 5 lowscn 482789 found to restore
RMAN-06025: no backup of log thread 1 seq 4 lowscn 482752 found to restore
RMAN-06025: no backup of log thread 1 seq 3 lowscn 479773 found to restore
RMAN-06025: no backup of log thread 1 seq 2 lowscn 472799 found to restore
2: After closing the main library, restart the physical standby database, the error
is as follows, the control file is not found.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
Configure the physical standby database to start in spfile mode. Spfile does not
use ASM management.
SQL> create spfile from pfile;
File created.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
Adding to inittab
Startup will be queued to init within 90 seconds.
Checking the status of new Oracle init process...
Expecting the CRS daemons to be up within 600 seconds.
Giving up: Oracle CSS stack appears NOT to be running.
Oracle CSS service would not start as installed
Automatic Storage Management(ASM) cannot be used until Oracle CSS service is
started
MEMBER TYPE
------------------------------------------------------------ ----------
+DATA/orcl/onlinelog/group_3.263.765986013 ONLINE
+FRA/orcl/onlinelog/group_3.259.765986017 ONLINE
+DATA/orcl/onlinelog/group_2.262.765986005 ONLINE
+FRA/orcl/onlinelog/group_2.258.765986009 ONLINE
+DATA/orcl/onlinelog/group_1.261.765985997 ONLINE
+FRA/orcl/onlinelog/group_1.257.765986003 ONLINE
+DATA/primary/onlinelog/group_4.268.765996737 STANDBY
+FRA/primary/onlinelog/group_4.264.765996743 STANDBY
+DATA/primary/onlinelog/group_5.269.765996751 STANDBY
+FRA/primary/onlinelog/group_5.265.765996757 STANDBY
+DATA/primary/onlinelog/group_6.270.765996763 STANDBY
MEMBER TYPE
------------------------------------------------------------ ----------
+FRA/primary/onlinelog/group_6.266.765996767 STANDBY
+DATA/primary/onlinelog/group_7.271.765996775 STANDBY
+FRA/primary/onlinelog/group_7.267.765996779 STANDBY
Backup library:
SQL> select member,type from v$logfile;
MEMBER TYPE
------------------------------------------------------------ ----------
+DATA/physical/onlinelog/group_3.264.765999293 ONLINE
+FRA/physical/onlinelog/group_3.259.765999299 ONLINE
+DATA/physical/onlinelog/group_2.263.765999285 ONLINE
+FRA/physical/onlinelog/group_2.258.765999291 ONLINE
+DATA/physical/onlinelog/group_1.262.765999279 ONLINE
+FRA/physical/onlinelog/group_1.257.765999283 ONLINE
+DATA STANDBY
+FRA STANDBY
+DATA STANDBY
+FRA STANDBY
+DATA STANDBY
MEMBER TYPE
------------------------------------------------------------ ----------
+FRA STANDBY
+DATA STANDBY
+FRA STANDBY
Delete all standby log groups on the main library and switch log groups
MEMBER TYPE
------------------------------------------------------------ ----------
+DATA/physical/onlinelog/group_3.264.765999293 ONLINE
+FRA/physical/onlinelog/group_3.259.765999299 ONLINE
+DATA/physical/onlinelog/group_2.263.765999285 ONLINE
+FRA/physical/onlinelog/group_2.258.765999291 ONLINE
+DATA/physical/onlinelog/group_1.262.765999279 ONLINE
+FRA/physical/onlinelog/group_1.257.765999283 ONLINE
Add a new standby log group to the main library and switch logs. It is still not
possible to synchronize on the standby database.
The guess may be that there is no primary directory under the ASM disk group.
Create a related directory under the ASM disk group, add a new log group after
deleting the standby log group on the primary library, and switch the log to find
that the standby log group cannot be synchronized. Later, I tried to put the
standby log group on the file system on the main library. After switching the log,
the standby database could not be created synchronously!
Later, after the problem was passed through the switchover, manually create the
standby log group on the original physical standby database!