SP2-0640: Not connected -- Create database link error Gateway
887834Oct 8 2012 — edited Nov 8 2012While trying to connect through SQL Gateway using "Create database link", am getting "SP2-0640: Not connected" error. below are the details.
====================================================================
TNSNAMES.ora
dg4msql =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SERVICE_NAME = dg4msql))
(HS = OK)
)
====================================================================
LISTENER.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = dg4msql)
(ORACLE_HOME = C:\product\11.2.0\tg_1)
(PROGRAM = C:\product\11.2.0\tg_1\bin\dg4msql)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\product\11.2.0\tg_1
====================================================================
SQLNET.ora
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES)
====================================================================
initdg4msql.ora
HS_FDS_CONNECT_INFO=sqlserverip,port//PMDB
HS_FDS_TRACE_LEVEL=OFF
HS_FDS_RECOVERY_ACCOUNT=RECOVER
HS_FDS_RECOVERY_PWD=RECOVER
====================================================================
outupt of lsnrctl start
The application "dg4msql" state UNKNOWN, has 1 handler for this service ...
The command was executed
====================================================================
output of tnsping
Parameter file used:
C: \ product \ 11.2.0 \ tg_1 \ network \ admin \ sqlnet.ora
was used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521)) (CONNECT_DATA = (SERVICE_NAME = dg4msql)) (HS = OK))
OK (20 msec)
====================================================================
output of db link creation
SQL*Plus: Release 11.2.0.2.0 Production on Lun Ott 8 12:03:08 2012
Copyright (c) 1982, 2010, Oracle. All rights reserved.
SQL> CREATE PUBLIC DATABASE LINK dblink CONNECT TO sa IDENTIFIED BY Manager1 USI
NG 'dg4msql';
SP2-0640: Not connected.