Sunday 5 February 2012

Connecting SQL Developer with Local Database





Hi Everyone,
We will find a way, when there is a need…
        One such situation is connectivity of Local database with the SQL Developer.
               Here I am going to tell you how exactly we should make connection with screenshots.
Assumptions
1.       Oracle database is installed in the PC.
2.       SQL developer also installed in the PC.

How to connect to local DB??

Step 1 : Add the entry of local connection in the tnsnames.ora file.
                 Path :    C:\oracle_1\....\NETWORK\ADMIN\tnsnames.ora

 LOCAL  =
  (DESCRIPTION =
                                         (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (Host = localhost) (Port = 1521)))
                                (CONNECT_DATA =
  (SID = orcl)))
 
In this
LOCAL        - Name of the local database. User can name it as anything he wants.
localhost       - since the sql developer connects to the db present in the same system.  
orcl              - Global database name. This is default and doesn’t change unless or otherwise we changed it while installation of the oracle DB.
               Step 2 :
This is the view of the SQL Developer initially.
 Step 3:   Add Connection    
Go to
View -> Connections
 in the SQL Developer.
    A connection window will get open.
  
Click to add New connection. 
Step 4 : Fill the details for a new connection
              This screen gets the details about the database to be connected to SQL Developer.



Connection Name : LOCAL
Hostname : localhost
Username and password of the local database. Example : SCOTT and TIGER.
Enter Hostname, Port and Service name as mentioned in the tnsnames.ora.

Step 5: Test the connection.

Step 6:  Connect to the local database



Step 7: Test the connection by executing the queries in the database.


                  Connect to local database and rock on Friends!!.....
                Thanks…




4 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
  2. Hi JL, thanks a lot for this post, as this is exactly what I've been trying to do and am still unable to manage it.

    I did the steps that you have mentioned here, but I get the following error when trying to test the connection:

    "Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection"

    My question is that at no point in the process have we specified the database file that we would like to connected to (i.e. the local database .dbf file). Thus I am not able to understand how the connection would understand which database it should connect to. I guess that's why I'm getting the error.

    I would be extremely grateful if you can provide me with any advice on this. Thanks!

    ReplyDelete
  3. Nice but it is not working .

    Throwing an error(Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection)

    ReplyDelete