Skip to Main Content

Berkeley DB Family

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

A bug?How to fix it?

530864Aug 30 2006 — edited Aug 30 2006
I made an application with Berkeley DB lib(4.4.20).I created a database
with DB_RECNUM flag. Which document said it would not support dup
items.It was ok because my application didn't need dup items.But when it ran a few days later,I foud some items with the
same key.Like below:
key data
1 data1
2 data2
2 data3
3 data4

May be the application was killed and restarted before it met the
mistake.But i am not sure. And it is hard to recur.Why it make not
identical with the document and how to fix it? Please help me!

Thanks

Comments

Jim Smith
It likely that SQL*PLus is using a direct connection to ORACLE_SID and isn't using a listener. To use JDBC connections through SQL Developer you need a listener.

As the oracle user on the database server, try
lsnrctl status
If that shows that a listener isn't running, try
lsnrctl start
938329
hi,
i have install sql developer in window 7 and tried to create database but its show error as Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
please help me out.

Thanks & Regards,
Jeevan
neeshu
Thanks a lot Jim I will try that and let you know if it worked or not
neeshu
I ran the status which gave an error saying no listener then i ran the start lsnrctl command and it worked after which when I tried connecting with SQLDeveloper
I was given an error saying

Status : Failure -Test failed: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
Gary Graham-Oracle
Hi,

Now that your listener is running, executing lsnrctl status will show you all available services. From your earlier post I would guess ORCL may not be there, but possibly XE ? Hopefully you will see a familiar service in the list. If not, since this is the SQL Developer forum, let's try investigating this problem with the SQL Developer tool itself.

Right click on the connection of interest in the Navigator tree and select Properties. I assume the Connection Type is Basic. If you switch to a Connection Type of TNS, the Network Alias drop-down should display the available TNS names of the services your listener knows about. The list of names should be similar to what lsnrctl status displays.

If you are unable to connect using any of these TNS Aliases, make sure you don't have multiple tnsnames.ora* files. SQL Developer's tendency to read all such files can cause confusion. If this is the case remove the extra files or, if they are in multiple directories, at least use Tools|Preferences|Database|Advanced|Tnsnames Directory to limit the search to a single directory. If none of this works, then perhaps your tnsnames is not configured correctly and you need to use something like the Net Configuration Assistant to correct it.

Hope this helps,
Gary
neeshu
Thanks Gary I tried the lsnrctl status command and it gave me the listener as PLSExtProc

Then when i tried logging in with the tns connection type there were 3 tns name servers ==> Book orcl and PLSExtProc

I went to the tnsnames.ora and removed the code of book and the other name server with just orcl left and left the backup on desktop
but this time, sql developer showed me 2 instances of orcl and the other two book and plsextproc as well

I am getting 12514 error should i post the tnsname.ora file here

I tried setting the tools>database>preferences to admin folder but it picked up multiple instances of the tnsnames now I have 6 tns names ==> 2 book 2 orcl and 2 prlsext



Here is tnsnames.ora file contents


# tnsnames.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

BOOK =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = book)
)
)

ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)


Please help thank you

Edited by: neeshu on May 19, 2012 11:25 AM
Jim Smith
It may be that your databaase service isn't running, and is therefore not registered with the listener.

In a command window, try
 sqlplus "/ as sysdba"
SQL> startup
exit
Edited by: Jim Smith on May 20, 2012 1:12 PM
neeshu
hi jim i am able to connect to database using sqlplus startup works fine and so does shut down do you think the problem has something to do with red hat
Jim Smith
Start up the database, then wait a minute of so, and then try 'lsnrctl status', and post the output here.

Once the database is up, it should resgister itself as a service with the listener and you should be able to see what you should be trying to connect to.

Note that on Linux, SIDs are case sensitive,so ORCL isn't the same as orcl. Services should be case INsensitive.
neeshu
This is the error i got


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-MAY-2012 18:29:14

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused



here is the screenshot

[http://imageshack.us/photo/my-images/717/screenshotxls.jpg/]

Edited by: neeshu on May 20, 2012 6:13 AM
EdStevens
neeshu wrote:
This is the error i got


LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-MAY-2012 18:29:14

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.localdomain)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused



here is the screenshot

[http://imageshack.us/photo/my-images/717/screenshotxls.jpg/]

Edited by: neeshu on May 20, 2012 6:13 AM
Ok. first thing first. configuring the listener to listen on 'localhost' means it will never receive a connection from any other computer. LOCALHOST is, by defintion, non-routable. It always means 'this machine only.'

Second, is the database on the same box as your client -- sqlplus, sqldeveloper, jdeveloper, whatever?

Third, do you understand that the listener is a server side process and runs on the machine with the datbase? It has no meaning or use on the client machine.

Fourth. If this as 'one box' setup -- you installed the database on your personal computer for study ... did you follow the installation instructions to the letter -- ESPECIALLY the part about installing the loopback adapter and assigning a fixed IP address?
Jim Smith
Looks like the listener isn't running again.

start up the listener
start up the database

After a miinute or two try lsnrctl status
neeshu
thanks for the reply ED
what should I do then yes the sqlplus and sqldeveloper are on the same box i am using it on my laptop for study purpose.

no i didnot assign any ip address during the installation process it was left to default.


I will post the status once again jim thanks
-----------------------------------------------------------------------------------------------------


Ok. first thing first. configuring the listener to listen on 'localhost' means it will never receive a connection from any other computer. LOCALHOST is, by defintion, non-routable. It always means 'this machine only.'

Second, is the database on the same box as your client -- sqlplus, sqldeveloper, jdeveloper, whatever?

Third, do you understand that the listener is a server side process and runs on the machine with the datbase? It has no meaning or use on the client machine.

Fourth. If this as 'one box' setup -- you installed the database on your personal computer for study ... did you follow the installation instructions to the letter -- ESPECIALLY the part about installing the loopback adapter and assigning a fixed IP address?
neeshu
Here is the listener status after it was started will i need to start listener each time I run the sqldeveloper.





[oracle@localhost ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 20-MAY-2012 20:38:43

Copyright (c) 1991, 2005, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date 20-MAY-2012 20:35:27
Uptime 0 days 0 hr. 3 min. 16 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.localdomain)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "TSH1", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "TSH1", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "TSH1", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@localhost ~]$

Edited by: neeshu on May 20, 2012 8:20 AM
Jim Smith
Answer
Providing both database and listner are running you should be able to connect through sql developer, specifying localhost.localdomain, 1521 and orcl in the connection properties.

You can set up the listener and database to start on boot. This is well documented in the manuals and around the web. Try googling "autostart oracle database linux" and "autostart listener linux"
Marked as Answer by neeshu · Sep 27 2020
neeshu
Thanks Jim I will try this and reply
neeshu
Thanks jim it worked out like magic,
i started listener and the database, after which connceted using tns server

how do i start listener automatically in linux can you provide me some link
Thanks for the help
1 - 17
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 27 2006
Added on Aug 30 2006
1 comment
893 views