[askdba] Re: how to change the schema in same session

  • From: "Dan Petric" <petricdan@xxxxxxxxxxx>
  • To: askdba@xxxxxxxxxxxxx
  • Date: Mon, 30 Jul 2007 11:39:00 +0300

Use SET CURRENT_SCHEMA

Note that CURRENT_SCHEMA is not a documented parameter, and therefore
its 
functionality could be changed or the parameter could be made
unavailable at 
any time.

But this is how it works:

ALTER SESSION SET CURRENT_SCHEMA=:USER_ID;

For example:

If you are logged in as user "SCOTT" and want to access or create
objects as 
"TOM" but don't want to specify the schema or use synonyms each time,
then 
you would simply alter our current schema by:

ALTER SESSION SET CURRENT_SCHEMA=TOM;

This would allow you to access or even create objects in the schema
'TOM' 
provided you have the correct privileges.


Solution Explanation:
=====================

CURRENT_SCHEMA only alters the current schema and allows you to access
objects 
in another schema, provided you have the privilege to do so.


References
==========

- This is undocumented parameter, and functionality could
  change any time.

On Fri, 13 Jul 2007 16:52:58 +0100 (BST), "drumil narayan"
<drumilnarayan@xxxxxxxxx> said:
> Hi ganesh and et al
> 
> How do I change the existing schema without altering
> the same session.
> eg. user a, user b
> logged in as user a and want to execute some
> privileged jobs of b without actually assigning any
> grants or privilege to a.
> 
> this is was explained bysome of our dba on lazydba but
> now am not able to find on lazydba 
> 
> kindly help..Drumil
> 
> 
> --- Ganesh Raja <ganesh.raja@xxxxxxxxx> wrote:
> 
> > Same here ... waiting for something to happen :)
> > 
> > On 5/17/07, Abraham Kurian <kurian24@xxxxxxxxx>
> > wrote:
> > >
> > > Dont think , it is !! , havent seen any activity
> > on this group for a long
> > > time now
> > >
> > >
> > >
> > > On 5/16/07, Chirag DBA <chiragdba@xxxxxxxxx>
> > wrote:
> > > >
> > > > Is this group still active ?
> > > >
> > > > --
> > > > Cheers,
> > > > ------------------------
> > > > Chirag Majmundar
> > >
> > >
> > >
> > 
> > 
> > -- 
> >
> -----------------------------------------------------------
> > http://iyertalks.blogspot.com/
> > 
> 
> 
> 
>       Why delete messages? Unlimited storage is just a click away. Go to
>       http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html
> 

-- 
http://www.fastmail.fm - mmm... Fastmail...


Other related posts: