Grant access to schema

Can some give me a script to do the following:
I have a schema name ABC and I want to give a user XYZ read access to all objects in the ABC schema. ie (TABLES, VIEWS. SWQUENCES etc)

Hi,
user8822168 wrote:
Can anyone share some light on this
select 'grant select on '
     || owner
     || '."'
     || object_name
     || '" to ABC'
from      ALL_objects
where      object_type in ('TABLE','VIEW','SEQUENCE')
AND      owner IN ('XYZ', 'PQR')
I run the above sql and it exeute without error and it shows that the grant was given to "ABC", but when I login as ABC I cannot see any of the objects that belongs to XYZ or PQR.
I did use XYZ.object_nameThat looks like the correct way to build a GRANT statement.
Post the complete procedure, including the EXECUTE IMMEDIATE statement that runs the statement built by the query above.
Please don't post unformatted code. Type these 6 characters:
(small letters only, inside curly brackets) before and after sections of formatted text, to preserve spacing.
Do I need some special previlege to grant select access to ALL ('TABLE','VIEW','SEQUENCE') at once As far as I can tell, you're not granting privileges on all objects at once; you're granting privileges on one object at a time (if at all; I haven't seen your EXECUTE IMMEDIATE statement).  There may only be a couple of milliseconds between the GRANT statements, but each one is for only one object.
I even try to use one owner at a time by login as the schema owner but it did not work.Before XYZ can grant privileges on PQR's objects, PQR must grant the same privileges to XYZ WITH GRANT OPTION.
I suggest you not try to do this; instead, have XYZ run the procedure just to grant privileges on XYZ's objects, and have PQR run it to grant privileges on PQR's objects.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Similar Messages

  • Grant access to all the views created in user schema to another schema

    How to grant access for all the views created in own HAGGIS schema to comqdhb schema on the HAGGIS database.
    Oracle Grant Privileges
    ===============
    Object privileges assign the right to perform a particular operation on a specific object
    I read that we can use select 'grant select on' ||view_name||'HAGGIS' user_views where owner='COMQDHB'
    Is this right
    Oracle System Privileges
    ===============
    System privileges should be used in only cases where security isnt important,because a single grant statement could remove all security from the table
    Role based security
    ============
    Role security allows you to gather related grants into a collection-since the role is a predefined collection of privileges that are grouped together.privileges are easier to assign to users.
    [http://www.dba-oracle.com/art_builder_grant_sec.htm]
    can we grant select update to all the views at a time to the other schema.
    Are there any other ways to secure the data other than creating users and assigning roles.
    Thank you
    Edited by: Trooper on Dec 23, 2008 9:24 AM

    I think what was suggested was that you use SQL to generate the grants on each and every view, that is, you use SQL to generate SQL where the SQL being generated is "grant select on view_name to role'"
    If you users to connect to Oracle you have to create usernames for them though if the users only connect via an application the application might run just as one user and access to the application is controled via application security. The control on the application can be via Directory Services such as OID or MS Active Directory. User access to Oracle can also be controlled via OID.
    To connect to Oracle you can use OS authenication (not recommended), usernames with passwords, or via Advanced Security Option which supports single sign-on products like Kebros or Oracle Internet Directory etc....
    Example using SQL to generate SQL
    How do I find out which users have the rights, or privileges, to access a given object ?
    http://www.jlcomp.demon.co.uk/faq/privileges.html
    HTH -- Mark D Powell --

  • Grant access to specfic schema

    Is there any way that these permissions could be created without the ANY clause?
    CREATE ANY CONTEXT
    DROP ANY CONTEXT
    EXECUTE ANY PROCEDURE
    EXECUTE ANY TYPE
    I got access to only one schema ..Client side DBA are not permitting access to "ANY" clause but they are ready to grant access like create context, drop context etc ..Is there any access like CREATE CONTEXT, DROP CONTEXT,EXECUTE PROCEDURE,EXECUTE TYPE for to give access to one user alone..etc ???
    Advice me on this !!
    Regards
    dkoracle

    Pl post details of OS and database versions.
    Have you read the documentation ?
    http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/statements_5002.htm#i2060927
    http://download.oracle.com/docs/cd/E11882_01/server.112/e26088/statements_8008.htm#i2099532
    If so, what have you found ?
    If not, I think it is time to read up !
    Srini

  • Grant access to all object/tables in other schemas to a user

    Is there any and simple way to grant access to all object/tables in other schemas (more than one) to a scheme/user?
    Thanks.
    Tarman.

    HI.
    grant SELECT ANY TABLE,delete any table, insert any table to user; Giving this delete,insert ANY TABLE privilege to a user can be dangerous and the use can mislead it. Its better to create a dynamic script and then grant it.
    E.g Suppose you want to give select,inert,delete,update privileges to user A on user B's object.
    sql> spool grants.sql
    sql> select 'grant select,insert,update,delete on '||owner||'.'||table_name||' to A;' from dba_tables where owner='B';
    sql>@grants.sqlHTH
    Anand

  • Grant schema to be able to access another schema"

    how can i grant another schema to be able to access another schema
    Edited by: adf009 on 2013/02/15 5:07 PM

    adf009 wrote:
    i want to access one schema object through another schemaGRANT SELECT ON SCHEMA_A.EMP TO SCHEMA_B.
    It's in the SQL Reference Manual.

  • Importing data into tables with grant access (sql developer 3.2)

    Hello,
    I want to import data into a table PAY_BALANCE_BATCH_LINES which is an interface table. I'm logged in to a schema (APPS) and this table belongs to the HR schema. However, if you look at the grants, the APPS schema has all access to this particular table. In TOAD, this used to work great.
    But in sqldeveloper, when I filter the tables dropdown, I am not able to find this table. Since this is my primary way of uploading data I'm not sure how else I can get access to upload data into this table. I don't know the password for the HR schema by the way.
    Is there a way out?
    Many Thanks

    Scroll down the tree to the 'Other Users' node, expand it, and then drill down into HR > Tables. Then do your import.
    For an alternative browser, right-click on your connection in the tree and open a Schema Browser.

  • Grant access to package in schema2 from schema1- how? Or...

    Hi
    I am trying to test utPLSQL. utPLSQl is installed in schema1@instance1 and the package that I need to test is located in schema2@instance1.
    How can I access package to be tested present in schema2 from schema1? The package has a number of procedures accessing many tables etc.
    GRANT EXECUTE ON SCHEMA.PACKAGE TO USER
    Will this be enough?

    If the schema2.package_name has been successfully compiled using defining user authorization (default) and not current user authorization then yes all any other username requires to use the package and perform any DML activity defined in the package is an "execute" grant on the package.
    In the case of current user authorization then the executing user would also need DML grants on the referenced objects.
    HTH -- Mark D Powell --

  • Access to schema objects

    Guys,
    I am on 10g R2 and have this requirement.
    We refresh our QA environment from PROD every day ( exp/imp and schema refresh ). App team now have a requirement where by they want to create few objects including tables every day and load those tables with static data. This in a way doesn't need to be refreshed every day.. So, could place this in another schema. But we do not want to grant access on that schema to the user.
    Alternatively, we can get them to send the us a script, that can be run as POST refresh script on completion of the refresh. But this would mean that any changes to the script will involve us copying the file, which could be a hassle.
    I am wondering, if there is better way to handle this.. BTW, the app team do not have access to the database host and we don't plan to grant it either..
    What is the best alternative ?

    You can use DBMS_METADATA and EXECUTE IMMEDIATE
    SQL> create user u1 identified by u1;
    User created.
    SQL> create or replace type u1.type1 as object (a number, b date);
      2  /
    Type created.
    SQL> declare
      2  stat varchar2(32000):= dbms_metadata.get_ddl('TYPE','TYPE1','U1');
      3  begin
      4    execute immediate replace(stat,'"U1".','');
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SQL> desc type1
    Name                                                        Null?    Type
    A                                                                    NUMBER
    B                                                                    DATEYou can loop on all schema objects selected from dba_objecs to manage all objects with a single statement:
    SQL> create function u1.f1 return number is
      2  begin
      3    return 0;
      4  end;
      5  /
    Function created.
    SQL> declare
      2  stat varchar2(32000);
      3  begin
      4    for r in (select object_type, object_name from dba_objects where owner='U1') loop
      5      stat := dbms_metadata.get_ddl(r.object_type,r.object_name,'U1');
      6      dbms_output.put_line(stat);
      7      execute immediate replace(stat,'"U1".','');
      8    end loop;
      9  end;
    10  /
      CREATE OR REPLACE TYPE "U1"."TYPE1" as object (a number, b date);
      CREATE OR REPLACE FUNCTION "U1"."F1" return number is
    begin
      return 0;
    end;
    PL/SQL procedure successfully completed.
    SQL> desc f1
    FUNCTION f1 RETURNS NUMBER
    SQL> desc type1
    Name                                                        Null?    Type
    A                                                                    NUMBER
    B                                                                    DATEMax
    [My Italian Oracle blog| http://oracleitalia.wordpress.com/2010/02/07/aggiornare-una-tabella-con-listruzione-merge/]

  • GRANT ACCESS with sys user

    hi
    i have an user with objects, tables, views and procedures but it doesn't´t have dba privileges... how can i grant access to all the user to these objects? (with the sys or system user).
    thanks for your help.
    alex

    Hello,
    Every user in database has its objects and DBA privileges are not for everyone.
    how can i grant access to all the user to these objects? (with the sys or system user)<<<<<<Can explain these lines ?? What's your requirment ?? Please state clearly...
    As far as i got your problem, you require that all other users of databse should be able to access the objects of user (lets say A) which you specified in first line.
    For this purpose create public synonyms for all objects of user A and grant. So, everyone can use the objects of "A's" schema.
    Please update..... if you got the point or not...

  • Cancelling the privaleges of the user accessing the schema objects ???

    Hi,
    I have given privilages to the user to access my schema objects(tables). Can i cancell the privilages of the user of accessing my schema objects(table) which i granted them ???
    Thank you !!!

    Hi,
    If you gave a privilege or role to a user using GRANT, you can take it away using REVOKE.
    For example:
    REVOKE  SELECT ON my_table FROM user_name;un-does the privilege given by
    GRANT  SELECT ON my_table TO user_name;

  • Access Mulitple schema

    Hello All
    My application used two distinct schema for data ... basically i am oracle guy....
    i am faceing trouble " table not exist " dureing the application ....
    So can any one suggest best posible way to resolve this probs when we use mulitple schema in applications...
    All query used schema.table name...
    Ash

    it's probably a security issue.
    If you log in as user a which has access to schema a, then they may not have priviledges to select from tables in schema b.
    Two options:
    1. Have two separate connections, one for schema a, and one for schema b. Assuming that you don't have any queries that perform joins between them.
    2. Grant "select" priviledges on schema b to user a, so that you can log in as user a, and access both schemas.
    regards,
    Owen

  • Grant permission to Schema

    Hi,
    One of my team member has created a schema "CUSTOMER".  I have access to SYSTEM user and unable to see that schema "CUSTOMER" under catalog objects.  I am unable to grant access to other schema members using SYSTEM user or my own user because the schema is originally created by other team member.
    I get an error "Could not grant privilege 'SELECT' on 'CUSTOMER'. You are not authorized to perform the required actions"
    Can someone tell me how to grant access.
    Regards.
    Anjan

    Hi Anjan,
    Granting the access to a schema to other users is possible only from the dbuser using which the schema was created.
    In your case, you should login to the system with the user which created the schema "CUSTOMER" and from that user you should be able to grant access to "CUSTOMER" schema to SYSTEM user and your USER.
    Regards,
    Rashmi

  • Sql server grants access to specific login to database.

    i have created website for intranet and hosted it on server. for that i needed to create login "IIS APPPOOL\hi" in sql server 2008 for my application
    to access my "reportdb" database. "IIS APPPOOL\hi" has sysadmin and public server roles in sql server 2008. And i have default login"sa" same
    as "IIS APPPOOL\hi". these are working correctly. Now I want these two logins to access"reportdb" for all
    operations in database and remaining all logins should be denied to access"reportdb". My Sql Server 2008 is having mixed mode (windows authentication and Sql authentication). plz help me

    I think what Tauseef is requesting is to keep access for the 2 sysadmins & deny access to everyone else, correct?
    As Uri mentioned, by being part of sysadmin role, “IIS APPPOOL\hi” & “sa” would have access to everything in the server, and nobody else should have access to the DB unless explicitly being granted access.
    If you would really deny anyone else access to the database, you can potentially deny connect to public, and only sysadmins (who override permissions) would be able to connect; although I would strongly recommend against such practice.
    Something else I would like to recommend against is the usage of sysadmin for what may not be a DBA role (IIS appPool). Following the least-privilege principle, I would recommend having a non-administrator user for applications that has enough capabilities
    to perform the tasks needed.
    The main risk is that a SQL injection (SQLi) bug in your application would lead to a complete compromise of your SQL server.
    If there are app tasks that would require elevated permissions, I would recommend encapsulating the logic in a stored procedure and either use impersonation or digital signatures to accomplish a controlled elevation of privileges instead. If you have any
    question on this topic I will be glad to assist.
    I hope this information helps,
    -Raul Garcia
     SQL Server Security
    This posting is provided "AS IS" with no warranties, and confers no rights.

  • Update to IOS 6 has been a nightmare. Facebook would allow me to save pictures unless I granted access to my foto album. Does this mean my pictures are going be planted all over the web? The safari keeps crashing and loading is slow.

    update to IOS 6 has been a nightmare. Facebook would allow me to save pictures unless I granted access to my foto album. Does this mean my pictures are going be planted all over the web? The safari keeps crashing and loading is slow. Most infuriating is that YouTube was deleted from my entertainment apps and I now have to pay for it if I want it back!! This is a bloody disgrace.

    Back up all data.
    Boot into Recovery by holding down the key combination command-R at the startup chime. Release the keys when you see a gray screen with a spinning dial.
    Note: You need an always-on Ethernet or Wi-Fi connection to the Internet to use Recovery. It won’t work with USB or PPPoE modems, or with proxy servers, or with networks that require a certificate for authentication.
    When the OS X Utilities screen appears, follow the prompts to reinstall the OS. You don't need to erase the boot volume, and you won't need your backup unless something goes wrong. If your Mac was upgraded from an older version of OS X, you’ll need the Apple ID and password you used to upgrade, so make a note of those before you begin.

  • Why doesn't Photoshop touch ask for access to local photos on my iPad so I can grant access and edit?

    Why doesn't Photoshop touch ask for access to local photos on my iPad so I can grant access and edit?

    That's odd. Does this mean that you want to have the request or that you can't see the photos even though you enabled it over the privacy/photos?
    If you enable it - it's not necessary to get the request. If you want the request the safest way to get it back is to reset the privacy settings by going to iPad settings/General/Reset/Reset Location & Privacy
    thanks,
    Ignacio

Maybe you are looking for

  • Keyboard doesn't work in Finder

    Hi all. Yesterday my keyboard stopped working in Finder. I had a look on the forums and found a fix which was to delete the com.apple.preferences.finder file, or whatever it was called. However, this fix has only worked till today! Finder again refus

  • Default selection color

    Need some help with the following: Meshes in an 3D annotation are selectable, clicking a mesh changes it's color. double clicking a mesh selects all meshes in the annotation and draws some kind of wire frame box around all meshes in the scene. I want

  • Why does feba post to worng posting key?

    Generated IDoc from FEBA and processed an incoming payment . it was supposed to be posted to vendor but posts to customer in stead. Where can I check for FEBA related configuration and vendor customer relationship

  • BT Broadband Line from exchange

    BT is a total and abslolute joke I subscribed to BT services for over 9 years witthout a single improvment to my BB speed, I continualyy got the same old dreary excuse excuse  !  its your disctance form the exchange - well thats **bleep** - because m

  • Verizon VRUC-A (Verizon Re-Use Card-Amount)

    A short time ago in the District of Columbia near, near to me a store was visited, ready associates eager to accept any form of payment from needy customers, one of which, an Eco-conscience consumer requiring a VRUC-50 ( Verizon - Re-use card $50 amo