This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Oracle/OAS and the fly likes ORA-1113:Can not open database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "ORA-1113:Can not open database" Watch "ORA-1113:Can not open database" New topic
Author

ORA-1113:Can not open database

ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
I am getting "ORA-1113:Can not open database" and ORA-01034:Oracle not available" when I am trying to connect to oracle database.

I haven't found any solution to it on net.

Anyone faced similar issue? How did you make it working?

Thanks.
Scott Selikoff
Saloon Keeper

Joined: Oct 23, 2005
Posts: 3700
    
    5

Are you sure your Oracle database is up and can you connect to it using a SQL client? Oracle is often the most complicated server to connect with a basic client. I'd verify you can connect with a program such as Toad before trying it out in java.

Afterwards, if that doesn't highlight your problem, I'd recommend posting what code you are using to connect.


My Blog: Down Home Country Coding with Scott Selikoff
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Scott Selikoff:
Are you sure your Oracle database is up and can you connect to it using a SQL client? Oracle is often the most complicated server to connect with a basic client. I'd verify you can connect with a program such as Toad before trying it out in java.

Afterwards, if that doesn't highlight your problem, I'd recommend posting what code you are using to connect.


I am trying to connect to it with a client only (SQL+ environment) - not with JDBC code.
[ April 08, 2008: Message edited by: ankur rathi ]
Jhakda Velu
Ranch Hand

Joined: Feb 26, 2008
Posts: 166
Hi
If you are usre that the DB is up and running, you can use the foll piece of code to establish a connection


Jhakda


If I become filthy rich, I'll sponsor research for painless dental treatment at Harvard Medical School. Thats why,I'm learning Java.I have 32 teeth, 22 are man made.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Jhakda Velu:
Hi
If you are usre that the DB is up and running,
Jhakda


No, I am not sure. I guess it's not up. But how do I make it running? I am on Windows 98. Not sure how to view (and run) services in Windows 98. Not sure if it's been selected to run it as a windows service at the time of installation. Any idea?

Thanks.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

Ankur,
You can view/start/stop services through the control panel. Select the admin folder and then services.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jhakda Velu
Ranch Hand

Joined: Feb 26, 2008
Posts: 166
Hi Ankur
Could you resolve your problem?
Jhakda
Romano Londt
Greenhorn

Joined: May 05, 2004
Posts: 14
Originally posted by Jeanne Boyarsky:
Ankur,
You can view/start/stop services through the control panel. Select the admin folder and then services.


Ankur,

Assuming that Oracle is installed on the same machine as where you want to run JAVA.

You could also execute tnsping "DB_SID" from a command prompt. The result should be "OK".

If this was succesful try to connect using sqplus "username"/"password"@"DB_SID" from a command prompt.

If you get connected, you are sure the DB is up and running.

regards,

Romano
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Jeanne Boyarsky:
Ankur,
You can view/start/stop services through the control panel. Select the admin folder and then services.


There is no admin folder in control panel.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Jeanne Boyarsky:
Ankur,
You can view/start/stop services through the control panel. Select the admin folder and then services.


I searched for services.msc file and found it in D:\WINDOWS\system32 folder. But when I click on this file, I get this message:


The selected file is not a microsoft management console document.



[ April 15, 2008: Message edited by: ankur rathi ]
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Originally posted by Romano Londt:


Ankur,

Assuming that Oracle is installed on the same machine as where you want to run JAVA.

You could also execute tnsping "DB_SID" from a command prompt. The result should be "OK".

If this was succesful try to connect using sqplus "username"/"password"@"DB_SID" from a command prompt.

If you get connected, you are sure the DB is up and running.

regards,

Romano


When I execute DB_SID and sqplus command from command prompt, I get 'Bad Command or file name' error. Which JAR shall I take into path?
[ April 15, 2008: Message edited by: ankur rathi ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


There is no admin folder in control panel.

This is to do with how you have configured your Windows start menu. Run services.msc from the Run... prompt or open the Control Panel from My Computer.


I searched for services.msc file and found it in D:\WINDOWS\system32 folder. But when I click on this file, I get this message:
The selected file is not a microsoft management console document.

Sounds like you Windows install is a little flaky.


When I execute DB_SID and sqplus command from command prompt, I get 'Bad Command or file name' error. Which JAR shall I take into path?

tnsping and sqlplus are on your path after you install Oracle client. Do you have Oracle installed? If you don't, you can't uses these tools (though you do not need Oracle installed to connect via JDBC)


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830

This is to do with how you have configured your Windows start menu. Run services.msc from the Run... prompt or open the Control Panel from My Computer.


I think, services.msc doesn't work on Windows 98. At least, it's not working for me.


Sounds like you Windows install is a little flaky.


Didn't get. What do I do now? It's was working before...


tnsping and sqlplus are on your path after you install Oracle client. Do you have Oracle installed? If you don't, you can't uses these tools (though you do not need Oracle installed to connect via JDBC)


Yeah, with thin driver it's possible to connect oracle server without oracle client.

But I do have installed oracle server on my machine.

Thanks.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Which version of Oracle are you using? I don't know of one that is supported on Windows 98.

services.msc will not run on Windows 98. As far as I can remember Windows 98 doesn't have the concept of managed services. How come you have services.msc on your machine at all?

sqlplus and tnsping are part of the Oracle install. If you have Oracle installed you should have these tools, but your PATH may be corrupt. Check this.

You are right, you don't need the client to use the thin driver. However they are useful for debugging listener issues.
ankur rathi
Ranch Hand

Joined: Oct 11, 2004
Posts: 3830
Thanks Paul for your time.


Which version of Oracle are you using? I don't know of one that is supported on Windows 98.


It's Oracle 8i. It's supported because it was working before.


services.msc will not run on Windows 98. As far as I can remember Windows 98 doesn't have the concept of managed services. How come you have services.msc on your machine at all?


Okay. I think services.msc is there because I have both XP and 98 on my machine. But I can't open this file from 98 - getting 'The selected file is not a microsoft management console document' error.


sqlplus and tnsping are part of the Oracle install. If you have Oracle installed you should have these tools, but your PATH may be corrupt. Check this.


Could be. But how sqlplus and tnsping can solve this problem?

Thanks again.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


because I have both XP and 98 on my machine

...so why are you using 98? Apart from XP being a far, far better OS than the (long unsupported) Windows 98 it means you can follow the advice given above.


But how sqlplus and tnsping can solve this problem?

As Romano Londt suggests, these are useful tools to check your service is running.

What do you currently use to manage your Oracle instance?

(NB: is this for production code? Oracle discontinued support for 8i in December 2004)
[ April 17, 2008: Message edited by: Paul Sturrock ]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30057
    
149

This is starting to sound quite Oracle specific. I'm going to move it to our Oracle forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: ORA-1113:Can not open database
 
Similar Threads
Error message : ORA-01000: Maximum number of open cursors reached ??
Oracle Error ORA-00900
ORA-00353: log corruption near block 75760 change 5605346 time 01/07/2012 11:41:31
TNS protocol adapter error
how to recover - corrupted "undotbs01.dbf " ?