查询当前用户的表格~
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 thanALL_USERS
. -
USER_USERS
describes the current user, and contains more columns thanALL_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.
Column | Datatype | NULL | Description |
---|---|---|---|
USERNAME | VARCHAR2(30) | NOT NULL | Name of the user |
USER_ID | NUMBER | NOT NULL | ID number of the user |
PASSWORD | VARCHAR2(30) | | Encrypted password |
ACCOUNT_STATUS | VARCHAR2(32) | NOT NULL | Account status:
|
LOCK_DATE | DATE | | Date the account was locked if account status was LOCKED |
EXPIRY_DATE | DATE | | Date of expiration of the account |
DEFAULT_TABLESPACE | VARCHAR2(30) | NOT NULL | Default tablespace for data |
TEMPORARY_TABLESPACE | VARCHAR2(30) | NOT NULL | Name of the default tablespace for temporary tables or the name of a tablespace group |
CREATED | DATE | NOT NULL | User creation date |
PROFILE | VARCHAR2(30) | NOT NULL | User resource profile name |
INITIAL_RSRC_CONSUMER_GROUP | VARCHAR2(30) | | Initial resource consumer group for the user |
EXTERNAL_NAME | VARCHAR2(4000) | | User external name |
See Also:
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;