Saturday, May 8, 2010

TNS-12541: TNS:no listener



The command lsnrctl start ORCLPLSQL resulted in "TNS-12541:TNS:no listener " error yesterday; I was puzzled (See below).

(Screen -01)



Oracle was working perfectly fine till then; moreover, I had not installed any new s/w at all.What could then be the issue?
A search on Google brought up this page: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

As listed in that web page, I tried the first one.
The Command, show parameter local listener displayed that tns port has not changed, listener.ora is pointing to the correct port.
Next, I tried tnsping avs.ramanujam.com, which resulted in the same error message.


(Screen -02)

Another thing I noticed was, both starting up the listener and tnsping was taking more time than usual. Next I ran the ifconfig command, I noticed that the ipaddress had changed. (I have to make a confession here. Even though the best practices and the recommendation is that "servers" should have static ipaddress, I had not made it static.) Bang- sound of myself hitting my head  -changed the ipaddress in the /etc/hosts and I was back into business in no matter of time.
Final screen is after successful connection is shown below

(Screen -03)

Wednesday, May 5, 2010

(Not a ) Bug in Debug Procedures in SQLDev

Today an OP in SQLDeveloper forum at OTN had complained about "disappearing" Green icon on Procedures (To read the post click here Note: Sue has pointed out that it is not a bug.I have posted an update below on how to use compiler with debug option. So if you just want to know how to turn on or off the compiler with debug option, just scroll down. If you have time to kill  :-), go ahead and read the entire post. ) . So, back to my original post.... 
I just happen to have Windows version SQLDeveloper (Build Version 2.1.1.63) and Linux Version (Build Version 2.1.1.64) installed. Just a heads up for those who are wondering about the "green" icons, when you compile a procedure, in SQLDeveloper, if the procedure compiles successfully, then it will display a Green icon on the left of the procedure name. If the procedure fails to compile a "red" stop icon is displayed - pretty cute isn't it? Only that it does not seem be consistent across versions (or is it across OS versions, I wonder)?
Since I usually used Linux, I was not sure what the OP was talking about. I created a few test procedures in 63 (windows version) first (Screen -01).
Windows Build version 63. Notice missing Proc toolbar (Screen -01)

Everything went off without any hitch, although it did not display the Procedure Complier bar, it was not a show stopper. I could compile repeatedly the procedure without any issue, and update the parameter for this procedure (Screen -02).
Modify the parameter (Screen -02)


Next, I started my linux version and recreated the same procedure. Bingo! The first time procedure got compiled and the green icon was displayed. I could see the Procedure 'Compilation' Toolbar. However, when I compiled again, (Screen -03)

Linux Build 64 (notice the Procedure Tool bar (Screen 03)

When I complied "with Debug option", I could see the green icon now (Screen -04)

Go for Green (Compiled with Debug) (Screen -04)

But, I cannot modify the parameter window (Screen -05). I hope SQLDeveloper team will take note of this and correct the bug.

Cann't change the parameter (Screen -05)

Update:
As Sue Harper had pointed out, it was a case of how I compiled. Default Compilation option for SQLDeveloper is to "Compile with Debug"
If you want to reset the default preferences to "compile and no Debug" go to Tools-->Database-->PLSQL Compiler and click on the optimization level and set it to 2. Note: This setting "tells" compiler to optimize the PLSQL Library units. (Screen -06)


After setting the preferences to zero, I reran the procedure and was able to change the input parameter ( See below) .



The log ouput window is shown below. Thanks Sue.


You might also want to read this post ( If using windows:-

How to get SQLDeveloper working on Windows 7

If you are using *nix then

How to make SQLDeveloper work on Linux

)

Oracle Learning Library



Thanks to Sue's post (click here to read her post), I learned that, Oracle has introduced a Learning Library, includes online demonstrations, including APEX tutorials and SQLDeveloper demos. Truly worth watching. Click here to go to Oracle Learning Library. It is easy to search either by Product or by Category. For example to find out how to use SQLDeveloper for Microsoft Access, you would select "Database" under the "Category" and "SQL Developer" under "Product Component" and system provides a search output as shown below. Click on hyperlink under the column "Title" and a new window is launched displaying the Demo.




Monday, May 3, 2010

How to get SQLDeveloper working on Windows 7




Oracle SQL Developer 2.1

I have a 64 Bit Windows 7 installed in my laptop. So I downloaded and installed 64 bit Java software in my machine. Next I found where the jdk was installed (usually it is in the "C:\Program files\Java\jdk<version>". If you cannot find it, go to c:\ and type dir jdk*.* /s /p - 's' will search recursively and 'p' will pause after each page of display). Go to the directory where you have unzipped the SQLDeveloper and open the SQLDEVELOPER.conf file and updated the variable SetJavaHome (This file is located at sqldeveloper\sqldeveloper\bin directory. Then click on the sqldeveloper.exe (located in the same directory), a command window is opened and lanuches SQLDeveloper in a new window. (Note:Do not use the SQLDeveloper.bat - available in the same directory - to launch SQLDeveloper. This would result in problems Procedures/Packages/Function toolbar (see below)


This is the Screen from as launched from SQLDeveloper.bat;As you can see, Both the Compiler options and Procedure Toolbar are missing(Screen -01)


This is the Screen from as launched from SQLDeveloper.exe;As you can see, Both the Compiler options and Procedure Toolbar are present(Screen -02)



Version Screen for Sqldeveloper.bat(Screen -03)



Version Screen for Sqldeveloper.exe(Screen -04)