国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > Oracle > 正文

oracle DBA about logs

2024-08-29 13:43:52
字體:
來源:轉載
供稿:網友
1. 修改用戶 sys/system/scott/sys_man(oem使用)的密碼;    2. 進入dba studio看看系統有多少個用戶,有沒有可疑用戶     3. 不用隨便給普通用戶賦予DBA角色,普通用戶賦予CONNECT或
       RESOURCE角色或者根據需要賦予相關的權限。    4. 8i以上使用LogMiner工具,關于此工具的使用查閱精華區或faqs    5. 經常查看Alert<SID>.log文件,該文件路徑: $Oracle_HOME/admin/sid/bdump.
用LogMiner包看一下,可以看到他是用的那個用戶修改的那些表修改了什么。
Example of Using LogMiner
Assume that the data dictionary extract was taken to a flat file named
'/usr/oracle/dbs/dict.txt'
The DBA first specifies five redo logs to be analyzed
execute dbms_logmnr.add_logfile (filename => '/usr/oracle/dbs/arch123.dbf',
options => dbms_logmnr.NEW);
-- identifying this file starts a new list of files to analyze
execute dbms_logmnr.add_logfile (filename => '/usr/oracle/dbs/arch124.dbf',
options => dbms_logmnr.ADDFILE);
execute dbms_logmnr.add_logfile (filename => '/usr/oracle/dbs/arch125.dbf',
options => dbms_logmnr.ADDFILE);
execute dbms_logmnr.add_logfile (filename => '/usr/oracle/dbs/arch126.dbf',
options => dbms_logmnr.ADDFILE);
execute dbms_logmnr.add_logfile (filename => '/usr/oracle/dbs/arch127.dbf',
options => dbms_logmnr.ADDFILE);
The DBA then specifies the location of the dictionary with,
execute dbms_logmnr.start_logmnr( dictfilename => '/usr/oracle/dbs/dict.txt' );
The DBA is now ready to issue a select against the v$logmnr_contents view
select Operation, sql_redo, sql_undo
from v$logmnr_contents
where seg_owner = 'SCOTT' and seg_name = 'ORDERS' and
operation = 'DELETE' and username = 'RON';listner.log 里面會有你想要的證據查listener.log只能查到從哪里登錄,查不到輸入什么sql語句。
保密有一點很要害但又很輕易被忽略的,很多人都是直接輸入
sqlplus username/passWord@connstring   (一般服務器都安裝在unix系統)
登錄的,如此一來,別人只要用ps -efgrep sqlplus就可以看到你的用戶名和密碼了。
應該用
sqlplus  然后再輸入用戶名和密碼。
也可以先定義一個變量
$STRI=username/password;eXPort $STRI
sqlplus $STRI@connstring
這樣別人就看不到你的密碼了。
注重查看system的視圖v$sql,也許會有收獲。當然用審計功能 :
方法一:
用以下的方式可以監控登入登出的用戶:
創建如下的兩張表:
create table login_log   -- 登入登出信息表
(
    session_id int not null, -- sessionid
    login_on_time  date,  -- 登入時間 
    login_off_time  date,  -- 登出時間 
    user_in_db varchar2(30), -- 登入的db user
    machine    varchar2(20),    -- 機器名
    ip_address varchar2(20), -- ip地址
    run_PRogram varchar2(20)    -- 以何程序登入
);
create table allow_user   -- 網域用戶表
(
    ip_address varchar2(20),  -- ip地址
    login_user_name nvarchar2(20)   -- 操作者姓名
);創建如下的兩個觸發器:
create or replace trigger login_on_info  -- 紀錄登入信息的觸發器
after logon on database
Begin
    insert into login_log(session_id,login_on_time,login_off_time,user_in_db,machine,ip_address,run_program)
    select AUDSID,sysdate,null,sys.login_user,machine,SYS_CONTEXT('USERENV','IP_ADDRESS'),program
    from v$session where AUDSID = USERENV('SESSIONID');  --當前SESSION
END;create or replace trigger login_off_info -- 紀錄登出信息的觸發器
before logoff on database
Begin
 update login_log set  login_off_time = sysdate
 where session_id = USERENV('SESSIONID'); --當前SESSION 
exception
    when others then
     null;
END;方法二:
用如下的方式可以審計執行drop動作的事件:
/**
 * drop語句的審計日誌表
 */
create table drop_log
(
    session_id int not null,  -- sessionid
    drop_time  date,    -- drop的時間
    ip_address varchar2(20),  -- ip地址
    object_owner varchar2(30),  -- 對象的擁有者
    object_name varchar2(30),  -- 對象名稱
    object_type varchar2(20),  -- 對象類型
    drop_by_user varchar2(30) -- 執行drop語句的用戶
);create or replace trigger drop_info
after drop on mfg0513user.schema   -- 在mfg0513user用戶上創建審計drop的觸發器
begin
    insert into drop_log
       (session_id,
       drop_time,
       ip_address,
       object_owner,
       object_name,
       object_type,
       drop_by_user)
     values(USERENV('SESSIONID'),
       sysdate,
       SYS_CONTEXT('USERENV','IP_ADDRESS'),
       sys.dictionary_obj_owner,
       sys.dictionary_obj_name,
       sys.dictionary_obj_type,
       sys.login_user);   
end;
To collect auditing results, you must set the initialization parameter AUDIT_TRAIL to DB.
To choose auditing for statements issued by the users aaa that query or update a table or view, issue the following statement:
AUDIT SELECT TABLE, UPDATE TABLE
 
  BY aaa;
To oBTaining information:
   --DBA_AUDIT_TRAIL
   --DBA_AUDIT_EXISTS
   --DBA_AUDIT_OBJECT
   --DBA_AUDIT_SESSION
   --DBA_AUDIT_STATEMENT


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 门源| 谷城县| 新宁县| 邓州市| 大连市| 荣成市| 岳阳县| 巴马| 汉源县| 日照市| 察哈| 桓台县| 黄梅县| 曲沃县| 常州市| 眉山市| 墨竹工卡县| 五常市| 祁门县| 舞钢市| 杭锦后旗| 襄汾县| 西藏| 海晏县| 饶平县| 上饶县| 邹平县| 科尔| 福安市| 土默特右旗| 宝兴县| 琼中| 砀山县| 鄱阳县| 南阳市| 卫辉市| 山西省| 盘锦市| 忻州市| 台南市| 天等县|