5 Replies Latest reply: Nov 23, 2012 11:21 PM by 974766 RSS

    OracleConnection.shutdown method stop the active and standby database

    974766
      Hi,

      I am using Oracle version 11.2.0 version.

      I wanted to stop the secondary database for some time pragmatically. For that i am executing the below set of commands.

      try {
      conn = (OracleConnection)ds.getConnection();
      }
      catch (SQLException sqle) {
      return true;
      }
      conn.shutdown(OracleConnection.DatabaseShutdownMode.IMMEDIATE);
      stmt = conn.createStatement();
      try {
      stmt.executeUpdate("ALTER DATABASE CLOSE NORMAL");
      }
      catch (SQLException sqle) {
      }
      try {
      stmt.executeUpdate("ALTER DATABASE DISMOUNT");
      }
      catch (SQLException sqle) {
      }
      conn.shutdown(OracleConnection.DatabaseShutdownMode.FINAL);

      The above set of code is stopping me active and standby database as well.

      Why it is stopping my both database? My expectation is, it should stop standby database alone.

      Please suggest.

      Thanks
      Durai