Archive for the ‘Data Guard’ Category.

How to configure Client Failover after Data Guard Switchover or Failover

Hi,

today I wanted to write how to configure Client Failover after Data Guard Switchover or Failover but there is perferct note which I followed. 316740.1
So why to discover discovered.

On the Primary and Standby Servers, configure the Listener and start them.

listener.ora on Server one (Primary):
=========================
listener=
(description=
(address=(protocol = TCP)(host=one.world.com)(port=1521))
)

listener.ora on Server two (Standby):
===========================
listener=
(description=
(address=(protocol = TCP)(host=two.world.com)(port=1521))
)

NOTE: Do not use SID_LIST_<LISTENER_NAME> on the listener.ora File to let the Database to register itself with the correct Service Names.

(S)PFILE on Primary (one)
===================
service_names=(db_prod.world.com, db_stby.world.com)
log_archive_dest_2=’SERVICE=dbtwo LGWR reopen=60 valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE)’

(S)PFILE on Standby (two)
===================
service_names=db_stby.world.com
log_archive_dest_2=’SERVICE=dbone LGWR reopen=60 valid_for=(ONLINE_LOGFILES,PRIMARY_ROLE)’

REMARK: The valid_for-Attribute was introduced in 10.x, so not possible in 9.x, use the log_archive_dest_state_2 instead to toggle enable/defer depending on the Role

Listener Status on Primary Server will show both the Primary Service, i.e. db_prod.world.com, and PhysicalSstandby Service, i.e. db_stby.world.com.
Listener Status on Standby Server will show Physical Standby Service, i.e. db_stby.world.com only.

tnsnames.ora on Primary & Standby:
=========================
dbone.world.com =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=one.world.com)(PORT=1521))
)
(CONNECT_DATA = (SERVICE_NAME = db_stby.world.com))
)

dbtwo.world.com=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=two.world.com)(PORT=1521))
)
(CONNECT_DATA = (SERVICE_NAME = db_stby.world.com))
)

db.world.com =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=one.world.com)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=two.world.com)(PORT=1521))
)
(CONNECT_DATA = (SERVICE_NAME= db_prod.world.com))
)

*** so you’ll always use db_prod.world.com Service to reach the current Primary Database.

NOTES:
1. After Switchover or Failover, reset the service_names Parameter, this can be achieved by creating an “On Database Open” Trigger, or by executing the following ‘alter system’ Commands (when using SPFILE):
- New Primary (the ‘old Standby’ on Node two):
SQL> alter system set service_names = ‘db_prod.world.com, db_stby.world.com’ scope=both;
- New Standby (the ‘old Primary’ on Node one)
SQL> alter system set service_names=’db_stby.world.com’ scope = both;

So if you want to explicity connect to one of the Instances you’d use dbone or dbtwo depending to which Instance you want to connect, but if you want to connect to the Primary Database no matter in which Server the Primary Database is runing you’d use the TNS-Alias db.
2. If you setup the local_listener and remote_listener on the Primary and Standby Database, all Listeners will know which Instances provide which Service(s).
3. If you are using the DataGuard Broker and DGMGRL, you have to configure a static Listener Entry for each Database in the SID_LIST_LISTENER (in Contrast to what is mentioned above). This Entry must contain a Line using the following Syntax:

GLOBAL_DBNAME = db_unique_name_DGMGRL.db_domain
(See DataGuard Broker Guide for Details)

This can still work with this Example as long as the SERVICE_NAME called by the Client-side tnsnames.ora matches the GLOBAL_DBNAME-Value configured in the SID_LIST_LISTENER Section.
4. Change the Names of the Servers, Domain and TNS-Aliases to meet your Standards and this Example should be enough.

Regards,

Tom

How to be notified for all ORA- Errors recorded in the alert.log file

Hi,

this is a part from metalink note 405396.1

This can be achieved with two steps:

1. Change the Warning Threshold for the metric “Generic Alert Log Error”

1. From the Database Instance Home Page, click on the link “Metric and Policy Settings”
2. Scroll down to the metric “Generic Alert Log Error”
3. Change the Matches Warning from the default value ORA-0*(600?|7445|4[0-9][0-9][0-9])[^0-9] to
ORA-* in order to receive an warning alert for all ORA- errors.
4. Click “OK”.

Note: As you edited a metric, a new file will be created in the Central Agent monitoring this target $ORACLE_HOME/sysman/emd/collection. The format of the file name is <target_type>_<target_name>.xml

2. Update the Notification Rule “Database Availability and Critical States”

1. Click Preferences from the top right Menu in the Grid Control Home Page.
2. Choose Rules from the left side Menu.
3. Choose the “Database Availability and Critical States” Rule, then click Edit.
4. Go to “Metrics” Tab then select “Generic Alert Log Error”.
5. Click the pen Edit Icon beside the metric, choose the severity warning to receive a notification when it reaches the warning threshold.

Note: You can also create a new Notification Rule for this specific metric “Generic Alert Log Error” instead of updating the Out-of-Box Notification rule “Database Availability and Critical States”

When you define the Warning or Critical Threshold for the metric “Generic Alert Log Error”, if you put any pattern behind the ORA- expression, the full ORA error will not be displayed in the alert (or in the notification if set). You will just get:
“Message=1 distinct types of ORA- errors have been found in the alert log.”

If you define the Warning or Critical Threshold for the metric “Generic Alert Log Error” with just ORA- without any pattern behind, then the full ORA error number will be displayed in the alert (or in the notification if set). You will get for example:
“Message=ORA-error stack (00942) logged in <full path and name of the alert.log file>”

However in that case, as you did not specify any filter you will be alerted for all ORA- error messages recorded in the alert.log file. This must be kept in mind.

Regards,

Tom

Create standby in 3 steps by duplicate

- I suppose you have configures tnsnames.ora, listener.ora

1) create initstandby.ora
db_name=prod    –> same as production name

2) starup nomount db standby

3) run RMAN
connect target sys/oracle123@prod
connect auxiliary sys/oracle123@standby

4) run online duplication
RMAN> duplicate target database for standby from active database;

5) when its done aktivate DataGuard on both sides
ALTER SYSTEM SET DG_BROKER_START=TRUE SCOPE=BOTH;

6) setup GataGuard
dgmgrl

connect sys/oracle123@prod

CREATE CONFIGURATION production AS PRIMARY DATABASE IS prod CONNECT IDENTIFIER IS prod;
ADD DATABASE standby AS CONNECT IDENTIFIER IS standby MAINTAINED AS PHYSICAL;

enable configuration

7) check configuration

DGMGRL> show configuration

Configuration
Name:                production
Enabled:             YES
Protection Mode:     MaxPerformance
Databases:
prod    - Primary database
standby - Physical standby database

Fast-Start Failover: DISABLED

Current status for “production”:
SUCCESS

8) DONE

You can check Oracle magazine link

Regards,

Tom

TOPlist