listener.ora文件:

# listener.ora Network Configuration File: d:/app/john/product/11.1.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = cjtfs)   
      (ORACLE_HOME = d:/app/john/product/11.1.0/db_1)
      (PROGRAM = cjtfs)
    )
     (SID_DESC =
      (GLOBAL_DBNAME = cjtfs)
      (ORACLE_HOME = d:/app/john/product/11.1.0/db_1)
      (SID_NAME = cjtfs)
    )
  )
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = john-PC)(PORT = 1521))
    )
  )

 

tnsnames.ora文件:

# tnsnames.ora Network Configuration File: d:/app/john/product/11.1.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

CJTFS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = john-PC)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cjtfs)   #要和listener.ora里面的cjtfs位置的名字保持一致
    )
  )

 

From http://blog.csdn.net/johnstrive/article/details/5552188