Brief notes:
View Current User:
Sql> Show User
USER is "SYS"
To view the dba_users data dictionary:
Sql> desc dba_users
Name Null? Type
----------------------------------------- -------- ----------------------------
USERNAME not NULL VARCHAR2 (30)
USER_ID not NULL number
PASSWORD VARCHAR2 (30)
Account_status not NULL VARCHAR2 (32)
Lock_date DATE
Expiry_date DATE
Default_tablespace not NULL VARCHAR2 (30)
Temporary_tablespace not NULL VARCHAR2 (30)
CREATED not NULL DATE
Profile is not NULL VARCHAR2 (30)
Initial_rsrc_consumer_group VARCHAR2 (30)
External_name VARCHAR2 (4000)
Password_versions VARCHAR2 (8)
Editions_enabled VARCHAR2 (1)
Authentication_type VARCHAR2 (8)
Sql> Set Lines 200
To view the user name and status:
Sql> select Username,account_status from Dba_users;
USERNAME Account_status
------------------------------------------------------------ --------------------------------------------------- -------------
SYS OPEN
SYSTEM OPEN
SCOTT OPEN
Outln EXPIRED & LOCKED
Mgmt_view EXPIRED & LOCKED
Flows_files EXPIRED & LOCKED
Mdsys EXPIRED & LOCKED
Ordsys EXPIRED & LOCKED
Exfsys EXPIRED & LOCKED
Dbsnmp EXPIRED & LOCKED
Wmsys EXPIRED & LOCKED
USERNAME Account_status
------------------------------------------------------------ --------------------------------------------------- -------------
HR EXPIRED & LOCKED
SPATIAL_CSW_ADMIN_USR EXPIRED & LOCKED
SPATIAL_WFS_ADMIN_USR EXPIRED & LOCKED
Selected rows.
Help Document View:
SQL---SQL Statements:alter TRIGGER to COMMIT---ALTER USER
Status changed from expired & Locked To open:
sql> alter user HR account unlock;
Sql>alter user hr identified by HR;
Verify
Sql> Conn Hr/hr
Connected.
Sql> Show user;
USER is "HR"
View all the tables in the data dictionary user_tables:
Sql> Select table_name from User_tables;
table_name
------------------------------------------------------------
JOBS
EMPLOYEES
Countries
LOCATIONS
Departments
Job_history
Regions
7 rows selected.
This article is from the "Emperor Heart Zen Shadow" blog, please be sure to keep this source http://yedee.blog.51cto.com/513852/1561316
"Notes" 1th, 2 speaking: SQL overview