1 Reply Latest reply: Mar 20, 2014 9:44 AM by mseberg RSS

    Check MGW agent if DB is mount

    VirtualSadist

      Hello, guru's!

       

      I have a physical standby DB which is in a mount state.

      We are going to perform failover tests, but i need to MGW agent (which is configured on primary) to be shutdown when i'll open standby DB.

      I try to select MGW_AGENT view, but it can't be done, while db is mount.

      Any ideas, how to check and shutdown mgw agent without opening DB?

       

      Regards,

      VS

        • 1. Re: Check MGW agent if DB is mount
          mseberg

          Hello;

           

          Won't shutting the listener on the Primary side disable the agent?

           

          Another Idea

           

          Not certain if locking the Agent user will work. Change as needed for your user.

           

          CREATE TRIGGER CHECK_DB_ROLE AFTER STARTUP ON DATABASE

          DECLARE

          V_ROLE VARCHAR(30);

          BEGIN

          SELECT DATABASE_ROLE INTO V_ROLE FROM V$DATABASE;

          IF V_ROLE = 'PRIMARY' THEN

          ALTER USER MGWADMIN ACCOUNT UNLOCK;

          ELSE

          ALTER USER MGWADMIN ACCOUNT LOCK;

          END IF;

          END;

          /

           

           

          Best Regards

           

          mseberg

           

          Message was edited by: mseberg