Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Connecting to Tables on a different Database/Server 1

Status
Not open for further replies.

DanAuber

IS-IT--Management
Apr 28, 2000
255
FR
If I have two Oracle Databases on two different Unix Servers,connected via a network, how can I look at the tables in the remote database from the local one. Both have the listener running.....

Thanks for any help
 
You will have to create a database link on the local database that connects to the remote db. The easiest way to do this is in the Schema Manager component of Enterprise Manager.

Also there needs to be an entry for the remote db in the tnsnames.ora file on the local server.
 
Karluk - thanks for your reply. Unfortunatley I have no idea what the Schema Manager component of Enterprise Manager is. Can I do it via commands in sqldba ??
 
Hi Dan,

Yes -- you can do this in sqldba or svrmgrl or sqlplus -- any environment that gives you an SQL prompt.

E.G.
[tt]
CREATE PUBLIC DATABASE LINK OTHERDB_LNK
[tab]CONNECT TO mike IDENTIFIED BY mrbigboy
[tab]USING 'otherdb';
[/tt]

You can then issue sql commands like this:
[tt]
Select Count(*) From ALL_TABLES@OTHERDB_LNK;
[/tt]

and sql will:

1) connect to otherdb using the user-name mike and the password mrbigboy
2) run the sql on that table in that database.

You can create private database links by omitting the keyword PRIVATE.

You can make remote tables look local by creating a synonym for the remote table.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top