oracle select语句

来源:互联网 发布:破伤风配置的算法 编辑:程序博客网 时间:2024/06/05 19:27

查询当前用户的表格~

select table_name from user_tables;

查询所有用户的表名~

select table_name from all_tables;

查询用户~  dba_users需要用户有权限

select * from all_users;select * from user_users;select * from dba_users;


all_users、user_users、dba_users的区别:


ALL_USERS

ALL_USERS lists all users of the database visible to the current user. This view does not describe the users (see the related views).


Related Views
  • DBA_USERS describes all users of the database, and contains more columns than ALL_USERS.

  • USER_USERS describes the current user, and contains more columns than ALL_USERS.


DBA_USERS

DBA_USERS describes all users of the database.

Related View

USER_USERS describes the current user. This view does not display the PASSWORD or PROFILE columns.

ColumnDatatypeNULLDescriptionUSERNAMEVARCHAR2(30)NOT NULLName of the userUSER_IDNUMBERNOT NULLID number of the userPASSWORDVARCHAR2(30) Encrypted passwordACCOUNT_STATUSVARCHAR2(32)NOT NULLAccount status:
  • OPEN

  • EXPIRED

  • EXPIRED(GRACE)

  • LOCKED(TIMED)

  • LOCKED

  • EXPIRED & LOCKED(TIMED)

  • EXPIRED(GRACE) & LOCKED(TIMED)

  • EXPIRED & LOCKED

  • EXPIRED(GRACE) & LOCKED

LOCK_DATEDATE Date the account was locked if account status was LOCKEDEXPIRY_DATEDATE Date of expiration of the accountDEFAULT_TABLESPACEVARCHAR2(30)NOT NULLDefault tablespace for dataTEMPORARY_TABLESPACEVARCHAR2(30)NOT NULLName of the default tablespace for temporary tables or the name of a tablespace groupCREATEDDATENOT NULLUser creation datePROFILEVARCHAR2(30)NOT NULLUser resource profile nameINITIAL_RSRC_CONSUMER_GROUPVARCHAR2(30) Initial resource consumer group for the userEXTERNAL_NAMEVARCHAR2(4000) User external name

See Also:

"USER_USERS"

USER_USERS

USER_USERS describes the current user. Its columns (except for PASSWORD and PROFILE) are the same as those in DBA_USERS.

See Also:

"DBA_USERS"

 

forget it.....上述都是官方的,看看如下民间总结的吧:

 

在Oracle中DBA_*、ALL_*以及USER_*的区别

DBA_*意为DBA拥有的或可以访问的所有的对象。

ALL_*意为某一用户拥有的或可以访问的所有的对象。

USER_*意为某一用户所拥有的所有的对象。



查询当前用户权限

select * from all_tab_privs;select * from dba_tab_privs;select * from user_tab_privs;



0 0