Link to home
Start Free TrialLog in
Avatar of Sieger
Sieger

asked on

Create Database Link

I need to create a database link to another database in our network.  I set up the Easy Config for that remote database and it connects with NetTest.  I typed something like this to create the link:

create database link testlnk connect to smith identified by password using '2:DB2';

here smith is the user, passsword is the password, and DB2 is the name of service I created with Easy Config.

now, I don't understand what the 2: means here but when I try to query table over there, it gives me the following error:

ORA-09352: Windows 32-bit Two-Task driver unable to spawn new ORACLE task

Please help!
Avatar of junfeb
junfeb

I don't think you need the 2 .
Just
create database link test connect to scott identified by tiger using 'db2' where
db2 is the service that you created should be fine.
Avatar of Sieger

ASKER

I tried that but it gives me a service name couldn't be solve error...

ORA-12154: TNS:could not resolve service name
1. Specify the the remote database in the TNS names of the machine from where you want to make the connection.
2. try to ping to the database ( for Oracle 7.3.4 this is tnsping )
   TNSPING "DB_ALIAS"
   IF THIS failes your setup of the alias was not correct.

3. Try to connect to this remote database by SQLPLUS user/password@REMOTE_DB where REMOTE_DB the alias is that you specified in the TNS_NAMES.

If this succeed you can create a database link :
create database link "DB_LINK_NAME" connect to "USER"  identified by "PASSWORD" using "DB_ALIAS_NAME"

Greetz

Jan
Avatar of Sieger

ASKER

Also, the SID for the remote database is not ORCL.. but I don't think it matter tho since we set it up ok in Easy Config..
Avatar of Sieger

ASKER

It works when I try to logon to remote database with SQL Plus.
but it doesn't work with db link...

gives me that TNS error still....

PLEASE BEAR WITH ME!! :)
Did you try to connect through SQL-PLUS at the server itself where you want to specify the DB-LINK?

Brear in mind that a DB_LINK is only a one way communication !!


Avatar of Sieger

ASKER

no.. I installed Oracle Client on a Mac now.. Oracle Server is on NT Server.. the sqlplus runs ok..

The thing is I don't know sqlplus knows where to look up the 'DB2'

The SQL-Plus will look up the DB2 in the TNS_NAMES file of the machine where the SQL-Plus is being executed.

Can you tell me how the C:\ORANT\NETWORK\ADMIN\TNS_NAMES.ORA is looking.
Is the DB2 entry in the TNS_NAMES.ORA file of the server?

The directory specs C:\  assumes that  the installation was executed on the  C drive ....


Avatar of Sieger

ASKER

here's the entry for DB2

DB2=(DESCRIPTION=
       (ADDRESS_LIST=
            (ADDRESS =
                  (COMMUNITY = tcp.world)
                  (PROTOCOL=TCP)
                  (HOST=dbsys2.tru.com)
                  (PORT=1521)
            )
            (ADDRESS =
                  (COMMUNITY = tcp.world)
                  (PROTOCOL=TCP)
                  (HOST=dbsys2.tru.com)
                  (PORT=1526)
            )
      )
       (CONNECT_DATA=
             (SID=TRUINV)
       )
 )
Which version of Oracle server are you using ?

Which version of sqlnet are you using ?
Avatar of Sieger

ASKER

Ouch!! I didn't put the alias at the Server.. that's why it's not working!!  Please repost an answer so I can give you points..

THANK YOU SO MUCH!!
ASKER CERTIFIED SOLUTION
Avatar of jcasteel
jcasteel

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sieger

ASKER

Thanks so much again!! you saved my life :
No problems,

Thanks for the grade ...:-)