Wednesday, June 30, 2010

Sendmail and sm-client very slow on boot - Solution

I observer that when database server (Linux 5.x 64-bit) restart "sendmail" and "sm-client" very slow. normally it take 5 to 8 minutes.

currently have a redhat box named "primarydb." /etc/hosts looks like this:

# Do not remove the following line, or various programs
# that require network functionality will fail.
::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost.localdomain localhost
192.168.1.1 primarydb primarydb
192.168.1.2 physicaldb physicaldb
192.168.1.3 logicaldb logicaldb

If I change the hosts file back to it's original setting, this does not occur. Just change /etc/hosts like this, just add one new line:

127.0.0.1 primarydb.localdomain primarydb
or
127.0.0.1 primarydb localhost.localdomain localhost

Contents after changing /etc/hosts, will be like this:

::1 localhost6.localdomain6 localhost6
127.0.0.1 localhost.localdomain localhost
127.0.0.1 primarydb.localdomain primarydb
192.168.1.1 primarydb primarydb
192.168.1.2 physicaldb physicaldb
192.168.1.3 logicaldb logicaldb

Tuesday, June 29, 2010

Removing Oracle Data Guard Configuration

Oracle Database Running With Three Data Guards one Physical standby and one logical standby. I am going to remove one physical standb database from current configuration.


Primary Database
:PrimaryDB (orcl)
Standby Database :PhysicalDB,LogicalDB

Want to remove : LogicalDB

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL; (LogicalBD)
shutdown immediate; (LogicalDB)

$ sqlplus /nolog
$ connect /as sysdba@primarydb

1. alter system set log_archive_dest_state_3=defer scope=both;
2. alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,physicaldb)' scope=both;
3. alter system set fal_server=orcl,physicaldb scope=both;

4.remove the log_archive_dest_n='service= ' in init.ora related to the standby database

5.remove the tnsnames in primary.


Remove Data Guard Broker (DGMGRL) configurationo

$DGMGRL
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/password
DGMGRL> disable configuration
DGMGRL> show configuration

Configuration
Name: dataguard
Enabled: NO
Protection Mode: MaxPerformance
Databases:
orcl - Primary database
physicaldb - Physical standby database
logicaldb - logical standby database

Fast-Start Failover: DISABLED

Current status for "dataguard":
DISABLED

DGMGRL> remove database logicaldb;
Removed database "logicaldb" from the configuration
DGMGRL> enable configuration
Enabled.
DGMGRL>

Saturday, June 12, 2010

Troubleshooting ORA-16191, ORA-01017

In 11gR1, 11gR2, ambience up log carriage for DataGuard, Streams, CDC, etc., you are acceptable to run into this annoyance. No amount how anxiously you accomplish the SYS passwords in the passwordfile the aforementioned byte-for-byte on both the antecedent and destination hosts, the antecedent archiver will abort aggravating to log in to the destination DB with these letters accounting to the active log:

ORA-01017: invalid username/password; logon denied
ORA-16191: Primary log shipping client not logged on standby

The band-aid is to actualize the passwordfiles with orapwd application the altercation 'ignorecase=y':

% orapwd file=orapwORCL password=sys_password ignorecase=y entries=5 force=y

This affair has been accurate by several bloggers and appointment participants, but there is still no agenda in Metalink as of today. I'm not abiding what allotment of the codepath contains this bug or if conceivably this is one of those that would be addressed with the "not a bug" acknowledgment from dev. You will apparently accept begin this commodity afterwards afterward the instructions in the absurdity documentation:

Friday, June 4, 2010

Oracle data guard broker configurations - step by step

1. Set DG_BROKER_START initialization parameter

SQL> connect sys@primarydb as sysdba
SQL> SHOW PARAMETER DB_BROKER_START;
SQL> ALTER SYSTEM SET DB_BROKER_START=TRUE;

2. Configure data broker service

Define a listener service for data guard broker.
Edit listener $ORACLE_HOME/network/admin/listener.ora file should contain entries as:

ISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS=(PROTOCOL=IPC)(KEY = EXTPROC1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.231)(PORT = 1521)(IP=FIRST))
)
)

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DNAME = logicaldb)
(ORACLE_HOME = /oradisk/oracle/product/11.1.0/db)
(SID_NAME = orcl))
(SID_DESC =
(GLOBAL_DNAME = logicaldb_DGMGRL)
(ORACLE_HOME = /oradisk/oracle/product/11.1.0/db)
(SID_NAME = ORCL))
)

NOTE: The value for the GLOBAL_DBNAME should be a concatenation of the initialization
parameters _DGMGRL. in listener.ora on all instances of both primary and standby databases. After making necessary changes in listener on all nodes reload listener.

$> lsnrctl reload;

3. Configure/update TNS services on primary and standby databases
Edit listener $ORACLE_HOME/network/admin/ tnsnames.ora file should contain entries as:

PRIMARYDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=TCP)(HOST=primarydb)(PORT=1521)))
(CONNECT_DATA =(SERVICE_NAME=orcl))
)

LISTENER_PHYSICALDB =(ADDRESS=(PROTOCOL=TCP)(HOST=physicaldb)(PORT=1521))
PHYSICALDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS=(PROTOCOL=TCP)(HOST=physicaldb)(PORT=1521)))
(CONNECT_DATA =(SID=orcl))
)

LISTENER_LOGICALDB=(ADDRESS=(PROTOCOL=TCP)(HOST=logicaldb)(PORT=1521))
LOGICALDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST=logicaldb)(PORT=1521)))
(CONNECT_DATA =(SID=orcl))
)
Note: update tnsnames.ora file carefully, and update it on all standby nodes include in configuration. Also check user can connect to all nodes/databases. If communication problems first solve then proceed.

[oracle@primarydb ]$ sqlplus /nolog

SQL*Plus: Release 11.1.0.6.0 - Production on Fri Jun 4 12:48:25 2010

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

SQL> connect sys/password@primarydb as sysdba
Connected.
SQL> connect sys/password@physicaldb as sysdba
Connected.
SQL> connect sys/password@logicaldb as sysdba
Connected.


4. Data Guard Broker configuration

Now here we create data guard broker configuration and add standby databases, verification and enable configuration.

1. Invoke DGMGRL and connect to your primary database

[oracle@primarydb ~]$ dgmgrl
DGMGRL for Linux: Version 11.1.0.6.0 - 64bit Production
Copyright (c) 2000, 2005, Oracle. All rights reserved.

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/password@primarydb
Connected.

DGMGRL> show configuration
Error: ORA-16525: the Data Guard broker is not yet available

Configuration details cannot be determined by DGMGRL
DGMGRL>

2. Create the broker configuration including a profile for the primary database.

DGMGRL> CREATE CONFIGURATION ‘DGCONFIG’ AS
Primary Database is ‘orcl’
Connect identifier is primarydb;

3. Display information about the configuration.
DGMGRL> show configuration

4. Add physical standby database in broker configuration.
DBMGRL> add database ‘physicaldb’ as connect identifier is physicaldb
Database “standby” added

Apply following if oracle 10.2.0
DBMGRL> add database ‘physicaldb’ as connect identifier is standby
maintained as physical;

5. Use the SHOW CONFIGURATION command to verify that the standby database was added to the configuration.
DGMGRL> show configuration

6. Enabling the Broker Configuration
With the Data Guard environment set successfully for your primary and standby databases. You can now enable the broker configuration.
Enable the entire configuration. This may take some time to complete.

DGMGRL> enable configuration
Enabled.


DGMGRL> show database physicaldb

Database
Name: physicaldb
Role: PHYSICAL STANDBY
Enabled: YES
Intended State: APPLY-ON
Instance(s):
Orcl

Current status for "physicaldb":
SUCCESS

5. Remove configuration
Remove standby data guard broker configuration, repeat for all target standby database.

DGMGRL> remove database ‘physicaldb’;

Remove data gurad broket configuration

DGMGRL> REMOVE CONFIGURATION;

DGMGRL> show configuration
Error: ORA-16525: the Data Guard broker is not yet available

Configuration details cannot be determined by DGMGRL
DGMGRL>

6. Troubleshooting

DGMGRL> HELP;
DGMGRL> SHOW CONFIGURATION;
DGMGRL> SHOW DATABASE VERBOSE 'dbname';

Monitor able properties to troubleshoot

DGMGRL> SHOW DATABASE 'dbname' 'StatusReport';
DGMGRL> SHOW DATABASE 'dbname' 'LogXptStatus';
DGMGRL> SHOW DATABASE 'dbname' 'InconsistentLogXptProps';
DGMGRL> SHOW DATABASE 'dbname' 'LogXptStatus';
DGMGRL> SHOW DATABASE 'dbname' 'InconsistentProperties';

DGMGRL> SHOW DATABASE 'dbname' 'StatusReport';

Issue
DGMGRL> CONNECT sys/password
ORA-16525: the Data Guard broker is not yet available

Fix
Set dg_broker_start=true

Issue

DGMGRL> SHOW DATABASE 'physicaldb' 'StatusReport';
STATUS REPORT
INSTANCE_NAME SEVERITY ERROR_TEXT
physicaldb WARNING ORA-16714: The value of property ArchiveLagTarget is inconsistent with the database setting.
physicaldb WARNING ORA-16714: The value of property LogArchiveMaxProcesses is inconsistent with the database setting.

Note: See data guard alert log and fixed Inconsistent Properties

Issue

SHOW DATABASE 'physicald' 'LogArchiveMaxProcesses';
LogArchiveMaxProcesses = '4'

Fix
EDIT DATABASE 'physicaldb' SET PROPERTY 'LogArchiveMaxProcesses'=2;

Equivalent Broker Commands to 'ALTER SYSTEM'

SQL> alter database recover managed standby database cancel;
DGMGRL> edit database 'dbname' set state='LOG-APPLY-OFF';

SQL> alter database recover managed standby database disconnect;
DGMGRL> edit database 'sdbname' set state='ONLINE';

SQL> alter system set log_archive_max_processes=4;
DGMGRL> edit database 'dbname' set property 'LogArchiveMaxProcesses'=4;

SQL> alter system set log_archive_dest_state_2='enable' cope=both;
DGMGRL> edit database 'dbname' set property 'LogShipping'='ON';

SQL> alter system set log_archive_dest_state_2='defer' scope=both;
DGMGRL> edit database 'dbname' set property 'LogShipping'='OFF';