Oracle命令(三):Oracle用戶

一、顯示當前用戶名
  select user from dual;
  show user數據庫

二、顯示固然用戶有哪些表
  select * from tab;ide

三、顯示當全部用戶的表
  select * from user_tables;spa

四、顯示當有用戶能夠訪問表
  select * from all_tables; 對象

五、顯示用戶爲SCOTT的表
  select * from dba_tables where owner='SCOTT'; rem

六、顯示全部用戶名和賬戶的狀態
  select username,account_status from dba_users; it

七、顯示全部用戶信息
  select * from dba_users;table

八、將SCOTT賬號解鎖(加鎖)
  alter user scott account unlock(lock);登錄

九、當前用戶的缺省表空間
  SELECT DEFAULT_TABLESPACE FROM DBA_USERS WHERE USERNAME=(select user from dual);file

十、顯示當前數據庫的用戶
  SELECT USERNAME,ACCOUNT_STATUS,DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE FROM DBA_USERS; select

十一、創建一個新用戶
  create user edpthw identified by "123456"
  default tablespace users
  temporary tablespace temp
  quota unlimited on users
  quota 10m on mytbs2;

十二、給用戶受權
  grant connect,resource to edpthw;

1三、分別受權
  GRANT CREATE ANY TABLE TO "hmtong"
  GRANT CREATE TABLE TO "hmtong"
  GRANT DROP ANY TABLE TO "hmtong"
  GRANT SELECT ANY TABLE TO "hmtong"

1四、對象受權
  GRANT SELECT ON "hmtong"."A" TO "edpthw"

1五、折消受權
  REVOKE UNLIMITED TABLESPACE FROM "hmtong"

1六、折消對象受權
  REVOKE SELECT ON "hmtong"."A" FROM "edpthw"

1七、用戶改密碼 

  alter user edpthw identified by edpthw;

1八、受權sysdba給指定用戶
  grant sysdba to hmtong;

1九、取消指定用戶的sysdba權限
  revoke sysdba from hmtong;

20、修改系統的受權的屬性
  alter system set remote_login_passwordfile=exclusive;

  能sysdba登陸,能受權
  alter system set remote_login_passwordfile=shared scope=spfile; 只能sysdba登陸,不能受權
  alter system set remote_login_passwordfile=NONE; 取消

2一、受權鏈接給指定用戶
  GRANT "CONNECT" TO "hmtong"; GRANT UNLIMITED TABLESPACE,CONNECT,RESOURCE TO HMTONG;

2二、查詢Pwfile中存放的用戶信息   select * from v$pwfile_users;

相關文章
相關標籤/搜索