oracle select语句

查询当前用户的表格~

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.

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:
  • OPEN

  • EXPIRED

  • EXPIRED(GRACE)

  • LOCKED(TIMED)

  • LOCKED

  • EXPIRED & LOCKED(TIMED)

  • EXPIRED(GRACE) & LOCKED(TIMED)

  • EXPIRED & LOCKED

  • EXPIRED(GRACE) & LOCKED

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;



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值