By following below steps we can create service:
step1: create the service by using srvcrl.
[oradb@rac1 ~]$ srvctl add service -d RACDB -s test_ser -r racdb1 -a racdb2 -P BASIC -e SELECT -z 100 -w 10
Here -r:preferred instance
-a:available instance
-p,-e,-z,-w are TAF policy parameters.
Note:TAF policy parameters are optional.We can also mention these parameter in client TNSNAMES.ora file.
setp2:start the service.
[oradb@rac1 ~]$ srvctl start service -d RACDB -s test_ser
step3:Check the service.
SQL> col NAME for a10
col FAILOVER_TYPE for a10
set lines 300 pages 300
col FAILOVER_METHOD for a30
select NAME,CREATION_DATE,FAILOVER_METHOD,FAILOVER_TYPE,
FAILOVER_RETRIES,FAILOVER_DELAY from dba_services where NAME='test_ser';
NAME CREATION_ FAILOVER_METHOD FAILOVER_T FAILOVER_RETRIES FAILOVER_DELAY
---------- --------- ------------------------------ ---------- ---------------- --------------
test_ser 09-MAR-14 NONE SESSION 100 10
[oradb@rac1 ~]$ lsnrctl status
Service "test_ser.doppala" has 1 instance(s).
Instance "RACDB11", status READY, has 1 handler(s) for this service...
[oradb@rac1 ~]$ srvctl status service -d RACDB
Service test_ser is running on instance(s)rac1
SQL> select service_name,failover_type, failover_method, failed_over
from v$session
where service_name='test_ser';
SERVICE_NAME FAILOVER_TYPE FAILOVER_M FAI
-------------------- ------------- ---------- ---
test_ser SESSION BASIC NO
[oradb@rac1 admin]$ crsctl stat res -t
ora.RACDB.test.svc
1 ONLINE ONLINE rac1
==============================================================
[grid@rac1 bin]$ srvctl config database -d racdb
Database unique name: racdb
Database name: racdb
Oracle home: /syed/db_home1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: DATA,CRS
Services: test_ser
Database is administrator managed
[grid@rac1 bin]$
drop the service:
-----------------
Before drop the service,we have to stop the service.
[oradb@rac1 ~]$ srvctl stop service -d RACDB -s test_ser
[oradb@rac1 ~]$
[oradb@rac1 ~]$ srvctl remove service -d RACDB -s test_ser
Note:In 10g,if we create a service,we have to register service in database level by using ALTER SYSTEM SET service_names.In 11g it is not required.
No comments:
Post a Comment