DBAsupport.com Forums - Powered by vBulletin
Results 1 to 8 of 8

Thread: COPY VIEW FROM ONE USER TO ANOTHER

  1. #1
    Join Date
    Apr 2001
    Posts
    14
    HI,

    I WANT TO COPY VIEWS OWNED BY ONE USER INTO ANOTHER ORACLE USER. CAN SOME ONE GIVE ME THE SCRIPT TO DO THAT ?

    ..DEVAL

  2. #2
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    View has no data associated with. It is just a definition. Data is extracted from the tables. So it is very difficult to understand "COPYING THE VIEW" ... Well, give the user access privilage to the views...

    Thomas
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

  3. #3
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    You can get the source of the view from the dba_views view:
    [code]
    SQL> set long 4000
    SQL> set linesize 100
    SQL> col view_name for a15
    SQL> col text for a40
    SQL> l
    1 SELECT view_name, text
    2 FROM DBA_VIEWS
    3* WHERE VIEW_NAME = 'DBA_VIEWS'

    SQL> /

    VIEW_NAME TEXT
    --------------- --------------------------------------------------
    DBA_VIEWS select u.name, o.name, v.textlength, v.text, t.typ
    etextlength, t.typetext,
    t.oidtextlength, t.oidtext, t.typeowner, t.
    typename
    from sys.obj$ o, sys.view$ v, sys.user$ u, sys.typ
    ed_view$ t
    where o.obj# = v.obj#
    and o.obj# = t.obj#(+)
    and o.owner# = u.user#

    [code]
    Jeff Hunter

  4. #4
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    Hi All

    Any one , Please, can tell me the usage of copying the View from one User to another User..
    Marist89..??


    Thanks

    Thoams
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

  5. #5
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    I'm not sure what you mean.
    1. get the view definition from dba_views
    2. create view newuser.view_name as results from step 1
    Jeff Hunter

  6. #6
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    he just wants to create the same views, but with a different owner ...
    just do what marist89 suggested you ...
    or create all your views with another user, make synonyms, and grant what is needed for the authorized users to have access to the view ...

  7. #7
    Join Date
    Apr 2001
    Location
    Bangalore, India
    Posts
    727
    My concern is re-creating the view in another user is recomended or giving object prililage to the user..?? Which recomeded ..?

    Thanks
    Thomas
    Thomas Saviour(royxavier@yahoo.com)
    Technical Lead (Databases)
    Thomson Reuters (Markets)

    http://ora600tom.wordpress.com/

  8. #8
    Join Date
    Nov 2000
    Location
    greenwich.ct.us
    Posts
    9,092
    Depends. What are you trying to do?
    Jeff Hunter

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width