Siebel On Active Data Guard Standby

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

An Oracle White Paper

April 2015

Siebel on Active Data Guard Standby


Executive Overview ................................................................................................................................... 3
Introduction ................................................................................................................................................ 4
Prerequisites ................................................................................................................................................ 5
Configuration Steps ................................................................................................................................... 5
Environment Variables ......................................................................................................................... 5
Create Dummy Database...................................................................................................................... 6
Copy S_SSA_ID and S_USER Tables from Primary ...................................................................... 6
Import S_SSA_ID and S_USER into Dummy Database ............................................................... 7
Create RO Schema in the Primary Database ..................................................................................... 8
Create RO Synonyms to Siebel Schema ............................................................................................. 9
Create Siebel File System Replica ...................................................................................................... 11
Switch Siebel on Standby to Use RO Schema ................................................................................. 11
Add Dummy TNS Alias on Standby ................................................................................................ 12
Point Siebel on Standby to Standby Database ................................................................................ 13
Switch the Standby To Active Mode ................................................................................................ 13
Configure Components of Standby Siebel Servers ......................................................................... 13
Start Siebel on Standby ....................................................................................................................... 13
Executive Overview

This paper describes how a read only Siebel application service can be delivered on a standby site
querying data from an Active Data Guard standby. This can be used to:

 Offloaded read only user workload from the primary database increasing the overall utilization and
performance capacity of the system.

 Provide faster query response times to remote Siebel users.


Introduction

The Active Data Guard standby database is a block for block replica of the primary database and so it is not
possible to make any changes to the standby database. All changes must be made on the primary and then
synchronized to the standby.
The S_USER and S_SSA_ID tables are always updated by the Siebel application, even if the user is only
performing queries, and so we must find a way to divert these updates to a read/write database in order for
the Siebel application to startup without error against the read only Active Database Guard standby.
The approach used in this paper is to create a separate “dummy” database located on the standby site to
contain the S_USER and S_SSA_ID. We assume that any changes to these tables when running in read only
mode are not needed and can be safely discarded.
Siebel is redirected to the “dummy” database and tables by creating a separate “RO” schema (table owner). In
this schema, S_SSA_ID and S_USER are database links to the “dummy” database. All other Siebel tables are
created as synonyms of the actual tables on the true Siebel schema.
When running on the primary site Siebel is configured to connect to the true table owner. When running on
the standby site against the Active Data Guard standby database Siebel is configured to connect to the “RO”
table owner.
Prerequisites

We assume the following are in place before performing this configuration:


 There are two sites, primary and standby.
 A Data Guard physical standby of the primary database is running on the standby site.
 Siebel is up and running on the primary site.
 Siebel is setup on the standby site with a separate enterprise and has been tested and functions correctly when
connecting to a regular read/write Siebel database. Perhaps this would have been tested by running in
snapshot standby mode.

Configuration Steps
Environment Variables
Identify appropriate values for the following environment variables and be prepared to set these variables as
indicated in the subsequent configuration steps:

SIEB_TBO=’ORAPERF’ # Table owner on primary.


SIEB_TBO_PASSWORD=’ORAPERF’ # Table owner password
SIED_DATA_TBS=’DATA’ # Name of the Siebel data tablespace
SIED_INDEX_TBS=’INDX’ # Name of the Siebel index tablespace

RO_SCHEMA=’RO’ # Table owner used by Siebel in read only.


# Must be different from table owner on primary.
RO_PASSWORD=’RO123’ # Password of RO user.
SIEB_ALIAS=’SIEBXD’ # TNS alias pointing to primary database.
DUMMY_SCHEMA=’DUMMY’ # Schema containing S_SSA_ID and S_USER tables in the
dummy database
DUMMY_PASSWORD=’DUMMY123’ # Password used by database link to connect to the
dummy database
RO_DIR=’/home/oracle_siebel/ro_dir’ # Staging directory for backup
Create Dummy Database
Create an Oracle database that will be used to host the dummy S_SSA_ID and S_USER tables. Ideally this
will be located close to the standby Siebel site.
Note, the Read Only enterprise will use the S_USER table on DUMMY database. If new users are added to
the primary enterprise the export/import process must be performed over again in order to keep both
databases in sync.

Copy S_SSA_ID and S_USER Tables from Primary


Export the tables from the primary:

< source environment variables >

mkdir $RO_DIR
sqlplus / as sysdba <<EOF
create or replace directory ro_dir as '${RO_DIR}';
GRANT READ, WRITE ON DIRECTORY ro_dir TO $SIEB_TBO;
EOF

expdp ${SIEB_TBO}/${SIEB_TBO_PASSWORD}@${SIEB_ALIAS} tables=S_SSA_ID,S_USER


directory=RO_DIR dumpfile=RO.dmp logfile=expdpRO.log
Import S_SSA_ID and S_USER into Dummy Database
Create staging directory on dummy database server:

< source environment variable >

mkdir $RO_DIR
sqlplus / as sysdba <<EOF

create tablespace ${SIED_DATA_TBS}


EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
alter tablespace ${SIED_DATA_TBS} add datafile size 1g;

create tablespace $SIED_INDEX_TBS


EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
alter tablespace $SIED_INDEX_TBS add datafile
'/u01/app/oracle/oradata/DUMMY/SIEB_INDEX.dbf' size 1g;

create user $DUMMY_SCHEMA identified by $DUMMY_PASSWORD;


grant create table to $DUMMY_SCHEMA;
grant unlimited tablespace to $DUMMY_SCHEMA;
grant create session to $DUMMY_SCHEMA;

create or replace directory ro_dir as '${RO_DIR}';


GRANT READ, WRITE ON DIRECTORY ro_dir TO $DUMMY_SCHEMA;
EOF

Copy the dump file RO.dmp to the standby site.


Import the tables into the dummy:

< source environment variable >


impdp ${DUMMY_SCHEMA}/${DUMMY_PASSWORD}@dummy REMAP_SCHEMA=$SIEB_TBO:$DUMMY_SCHEMA
directory=RO_DIR dumpfile=RO.dmp logfile=impdpRO.log
Create RO Schema in the Primary Database
As the database owner user on the primary database server:

< source environment variable >

sqlplus / as sysdba <<EOF

create user $RO_SCHEMA identified by $RO_PASSWORD;


alter user $RO_SCHEMA identified by $RO_PASSWORD;

grant sse_role to $RO_SCHEMA;


grant select_catalog_role to $RO_SCHEMA;

grant create synonym to $RO_SCHEMA;


grant create table to $RO_SCHEMA;
grant unlimited tablespace to $RO_SCHEMA;

drop public database link dummy;


create public database link dummy connect to $DUMMY_SCHEMA identified by
$DUMMY_PASSWORD using 'DUMMY';
EOF
Create RO Synonyms to Siebel Schema
As the database owner user on the primary database server:

< source environment variable >

sqlplus ${RO_SCHEMA}/${RO_PASSWORD}@${SIEB_ALIAS} <<EOF

DECLARE
CURSOR NAME IS SELECT TABLE_NAME FROM DBA_TABLES
WHERE OWNER='$SIEB_TBO';
synonym_does_not_exist EXCEPTION;
PRAGMA EXCEPTION_INIT(synonym_does_not_exist, -01434);

BEGIN
FOR TNAME IN NAME
LOOP
BEGIN
EXECUTE IMMEDIATE 'DROP SYNONYM ' || TNAME.TABLE_NAME;
exception when synonym_does_not_exist then null;
END;
END LOOP;
END;
/

DECLARE
CURSOR NAME IS SELECT TABLE_NAME FROM DBA_TABLES
WHERE OWNER='$SIEB_TBO';

BEGIN
FOR TNAME IN NAME
LOOP
BEGIN
EXECUTE IMMEDIATE 'CREATE SYNONYM ' || TNAME.TABLE_NAME || ' FOR $SIEB_TBO.' ||
TNAME.TABLE_NAME;
END;
END LOOP;
END;
/

drop synonym s_ssa_id;


create synonym s_ssa_id for ${DUMMY_SCHEMA}.s_ssa_id@dummy;

drop synonym s_user;


create synonym s_user for ${DUMMY_SCHEMA}.s_user@dummy;

EOF
Create Siebel File System Replica
Create a replica of the Siebel file system on the standby site. Ideally, this would be continuously replicated
from the primary and mounted in read only mode, so that changes made on the primary can be viewed on the
standby but no changes can be made on the standby.
The Siebel File System currently used by the Siebel on the standby site should be dismounted and the replica
should be mounted in its place. Here is an example of how the file system could be mounted on Linux
(/etc/fstab):

192.168.219.207:/export/siebelfs_site1_replica /siebelfs nfs4


ro,bg,hard,nointr,rsize=131072,wsize=131072

Switch Siebel on Standby to Use RO Schema


In the Gateway Server, edit the bin/gateway.cfg file (located in the Gateway software home):

TableOwner = RO

Change the enterprise level table owner and password parameters using server manager:
change ent param TableOwner="RO"
change enterprise param TableOwnPass=RO123

Change the ServerNamedDataSrc named datasource table owner parameter using server manager

change param DSTableOwner=RO for named subsystem ServerDataSrc

Deactivate unused system auxiliary components: SRM capabilities does not apply to the secondary enterprise,
no updates and maintenance will be managed on SRM model. Note that services implemented to be
executed in this enterprise will be implemented in an isolated way, executing all the read only actions inside
the ObjMgr (no remote workflows or asynchronous requests to other components)
deactivate component definition SRProc
deactivate component definition SvrTblCleanup
deactivate component definition SvrTaskPersist

Shutdown Siebel.

Add Dummy TNS Alias on Standby


The alias must be added to the tnsnames.ora file on the database servers as this is where the database link
connection is resolved. For example:

DUMMY =
(DESCRIPTION =
(CONNECT_TIMEOUT=5)
(TRANSPORT_CONNECT_TIMEOUT=3)
(RETRY_COUNT=3)
(ADDRESS_LIST=
(FAILOVER=on)
(LOAD_BALANCE=on)
(ADDRESS = (PROTOCOL = TCP)(HOST = scam08-scan3)(PORT = 1521)))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = dummy))
)

As a safety precaution, it is best if this alias is not defined on the primary database servers so that if a Siebel
server tries to connect to the “RO” table owner on the primary database server it will fail.
Point Siebel on Standby to Standby Database
Good to have a different database service (for example SIEB_STBY) for the database in active standby mode.
The alias must be defined in the tnsnames.ora on each standby Siebel server. For example:

SIEBXD =
(DESCRIPTION =
(CONNECT_TIMEOUT=5)
(TRANSPORT_CONNECT_TIMEOUT=3)
(RETRY_COUNT=3)
(ADDRESS_LIST=
(LOAD_BALANCE=on)
(ADDRESS = (PROTOCOL = TCP)(HOST = scam08-scan3)(PORT = 1521)))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = sieb_stby))
)

Switch the Standby To Active Mode


With Data Guard Broker this is done as follows (names will vary):

dgmgrl sys/welcome1@dg_s2_siebxd <<EOF


edit database s2_siebxd set state=apply-on
EOF

Configure Components of Standby Siebel Servers


This solution is designed to support read only object manager application service on the standby site and so
only these components should be started. Disable all other components on the Siebel servers.

Start Siebel on Standby


Use the standard Siebel startup process.

You might also like