How to copy ORACLE user permissions

Source: Internet
Author: User

Many people have mentioned how to copy ORACLE user permissions. The following describes how to copy ORACLE user permissions in detail. If you are interested in ORACLE user permissions, take a look.

Explanation:

If you want to grant ALL permissions to the table, SELECT the view, EXECUTE the other statements.

 
 
  1. DECODE (object_type, 'TABLE', 'ALL', 'VIEW', 'SELECT', 'EXECUTE') 

Then modify execute immediate 'Grant '| rec. grant_type | 'on' | rec. object_name | 'to' | p_grantee;

1). logon as grantor, for instance USER1
2). run PL/SQL scripts:

 
 
  1. DECLARE     
  2.         p_grantee VARCHAR2(30):='ywxt_module_admin';     
  3. BEGIN     
  4.         FOR rec IN (SELECT object_name, object_type  
  5.                    , DECODE (object_type, 'TABLE', 'ALL', 'VIEW', 'SELECT', 'EXECUTE') grant_type FROM user_objects)     
  6.         LOOP     
  7.             BEGIN     
  8.                 EXECUTE IMMEDIATE 'grant all on ' || rec.object_name || ' to ' || p_grantee;     
  9.             EXCEPTION     
  10.                 WHEN OTHERS THEN     
  11.                     DBMS_OUTPUT.PUT_LINE(SUBSTR (SQLERRM,1,240));     
  12.             END;     
  13.         END LOOP;     
  14. END;  

The preceding describes how to copy ORACLE user permissions.

 

Implementation of batch Oracle authorization

How to store images in oracle

Implementation of oracle tree Query

Implementation of oracle query current time

Learn more about Oracle hierarchical Query

   

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.