Home » SQL & PL/SQL » SQL & PL/SQL » Select Cross Server
Select Cross Server [message #295967] Thu, 24 January 2008 01:03 Go to next message
juicyapple
Messages: 92
Registered: October 2005
Member
Hi,

How to select data from remote server, and the table is created by another database owner?

Thanks.
Re: Select Cross Server [message #295968 is a reply to message #295967] Thu, 24 January 2008 01:05 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Use the correct user in your database link.

Regards
Michel
Re: Select Cross Server [message #295992 is a reply to message #295968] Thu, 24 January 2008 02:22 Go to previous messageGo to next message
juicyapple
Messages: 92
Registered: October 2005
Member

For eg.

SELECT * FROM [ServerName\UserName].DatabaseName.objectOwner.TableName


If I connect to the database as Administrator, what should I put as the UserName?


Re: Select Cross Server [message #296005 is a reply to message #295992] Thu, 24 January 2008 03:16 Go to previous messageGo to next message
Michel Cadot
Messages: 64139
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
When you say remote server are you calling about remote from the database or remote from the client?

See query_table_expression diagram, the middle flow.

Regards
Michel
Re: Select Cross Server [message #296007 is a reply to message #295992] Thu, 24 January 2008 03:17 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

How to select data from remote server, and the table is created by another database owner?
1. if you trying to connect from client machine then use TNSENTRY like below
SQL>CONN USERNAME/PWD@TNSENTRY

2. if you trying to connect remote database from server database means you have two different database server.
then you have to create database link and using database link you will able to connect as michal already point.

3.
SELECT * FROM [ServerName\UserName].DatabaseName.objectOwner.TableName
Above statement is wrong.

Correct way
select * from username.tablename@db_link;

regards
Taj
Re: Select Cross Server [message #296017 is a reply to message #296005] Thu, 24 January 2008 03:47 Go to previous message
juicyapple
Messages: 92
Registered: October 2005
Member
Yup, I am connecting from database to remote server. Sorry for confusing.
Previous Topic: Rows deleted automatically
Next Topic: Key Expiration in Dbms_Obfuscation Toolkit
Goto Forum:
  


Current Time: Thu Dec 08 22:01:08 CST 2016

Total time taken to generate the page: 0.19168 seconds