Oracle queries existing account creation statement, permission information __oracle

Source: Internet
Author: User
Set linesize set long 100000 set wrap on col "Create_user_ddl" for a200 wrapped word define username= "' VINCENT '"--Modify
UserName, query other existing account Select DBMS_METADATA.GET_DDL (' USER ', &username) ' Create_user_ddl ' from dual; --the result identified by values a string of garbled code is the secret value-you can alter user xxx identified by ' xxx ';
Modify password to destroy--then alter user XXX identified by values ' xxxx ' according to the secret value; --Restore the password, God does not know that God does not understand-of course, you have administrator rights, and then to change the password of other users, is the superfluous ... select DBMS_METADATA.GET_GRANTED_DDL (' System_grant ',&
UserName) "Grant dba_sys_privs DDL" from dual;
--Dba_sys_privs Select DBMS_METADATA.GET_GRANTED_DDL (' Role_grant ', &username) "GRANT dba_sys_privs DDL" from dual; --Dba_role_privs--a method of generating authorization statements by querying a permission table, and Get_granted_ddl method two select ' Grant ' | | privilege| | ' to ' | |
  grantee| |
  Decode (admin_option, ' NO ', '; ', ' YES ', ' with ADMIN OPTION; ')

"Grant dba_sys_privs DDL" from Dba_sys_privs where grantee=&username; Select ' Grant ' | | granted_role| | ' to ' | |
  grantee| | Decode (admin_option, ' NO ', '; ', ' YES ', ' with ADMIN option; ')

"Grant dba_sys_privs DDL" from Dba_role_privs where grantee=&username; -If a user is granted only two roles-that is, a basic business account Resource,connect-then it has only one dba_sys_privs: ' Unlimited tablespace '-owned Dba_role_ There are two privs: ' RESOURCE ', ' CONNECT '--and these three rights admin_option are ' NO '

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.