This discussion is archived
5 Replies Latest reply: Nov 23, 2012 9:21 PM by 974766 RSS

OracleConnection.shutdown method stop the active and standby database

974766 Newbie
Currently Being Moderated
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

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points