grant select a user to a new user

I know it should be easy, but can't seem to find a way around it.

I can grant roles granted to a user to a new user, but the existing user has loads of select on other tables.

How to get the selection of existing user and give them to the new user?

Thank you

See all the privileges granted to ALICE directly (not through a role)

select * from dba_tab_privs where grantee='ALICE';

With this, you can write a select statement that generates SQL to grant the same privileges to BOB

select 'grant '||privilege||' on '||owner||'.'||table_name||' to BOB;' from dba_tab_privs where grantee='ALICE';

Then, run the output of this statement to make grants.

Tags: Database

Similar Questions

  • Select grant to a user

    Hello
    I'm working on oracle10g and HP - UX.
    I need to create only one user on reading, how can select data from other users tabels.

    One way to do this - is glove instruction to create a srript...
    As

    Grant select on UserA.Tb1 to UserB;
    Grant select on UserA.Tb2 to UserB;
    Grant select on UserA.Tb3 to UserB;

    and so on...

    There are 4000 tables in the schema UserA... .and we need to write a sql script and run it on the database...

    Question-

    Is there a way to UserB's Select glove on all the obj. for use in a sql statement...?

    N ° there is no single GRANT command. You can, however, write a small script to PL/SQL, i.e.

    FOR x IN (SELECT * FROM dba_tables WHERE owner = 'UserA')
    LOOP
      EXECUTE IMMEDIATE 'GRANT SELECT ON UserA.' || x.table_name || ' to UserB';
    END LOOP;
    

    Of course, you would usually create a new role, grant this role to UserB and grant the privileges to this role, i.e.

    CREATE ROLE UserA_Select;
    
    GRANT UserA_Select TO UserB;
    
    BEGIN
      FOR x IN (SELECT * FROM dba_tables WHERE owner = 'UserA')
      LOOP
        EXECUTE IMMEDIATE 'GRANT SELECT ON UserA.' || x.table_name || ' to UserA_Select';
      END LOOP;
    END;
    

    In this way, when you need create the next read-only user, you just need to give this user the role of UserA_Select.

    Justin

  • How to remove grant select to one user, if this table contains public subsidies.

    Hi all

    Owner of the table gave all access to a table to the public

    for example

    >

    grant all on table1  to public;
    

    But now for a user "user1" if we remove select grant

     revoke   select  on table1 from user1;
    

    I get the error ORA-01927: cannot REVOKE privileges you did not

    OK if I revoke all access to "user1."

    revoke   all  on table1 from user1;
    

    I get Revoke succeeded.

    But always in the connection of the User1, I can select data from table1.

    Why?

    Is it because I gave all subsidies to the public?

    Above scenario must revoke the access of a user to a table that has all government subsidies.

    Yes, it's because SELECT on the table access has been granted to the PUBLIC.  The user still has the option to SELECT the table after you have removed the direct subsidies because they can always access privileges granted by the PUBLIC.

    If you want all users to have access to the table, you shouldn't be granting access to the PUBLIC in the first place.  Create a new role, grant SELECT on the table for this new role and assign this role to all users need.

    If for any reason, you're stuck with the issuance to the PUBLIC, I suppose you could create a policy from the CAE on the table that prevents the user to see all the data.  But it's a lot more work to get grants of privilege correct in the first place.

    Justin

  • Grant select on the object a.a to user b to user test

    Hello

    I am logged in as user test.

    I would like to issue the following grant.

    grant select on a.a to user b;
    

    Unfortunately, this does not work with the test user. But it works with SYS. What permissions are required for the declaration works as a test.

    Best regards

    Stone

    Documentation, https://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_9013.htm#SQLRF01603

    Prerequisites

    To grant a privilege to system, one of the following conditions must be met:

    • You must have obtained the GRANT ANY PRIVILEGE system privilege. In this case, if you grant the system privilege to a role, then a user who has been granted the role doesn't have the privilege unless the role is enabled in the user's session.
    • You must have been granted the privilege of system with the ADMIN OPTION . In this case, if you grant the system privilege to a role, then a user who has been granted the role has the privilege without worrying if the role is enabled in the user's session.

    To grant a role, you must either got the role with the ADMIN OPTION or have received the GRANT ANY ROLE privilege system, or you must have already created the role.

    To grant a privilege object, you must have the object, or the owner of the object must have a permission you privileges of the object with the GRANT OPTION , or you must have obtained the GRANT ANY OBJECT PRIVILEGE system privilege. If you have the GRANT ANY OBJECT PRIVILEGE , then you can grant the privilege of the object only if the owner of the object could have granted the same privilege of object. In this case, the GRANTOR column of the DBA_TAB_PRIVS view displays the owner of the object rather than the user that issued the GRANT statement.

  • GRANT SELECT on a table to the user / role changes for the tab last_DDL

    Hello

    Is grant select (or any private object) to the user/role a DDL statement?

    GRANT SELECT on a table to the user / role changes the last_DDL to the table.
    1 > is this expected behavior?
    2 > no way in which we can grant select on a table by another user, without changing the DDL? (for example create view).


    The test is performed:

    Prior to the issuance:


    OBJECT_NAME CREATED TIMESTAMP LAST_DDL_TIME OWNER
    ------- ---------------------- ---------- ------------- --------------------
    AR HZ_CUSTOMER_PROFILES 8 MAY 00 13 MARCH 13 2003-06 - 26:12:41:29



    Grant statement:
    GRANT SELECT ON "AR". "' HZ_CUSTOMER_PROFILES ' TO 'AR_VIEW ';

    Note: AR_VIEW is a role, I tried granting also directly to the user.


    After the grant:

    OBJECT_NAME CREATED TIMESTAMP LAST_DDL_TIME OWNER
    ------- ---------------------- ---------- ------------- --------------------
    AR HZ_CUSTOMER_PROFILES 8 MAY 00 21 MARCH 13 2003-06 - 26:12:41:29



    Old thread, discuss whether Grant is DDL or not, but no documented conclusions.
    ( Re: Grant, revoke is DDL and DCL? )

    Please help in the assessment above.

    -Best regards,.
    Mani

    It's the DOF.

    After all, this isn't DML, it implicitly committed and you cannot use it directly in PL/SQL: features of DDL. :-)

  • Grant select on the pattern of other users

    Say there are two patterns A and B, UserA is the owner of A schema and UserB is owner of the schema (B) can we have UserB gave a grant select on A diagram? If so, how? Thank you!

    A GRANT must be performed for each object in the schema of a user.

    Hemant K Collette
    http://hemantoracledba.blogspot.com

  • Grant Select on sys.dba_role_priv to the user; error

    version 10204
    It's the user's request: Add: select sys.dba_role_priv to: ROLE vas_user;

    I was just wondering what I'm doing wrong? How to fix?

    SQL > grant Select on sys.dba_role_priv to vas_user;
    Grant Select on sys.dba_role_priv to vas_user
    *
    ERROR on line 1:
    ORA-00942: table or view does not exist

    I was just wondering what I'm doing wrong?

    incorrect spelling

    How to fix?

    Use the correct name

    SQL> desc dba_role_priv
    ERROR:
    ORA-04043: object dba_role_priv does not exist
    
    SQL> desc dba_role_privs
     Name                                                       Null?    Type
     ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ------ ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
     GRANTEE                                                   VARCHAR2(30)
     GRANTED_ROLE                                                  NOT NULL VARCHAR2(30)
     ADMIN_OPTION                                                   VARCHAR2(3)
     DEFAULT_ROLE                                                   VARCHAR2(3)
    
  • Syntax of GRANT: grant SELECT on table privileges to a user on a remote database

    Hello
    I have two databases: DEV1 and DEV2. Dev1 is my source database and DEV2 is the target database. There is a table in the diagram A on Dev1. I created a DBLINK PUBLIC 'TESTDBLINK' in the diagram B on DEV2 that connects to figure A on DEV1.

    Machine of Table for the database schema
    DEV1 AN EMP 192.168.210.10

    Database Machine Lik database schema
    DEV2 B TESTDBLINK 192.168.210.11

    How to SELECT on the schema Table EMP (DEV1) diagram b the DEV2 privileges? What is the syntax?


    Sign up for example in the form of scheme A on DEV 1

    SQL > GRANT SELECT ON EMP to? * *

    Thanks for your contributions
    Harry

    Do not give this table in diagram A diagram B.

    Inside the diagram B, you can just issue a select statement as follows:

    select *
    from table@db-link-to-A
    

    Oracle connects to the remote instance by using the credentials of the scheme A, and since A is the owner of this table, Oracle can already access the table.

  • WIN8 cannot select the user when connecting more

    I used to have the option to select the user to connect as but now I have a screen that says:

    Press Ctrl + Alt + Delete or use the Windows Security button to unlock

    When I hit Ctrl + Alt + Delete I get only the most recent user login.  If I hit the left arrow right top left of the image, I must return to the Ctrl + Alt + Delete screen.  There is no way I can see to select another user.

    If the current user remembers actually disconnect from the screen Ctrl + Alt + Delete I am taken to a login with a choice of the users screen.

    This used to work and I don't know if my 5 yo changed something or if a updated Windows did something.  But my wife and son both need to use this notebook so I really need separate accounts.

    I found a few long really complex stuff on the ' net on the definition of the strategy group and fiddle with the registry but I know my 5 yo did nothing like that.

    How do I change back?

    Dennis

    PS what is the "Windows Security button" anyway?

    I realized that I had recently installed Cisco AnyConnect VPN software to connect to the work.  Which of - installed and now life is still happy.  I will contact Cisco.

    Sorry for the short reply above.  Validation has been broken here earlier today and several machines at the same time making a response and a new post, I didn't type a bunch just to get the "Oops, something went wrong" again.

    Dennis

  • System to grant to the user of the application views

    Hi all

    11.2.0.1

    Batch process Tha night encounter problem blocking where their generations report affected and delayed.

    I give this command operators, so that they will kill or stop the process that keeps the lock:

    SELECT TO_CHAR ("sysdate, ' HH24:MI:SS of MON-DD-YYYY"). ' The user '. S1. UserName | | » @'|| S1.machine | | "(SID = ' | s1.sid |)

    ') with the statement: ' | sqlt2.sql_text | |' if it blocks the SQL statement ' | S2. UserName | | » @'|| S2.machine |

    ' (SID ='|) S2.SID | |') Blocked-> SQL ' | sqlt1.sql_text AS blocking_status

    GV $ lock l1, Gv$ session s1, Gv$ lock Gv$ session s2, l2, Gv$ sqlt2, Gv sql $ sql sqlt1

    WHERE s1.sid = l1.sid

    AND s2.sid = l2.sid

    AND sqlt1.sql_id = s2.sql_id

    AND sqlt2.sql_id = s1.prev_sql_id

    AND l1. BLOCK = 1

    AND l2.request > 0

    AND l1.id1 = l2.id1

    AND l2.id2 = l2.id2;

    But this needs system views and you can not run the app user ID.

    On the security audit decision or without having violated, what I have to grant select to all system views accessed by this script to the user of the application, then create synonyms it 1 by 1?

    Or is it a one-time grant for all views of the system? So I is not need to type a plus creating synonyms so that I can't miss any?



    Thank you

    Petra k.

    f55237a7-2c38-4DB3-a7a3-1d77256f0730 wrote:

    Hi all

    11.2.0.1

    Process batch Tha night meets lock problem where their generations report interrupted.

    I give this command operators, so that they will kill or stop the process that keeps the lock:

    SELECT TO_CHAR ("sysdate, ' HH24:MI:SS of MON-DD-YYYY"). ' The user '. S1. UserName | | » @'|| S1.machine | | "(SID = ' | s1.sid |)

    ') with the statement: ' | sqlt2.sql_text | |' if it blocks the SQL statement ' | S2. UserName | | » @'|| S2.machine |

    ' (SID ='|) S2.SID | |') blocked SQL-> ' | sqlt1.sql_text AS blocking_status

    GV $ lock l1, Gv$ session s1, Gv$ lock Gv$ session s2, l2, Gv$ sqlt2, Gv sql $ sql sqlt1

    WHERE s1.sid = l1.sid

    AND s2.sid = l2.sid

    AND sqlt1.sql_id = s2.sql_id

    AND sqlt2.sql_id = s1.prev_sql_id

    AND l1. BLOCK = 1

    AND l2.request > 0

    AND l1.id1 = l2.id1

    AND l2.id2 = l2.id2;

    But this needs system views and you can not run the app user ID.

    In view of the security check or without having violated, what I give select all system views accessed by this script to the user of the application, and then create the names it 1 by 1?

    Or is it a one-time grant for all views of the system? So I no need to type one by one so that I can't miss any?

    Thank you

    Petra k.

    While approach posted will work subsequently, it's like making three left turns around the block;

    instead of making a single term of law.

    Place the SQL desired in a procedure (FIND_LOCKER) owned by the extremely privileged schema; then do as below

    GRANT EXECUTE ON FIND_LOCKER TO OPERATOR_USER;

  • all grants to a user

    Hi all

    Can you me the script share how to list EVERYTHING - all roles, objects, privileges granted to a user? say 'HR' to the user.


    Thank you.

    USER_SYS_PRIVS lists all the system privileges granted to a user

    SELECT privilege
      FROM user_sys_privs
     WHERE username = 'HR'
    

    USER_TAB_PRIVS lists all the privileges granted to a user object

    SELECT owner, table_name, privilege
      FROM user_tab_privs
     WHERE grantee = 'HR'
    

    And USER_ROLE_PRIVS lists all the roles that have been granted to a user

    SELECT granted_role
      FROM user_role_privs
     WHERE username = 'HR'
    

    It may become more complex as of here, however, if you want to list all the privileges granted to these roles, the role given to the roles, privileges granted to these roles, etc. recursively. Fortunately, Pete Finnigan has a handy script that implements this logic. You can go down the script of find_all_privs.sql his site.

    And it becomes much more complicated if you want to grant privileges that do not follow the normal patterns. Privileges of Java, for example, network ACL, Workspace Manager privileges, etc.

    Justin

  • When a second (another) user tries to connect using the connection to distance that a message "select a user to disconnect so you can connect.

    Original title: Remote Desktop

    We have Windows Server 2012 essentials (evaluation version) installed and working.  When connecting to even via the remote desktop connection it works fine, but when a second (another) user tries to connect using the connection to remote, a message "select a user to disconnect so you can connect.  The names of the 2 users are displayed the first is the name of the administrator of the local server and the second is the remote desktop user who was first.  We need at least 3 to 4 remote desktop both users to be connected.  Please advice

    Hi BHARATISRANI,

    Thanks for posting in the Microsoft Community.

    Since you are using Windows Server 2012 Essentials, the question you posted would be better suited for COMPUTING public Pro on TechNet. I would recommend posting your query in the TechNet Forums to get help:

    Windows Server 2012 Essentials General TechNet Forums

  • I want to value report a selection event (user) menu

    Hello

    1.i want to value signal a selection event (user) menu of the first image of the sequence structure, a vi and the watering duration menu is attached.kindly solve my problem.

    2. can we use fixed menu point info function in one event other menu then selection (user).

    Thank you

    If you want to run this code unconditionally as a first step, you don't need a structure of the event. It would make no sense at all, just do the following:

    Just use plain old dataflow instead of a sequence. Use the mistake to enforce the execution order (not shown).

    (btw: your question.zip file is not a zip file.) To open it, we need to rename it to question.rar first. Is there a reason why you changed the extension?)

  • Checking roles & sys privs granted to a user.

    Hi all

    11.2.0.1

    Im still confused in many roles and privileges required a user.

    What is the role or sys privs granted to a user, then it can export/import its own table?

    Thank you very much

    zxy

    > so this is something developers and DBA not so it should be granted.

    But how a developer will get create a privilege if operator that is not given to DBA.  Obviously, operator and PL/SQL are used and written by the developer, but they are maintained by DBA at the database level.

    > Unlimited tablespace, what would you say? I did not grant this privilege to HR, but he was able to acquire access unlimited tablespace.

    Because HR user resource. which implicitly grant unlimited tablespace privilege to the user, as I already mentioned, do not use resource to the user it is also recommended by Oracle.  Create your own role, grant privileges system and object required role and now assign this role to the user.

    Concerning

    Girish Sharma

  • Grant to the user API

    Hi team

    someone can tell me how we can grant API Oracle user, really appreciate help.

    Kind regards
    Mahesh

    Mahesh,

    Are you talking about [url http://docs.oracle.com/cd/E23943_01/portal.1111/e10238/pdg_cm_intro.htm#POBLD478] 9.3 providing access to APIs and Secure views?

    In this case, you can use provsyns.sql. Note that the instructions to get the portal password apply to the 10g only. If you want to get on 11g, use the instructions in the Note [url https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=843978.1] 843978.1, "How to recover the portal schema Portal 11g password?".

    Thank you
    EJ

Maybe you are looking for

  • How to download a txt file?

    Instead of opening, that a text file on the browser beforehand so cannot read anywhere else when I don't have a connection, I can't find a way to download it, save it to my phone and read later. That really sucks.Playback mode does not help if I can'

  • Local network problem and drivers USB, HP Pavilion G6-2314AX

    Hello, I'm having a problem in the installation of the USB drivers and LAN adapter. I am unable to connect to the Internet, the LAN icon in the taskbar shows sign of the cross. Because this laptop is not any CD of driver with the pack so I am unable

  • LENOVO Thinkpad x 201 result code projection hardware test: WHD01V002-WK5CCH

    Hello. I scanned mysystem using LSC and iut gave me the following result Storage devices Display nameSAMSUNG HM160HI - 149,05 GBManufacturerSamsungModelSAMSUNG HM160HISerialS18PJDNS104726FirmwareHH100-12Size149.05 GBCache8,00 MBsTemperature42 CPhysic

  • Primary partition deleted in Windows Installer

    and now I'm stuck. Long story short: I wanted to make a completely clean install of Vista on my Acer Aspire 6930, delete all my data in the process. So I used the factory Acer reset tool that seems to work, but then got stuck in a boot loop where he

  • BlackBerry smartphone how to download the file Word for Blackberry 9700

    How to download word for blackberry 9700? I launch Desktop Manager-> Media-> Media Manager, but it fails.   But I can't find any icon to transfer files from PC to device Backberry word. My Blackberry is 9700, V5.0.0.330 (Platform 5.1.0.91)