Home » SQL & PL/SQL » SQL & PL/SQL » two users
two users [message #215913] Wed, 24 January 2007 05:06 Go to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
hi

i have two users like user1 and user2

user1 have have 4 tables.

user2 have no tables

present iam connecting user2, i want use user1 tables in user2

is its possible

Thanks
pavuluri



Re: two users [message #215914 is a reply to message #215913] Wed, 24 January 2007 05:08 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
Use imp with the fromuser..touser options.
Re: two users [message #215915 is a reply to message #215913] Wed, 24 January 2007 05:09 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Depends on what you mean by "use user1 tables as user2".

As long as you have the appropriate privileges assigned to USER2, then when connected as USER2, you can select USER1's tables as:

select * from user1.<table_name>;
Re: two users [message #215916 is a reply to message #215913] Wed, 24 January 2007 05:10 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
Quote:
i want use user1 tables in user2


I was assuming that this sentence means you want to copy the table from user1 to user2.
Re: two users [message #215917 is a reply to message #215916] Wed, 24 January 2007 05:12 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Cthulhu wrote on Wed, 24 January 2007 06:10
Quote:
i want use user1 tables in user2


I was assuming that this sentence means you want to copy the table from user1 to user2.

The OP's intention definitely isn't clear.
Re: two users [message #215919 is a reply to message #215916] Wed, 24 January 2007 05:14 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
I think OP want to select user1 tables from user2 schema.
Quote:
i want use user1 tables in user2

Seems OP has used 'in user2' as 'logging in as user2'.

By
Vamsi
Re: two users [message #215920 is a reply to message #215919] Wed, 24 January 2007 05:18 Go to previous messageGo to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
ok

user1 have emp1,emp2 tables

now iam connecting user2. i want access those tables withput copying and import option.
thanks
srinivas


Re: two users [message #215921 is a reply to message #215920] Wed, 24 January 2007 05:21 Go to previous messageGo to next message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
Grant SELECT on those tables to USER2 and then submit SELECT statement as indicated above.
Re: two users [message #215922 is a reply to message #215921] Wed, 24 January 2007 05:31 Go to previous messageGo to next message
JRowbottom
Messages: 5933
Registered: June 2006
Location: Sunny North Yorkshire, ho...
Senior Member
Or grant SELECT on the tables to user2, and then as user2 create synonyms for the tables in user1's schema.
Re: two users [message #215923 is a reply to message #215913] Wed, 24 January 2007 05:32 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
You might also want to create synonyms for user1's tables in order to avoid having to prefix the table_name with "user1." e.g.

private synonym (logging in as user1):

create synonym table_name for user1.table_name;

public synonym (logging in as dba):

create public synonym table_name for user1.table_name;

Re: two users [message #215926 is a reply to message #215923] Wed, 24 January 2007 05:37 Go to previous messageGo to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
Hi all

i have no DBA Privileges

Thanks,
srinivas
Re: two users [message #215930 is a reply to message #215926] Wed, 24 January 2007 05:52 Go to previous messageGo to next message
tahpush
Messages: 961
Registered: August 2006
Location: Stockholm/Sweden
Senior Member

Have you tried what everyone is suggesting or are you assuming?

Do you get at privlige error message ?
Re: two users [message #215934 is a reply to message #215930] Wed, 24 January 2007 05:56 Go to previous messageGo to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
yes iam geting privlige error.

any other way.
Re: two users [message #215936 is a reply to message #215934] Wed, 24 January 2007 05:58 Go to previous messageGo to next message
pavuluri
Messages: 247
Registered: January 2007
Senior Member
iam useing this
Grant SELECT on those tables to USER2 and then submit SELECT statement as indicated above
Re: two users [message #215937 is a reply to message #215913] Wed, 24 January 2007 05:59 Go to previous messageGo to next message
Cthulhu
Messages: 381
Registered: September 2006
Location: UK
Senior Member
The grant statement has to be issued when logged on as USER1.
Re: two users [message #215940 is a reply to message #215934] Wed, 24 January 2007 06:04 Go to previous messageGo to next message
vamsi kasina
Messages: 2107
Registered: October 2003
Location: Riyadh, Saudi Arabia
Senior Member
pavuluri wrote on Wed, 24 January 2007 17:26
yes iam geting privlige error.

any other way.


Quote:
iam useing this
Grant SELECT on those tables to USER2 and then submit SELECT statement as indicated above


Can you PLEASE copy paste the exact statements you have issued and the error, which you have got.

By
Vamsi
Re: two users [message #215969 is a reply to message #215913] Wed, 24 January 2007 08:36 Go to previous messageGo to next message
joy_division
Messages: 4640
Registered: February 2005
Location: East Coast USA
Senior Member
And the reason this question is an expert question is...
Re: two users [message #215983 is a reply to message #215969] Wed, 24 January 2007 09:29 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
joy_division wrote on Wed, 24 January 2007 09:36
And the reason this question is an expert question is...

I think it's because if you are able to get access to other's tables WITHOUT having the privilege to grant privileges on that table, then you'd be an EXPERT??
Previous Topic: An index with no referances to actual rows
Next Topic: table corruption?
Goto Forum:
  


Current Time: Sun Dec 04 14:38:37 CST 2016

Total time taken to generate the page: 0.05448 seconds