oracle密碼機制以及常用操作

2021-08-26 19:56:45 字數 2797 閱讀 9698

oracle 預設有3個使用者: sys 密碼:自定;system 密碼:自定 ;scott 密碼:tiger(預設鎖定);

注:用sys使用者登入鬚根 [as sysdba]

desc 表名:檢視表結構;

dos啟動監聽:lsnrctl start

dos啟動oracle例項服務: oradim -starup -sid orcl

查詢使用者的系統許可權:select * from user_sys_privs;

查詢使用者的表許可權:select * from user_tab_privs;

賦予系統許可權的時候在使用者後跟:with admin option;--意味著賦予許可權的物件有許可權將此許可權進行傳遞;

賦予物件許可權的時候在使用者後跟:with grant option;--可以進行許可權傳遞

物件許可權:誰建立,誰授予;

系統許可權:sys>>a,a>>b,if(sys<>b; b>>c ;if(a<

許可權對比:

create table ;create any table;

alter table(注意:oracle沒有這種許可權); alter any table;

drop table(注意:oracle沒有這種許可權); drop any table;

密碼的三種驗證機制

作業系統驗證

密碼檔案驗證

資料庫驗證

sys密碼丟失解決:

刪掉oracle密碼檔案,用orapwd file=密碼檔案路徑(檔名要pwdorcl.ora格式) password=sys密碼 entries=特權使用者的數量限制 force=是否強制覆蓋

linux下oracle的啟動過程:

lsnrctl start 啟動監聽

sqlplus / as sysdba進行密碼檔案和作業系統驗證

(在oracle9i一下版本登入):

startup 啟動例項

select * from v$pwfile_users;//查詢有多少特權使用者

--select * from dba_users; 查詢資料庫中的所有使用者

--alter user test_select account lock; 鎖住使用者

--alter user test_select account unlock; 給使用者解鎖

--create user xujin identified by xujin; 建立使用者

--grant create tablespace to xujin; 授權

--grant select on tabel1 to xujin; 授權查詢

--grant update on table1 to xujin;

--grant execute on procedure1 to xujin 授權儲存過程

--grant update on table1 to xujin with grant option; 授權更新許可權轉移給xujin使用者,許進使用者可以繼續授權;

--收回許可權

--revoke select on table1 from xujin1; 收回查詢select表的許可權;

--revoke all on table1 from xujin;

/*grant connect to xujin;

revoke connect from xujin

grant select on xezf.cfg_alarm to xujin;

revoke select on xezf.cfg_alarm from xujin;*/

--select table_name,privilege from dba_tab_privs where grantee='xujin' 查詢乙個使用者擁有的物件許可權

--select * from dba_sys_privs where grantee='xujin' 查詢乙個使用者擁有的系統許可權

--select * from session_privs --當錢會話有效的系統許可權

--角色

--create role xujin1;--建立xujin1角色

--grant insert on xezf.cfg_alarm to xujin1; 將插入表的資訊

--revoke insert on xezf.cfg_alarm from xujin1; 收回xujin1角色的許可權

--grant xujin1 to xujin ; 將角色的許可權授權給xujin;

-- create role xujin2;

--grant xujin1 to xujin2; 將角色xujin1授權給xujin2;

--alter user xujin default xujin1,xujin2; 修改使用者預設角色

-- drop role xujin1;刪除角色1;

--select * from role_sys_privs where role=xujin1;

--檢視許進1角色下有什麼系統許可權;

--select granted_role,admin_option from role_role_privs where role='xujin2';

--檢視xujin1角色下面有什麼角色許可權

--select * from role_sys_privs where role='xujin2';

--select table_name,privilege from role_tab_privs where role='xujin1';

--select * from dba_role_privs where grantee='xujin' --檢視使用者下面有多少個角色;

安全密碼機制(salt機制)

近日,csdn密碼被洩漏事件,確實不該,大網際網路企業,做法欠妥,也沒有給使用者乙個很好的交代。大家都在說為什麼沒有給密碼加點鹽,salt雜湊。我們知道,如果直接對密碼進行雜湊,那麼黑客 統稱那些有能力竊取使用者資料並企圖得到使用者密碼的人 可以對乙個已知密碼進行雜湊,然後通過對比雜湊值得到某使用者...

linux使用者密碼機制

linux下修改使用者密碼可以執行 passwd admin,該命令位與 usr bin下。中實現該過程,可以通過呼叫 echo newpassword passwd admin stdin 來實現,當然新密碼可以模擬個input confirm的過程讓使用者輸入。linux密碼加密演算法不可逆,相...

Oracle建立使用者以及備份還原資料庫操作

create the user create user xx identified by default tablespace users temporary tablespace temp profile default password expire grant revoke role priv...