Discussion Locked

Problems with Connecting DB to Oracle

0 helpful
9 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

The Oracle will shutdown daily @ 9pm and startup @ 7am the next day.

I have an application connecting to the Oracle but recently, the application can't connect to the Oracle DB (Failed to can't connect to DB)

I tried to startup the Oracle DB manually in svrmgr32, but when I typed the command "startup", it shows that it is already connected.

I would also like to know how could I check on the log file on the Oracle and how to clear this log file.

Please help me.

9 replies

by d. brinson

You did not state whether the Oracle database platform is the same as the application you are trying to use. If it is not, it may be that the network connecting the two platforms is not working/setup properly.

What is the exact error message that you are receiving?

by gene.phillips

To accomplish such a task you must use the "grep" command that is shipped with Windows NT Resource Kit or the DOS command "find".
You must create the following files: Check_Up.cmd
------------
set ORACLE_SID=ORCL
c:\orant\bin\svrmgr30 @test.sql
find "OBJ#" checkup.log [or use "type checkup.log | grep OBJ#"]
echo %errorlevel%

test.sql
--------
connect internal/
spool checkup.log select * from obj$ where rownum=1;
spool off;

Then use the error level as in the fourth line of Check_Up.cmd and print it out to the screen. You can use this for more useful tasks such as checking if the database is down and starting it up. In this case the
Check_Up.cmd would be:
---
set ORACLE_SID=ORCL
c:\orant\bin\svrmgr30 @test.sql
find "OBJ#" checkup.log goto %errorlevel%
:0
goto EBatch
:1
net start OracleStartORCL
:EBatch
---
The FIND command returns an errorlevel of 0 if the string searched is found and a 1 if it is not found. The GREP utility has the same behaviour. So if the DB is up (the OBJ# column is displayed) the errorlevel will be 0 and if the DB is down (a ORA-1034 or other error occurs) the errorlevel will be 1.
You search for an "OBJ#" because it exists in the select from the OBJ$ table and it does not exist in any possible error message, and of course the OBJ$ table always exists in any database. You also use OBJ$ because if the DB is only mounted and not opened an ORA-1219 error will occur and
no "OBJ#" string would be displayed.

by vallery

Hi Gene,

Thank you for your advise.

I've tested out and found that it shows 1, but the funny thing is, I'm able to start my application even if there error is 1. As per your message, if the DB is down it will reflect 1 but why is it that I'm able to connect?

I manually type "net start OracleStartOrcl" and it shows that the service had been started.

Would appreciate if you could further help me.

This discussion is closed to new replies.