Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: oradim - return codes??
Hans Forbrich wrote:
> Gerry Sinkiewicz wrote:
>
>
>>"David" <goshengoogle_at_yahoo.com> wrote in message >>news:c6a42c32.0409080726.2ed43d0b_at_posting.google.com... >> >>>I am executing 'oradim' from Java code 9using the system runtime >>>package) to stop and start a 9.2.0.5 database instance. I would like >>>to capture the return code from oradim to determine the success or >>>failure of the command. I can find no documentation on return/status >>>codes. Can anyone help with this? Thank you. >>> >> >>It might be better to just check if the DB is running. >> >>grep for smon from a ps -ef.
Not directly addressing the OP, but the Windows equivalent of "ps -ef | grep smon" (and really, "ps -ef" is Unix SVR4 syntax, not Unix BSD 4.x syntax, which uses "ps -aux" instead, although some Unices support both...)
Using a Windows Resource Kit utility...
c:\tmp> tlist | find "oracle.exe"
1644 oracle.exe
Now, addressing the OP, a much better and more portable approach is to not check return codes (after all, what if oradim succeeded but the database crashed moments later due to a startup error?).
Rather, pre-create a test table of some kind, then log in, update it, and commit. If the transaction fails at any step, or takes longer than a few seconds (you choose how many), then your read-write database most likely isn't open for business as you'd like. Works on any system that supports Java.
--Mark Bole Received on Sun Sep 12 2004 - 22:32:31 CDT