Oracle命令(三) Oracle使用者

2021-06-16 11:41:56 字數 2344 閱讀 9516

1、顯示當前使用者名稱

select user from dual;

show user

2、顯示當然使用者有哪些表

select * from tab;

3、顯示當所有使用者的表

select * from user_tables;

4、顯示當有使用者可以訪問表

select * from all_tables;

5、顯示使用者為scott的表

select * from dba_tables where owner='scott';

6、顯示所有使用者名稱和帳戶的狀態

select username,account_status from dba_users;

7、顯示所有使用者資訊

select * from dba_users;

8、將scott帳號解鎖(加鎖)

alter user scott account unlock(lock);

9、當前使用者的預設表空間

select default_tablespace from dba_users where username=(select user from dual);

10、顯示當前資料庫的使用者

select username,account_status,default_tablespace,temporary_tablespace from dba_users;

11、建立乙個新使用者

create user edpthw identified by "123456"

default tablespace users

temporary tablespace temp

quota unlimited on users

quota 10m on mytbs2;

12、給使用者授權

grant connect,resource to edpthw;

13、分別授權

grant create any table to "hmtong"

grant create table to "hmtong"

grant drop any table to "hmtong"

grant select any table to "hmtong"

14、物件授權

grant select on "hmtong"."a" to "edpthw"

15、折消授權

revoke unlimited tablespace from "hmtong"

16、折消物件授權

revoke select on "hmtong"."a" from "edpthw"

17、使用者改密碼

alter user edpthw identified by edpthw;

18、授權sysdba給指定使用者

grant sysdba to hmtong;

19、取消指定使用者的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; 取消

21、授權連線給指定使用者

grant "connect" to "hmtong"; grant unlimited tablespace,connect,resource to hmtong;

22、查詢pwfile中存放的使用者資訊

select * from v$pwfile_users;

Oracle命令(三) Oracle使用者

1 顯示當前使用者名稱 select user from dual show user 2 顯示當然使用者有哪些表 select from tab 3 顯示當所有使用者的表 select from user tables 4 顯示當有使用者可以訪問表 select from all tables 5...

Oracle命令(一) Oracle登入

1 執行sqlplus工具 c users wd pc sqlplus 2 直接進入sqlplus命令提示符 c users wd pc sqlplus nolog 3 以os身份連線 c users wd pc sqlplus as sysdba 或 c users wd pc sqlplus s...

Oracle三條常用的命令

一般情況下在沒有輔助工具的時候我們需要使用oracle的自帶命令,這裡介紹3個幾個常用的命令 tnsping 測試oracle伺服器是否連通 exp 匯出資料庫 格式 exp 使用者名稱 密碼 連線字串 file 儲存路徑 儲存名字.dmp 例子 exp test lx xx orcl file e...