"Notes" 1th, 2 speaking: SQL overview

Source: Internet
Author: User

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

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.