Forum Stats

  • 3,770,000 Users
  • 2,253,045 Discussions
  • 7,875,263 Comments

Discussions

Recover BDB programatically?

User765009-Oracle
User765009-Oracle Member Posts: 2
edited Mar 1, 2017 1:01AM in Berkeley DB Java Edition

Want to know how to run Berkeley DB recovery programatically for EnvironmentFailureException. Are there JAVA APIs?

Following is the note for 'EnvironmentFailureException' in BDB documentation - https://docs.oracle.com/cd/E17277_02/html/java/com/sleepycat/je/EnvironmentFailureException.html :

The text in bold (and underlined) states we need to run recovery apart from closing and reopening environment handles.

--------------------------------------------------------

Depending on the nature of the failure, this exception may indicate that Environment.close() must be called. The application should catch EnvironmentFailureException and then call Environment.isValid(). If false is returned, all Environment handles (instances) must be closed and re-opened in order to run recovery and continue operating. If true is returned, the Environment can continue operating without being closed and re-opened. Also note that Environment.isValid()<span style="color: #474747; font-family: 'DejaVu Serif', Georgia, 'Times New Roman', Times, serif;">Depending on the nature of the failure, this exception may indicate that </span><a href="https://docs.oracle.com/cd/E17277_02/html/java/com/sleepycat/je/Environment.html#close--" style="color: #4a6782; font-family: 'DejaVu Serif', Georgia, 'Times New Roman', Times, serif;"><code style="font-family: 'DejaVu Sans Mono', monospace; padding-top: 4px; margin-top: 8px;">Environment.close() must be called. The application should catch EnvironmentFailureException and then call Environment.isValid(). If false is returned, all Environment handles (instances) must be closed and re-opened in order to run recovery and continue operating. If true is returned, the Environment can continue operating without being closed and re-opened. Also note that Environment.isValid() may be called at any time, not just during exception handling. may be called at any time, not just during exception handling.

--------------------------------------------------------

Any idea?

Thanks

Rajalakshmi

Answers

  • Greybird-Oracle
    Greybird-Oracle Member Posts: 2,690
    edited Feb 13, 2017 5:18PM

    Hi Rajalakshmi,

    Sorry for the delay responding. There is a forum bug that disables email notifications for no apparent reason and this happened to me again. Normally the notifications can be re-enabled by turning them off and on again, so I've done that and hopefully I will get emails now.

    When it says "all Environment handles (instances) must be closed and re-opened in order to run recovery and continue operating" it means that to run recovery, you just call Environment.close and then re-open it (create an Environment objects).

    Does this answer your question?

    --mark

  • User765009-Oracle
    User765009-Oracle Member Posts: 2
    edited Mar 1, 2017 1:01AM

    OK. I was assuming recovery is some command to be executed post closing and reopening environment handles.

    Thanks for the clarification.

This discussion has been closed.