This content has been marked as final. Show 2 replies
Hello;1 person found this helpful
If you have a standby then you should look at "Transparent Application Failover"
Then create the service on the Primary
ernie = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = primary)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = ernie) ) )
After creating the service needs to be manually started.
BEGIN DBMS_SERVICE.CREATE_SERVICE('ernie','ernie'); END; /
Several of the default parameters can now be set for 'ernie'.
BEGIN DBMS_SERVICE.START_SERVICE('ernie'); END; /
Finally a database STARTUP trigger should be created to ensures that this service is only offered if the database is primary.
BEGIN DBMS_SERVICE.MODIFY_SERVICE ('ernie', FAILOVER_METHOD => 'BASIC', FAILOVER_TYPE => 'SELECT', FAILOVER_RETRIES => 200, FAILOVER_DELAY => 1); END; /
The event after startup is fired, if an instance changes from status MOUNT to OPEN.
CREATE TRIGGER CHECK_ERNIE_START AFTER STARTUP ON DATABASE DECLARE V_ROLE VARCHAR(30); BEGIN SELECT DATABASE_ROLE INTO V_ROLE FROM V$DATABASE; IF V_ROLE = 'PRIMARY' THEN DBMS_SERVICE.START_SERVICE('ernie'); ELSE DBMS_SERVICE.STOP_SERVICE('ernie'); END IF; END; /
For additional information search on "DBMS_SERVICE.CREATE_SERVICE"
Please check this new offering "Oracle Grid Infrastructure Bundled Agents" :-
It has Tomcat integration with Clusterware. A dependency is setup from the Tomcat resource to the Database/Service - when the service or database goes offline, the tomcat resource will also be stopped.