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