Search This Blog

Loading...

Thursday, March 17, 2011

Create and configure Listener for Oracle 10g

When working with Oracle10g you often have problem in LITENER. Especially the beginners often have the error ORA-12505: TNS:listener does not currently know of SID. To day I will guide the way to create and configure the Oracle 10g Listener manually on Linux host.

Assuming you have completed the installation Oracle database on your server. And now you want to create new LITENER for connecting to your Database server.

The first you must check the /etc/hosts file to contain a fully qualified name for the server. The importan is that you have to add this before the default IP(127.0.0.1 localhost). And then your /etc/hosts file like this:
192.168.10.10 oracletest.mycompany.com oracletest localhost.localdomain localhost

127.0.0.1     oracletest.mycompany.com oracletest localhost.localdomain localhost

The second you must set the environment variable TNS_ADMIN to a directory where your LITENER configuration file will be located. You should do this by adding the command into the /home/oracle/.bash_profile file. For example:
export TNS_ADMIN=$ORACLE_HOME/network/admin

The next you navigate to directory in $TNS_ADMIN and create these following files:
  1) listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.10)(PORT = 1521))
    )
  )

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

NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)

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

TEST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.10)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SID = TEST)
      (SERVER = DEDICATED)
    )
  )

The last starting your listener and connecting to your database server.

No comments:

Post a Comment

leave your message if you need help ...

Related Posts with Thumbnails