Common commands related to user operations in Oracle SQL * PLUS

Source: Internet
Author: User


Oracle SQL * PLUS Common commands related to user operations 1. add database users: (user01/pwd) [SQL] create user user01 identified by pwd default tablespace users Temporary TABLESPACE Temp; www.2cto.com 2. authorize user01: [SQL] grant connect, resource, dba to user01; grant sysdba to user01; commit; 3. delete A user: [SQL] drop user user01; 4. unlock user: [SQL] alter user scott account unlock; 5. change user Password: [SQL] alter user scott identified by tiger; 6. display the current connected USER: Method 1: show user www.2cto.com Method 2: select user from dual; 7. switch Connection User: Switch to common user: conn scott/tiger; Switch to DBA User: conn sys/password as sysdba; (conn can be replaced by "connect") Too many 8. after the DBA user connects to the database, the Oracle user's password encrypted string can be obtained from the dba_users view: [SQL] SQL> select username, password from dba_users where username = 'sys '; 9. view a table or field created by a user (remember that the user name should be capitalized): owned table: [SQL] select table_name from all_tables where owner = 'Scott '; field: [SQL] select table_name, column_name, data_type from all_tab_columns where owner = 'Scott 'and table_name = 'dept'; www.2cto.com 10. display the default tablespace of the currently connected user: [SQL] select username, default_tablespace from user_users; (displayed on PL/SQL Developer may be inaccurate) 11. view All data tables in the current database: [SQL] SQL> select TABLE_NAME from all_tables; Author: lutinghuan

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.