Bo's Oracle Station

查看: 2016|回复: 0

(52-26)第46次:2016-01-13星期三

[复制链接]

75

主题

115

帖子

2714

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2714
发表于 2016-1-13 23:30:32 | 显示全部楼层 |阅读模式
  1. select  * from dba_audit_policies  ;

  2. create table tfga( a varchar2(1000)) ;

  3. create or replace   procedure procfga(p_1 varchar2,
  4.                                                            p_2 varchar2,
  5.                                                            p_3 varchar2)
  6. is
  7. begin
  8.    insert into tfga values ('The user  is '||sys_context('userenv','session_user')||'.'||
  9.                'The time is '||to_char(sysdate,'YYYY-MM-DD:HH24:MI:SS')||'.'||'The IP is '||
  10.                sys_context('userenv','ip_address')||p_1||' '||p_2||' '||p_3);
  11. end;                                                               

  12. select  * from user_errors;

  13. select  * from dba_objects o where o.owner='SYS'
  14.                                                         and   o.object_type='PROCEDURE'
  15.                                                           and o.object_name='PROCFGA';


  16. select  sys_context('userenv','session_user'), sys_context('userenv','ip_address')
  17.   from dual;
  18. DML
  19. TCL
  20. DDL execute immediate
  21. DCL execute immediate
  22. DQL(select)  select  into(1rows)


  23. begin
  24.    dbms_fga.add_policy(object_schema => 'HR',
  25.                                         object_name => 'EMPLOYEES',
  26.                                         policy_name => 'POLICY1',
  27.                                         audit_condition => 'department_id=20',
  28.                                         audit_column => 'SALARY,COMMISSION_PCT',
  29.                                         handler_schema => 'SYS',
  30.                                         handler_module => 'PROCFGA',
  31.                                         statement_types => 'UPDATE,SELECT',
  32.                                         audit_trail =>dbms_fga.XML+dbms_fga.EXTENDED,
  33.                                         audit_column_opts =>dbms_fga.ANY_COLUMNS);
  34.                                         end;
  35.                                        
  36.                  select  * from dba_fga_audit_trail   ;
  37.                  
  38.                  select  * from v$xml_audit_trail  where db_user='HR'  order by 6 desc ;  
  39.                  
  40.                  select  * from  dba_common_audit_trail  order by 6 desc ;     
  41.                  
  42.                  select  * from tfga;  
  43.                  
  44.                  ----
  45.    create tablespace tbs05217  datafile '/home/oracle/ tbs05217.dbf' size 5G;            
  46.                
  47.    
  48.    create table hr.tconvent   tablespace    tbs05217   as select  * from dba_source;   
  49.                               
  50.    select  s.segment_name,  bytes/1024/1024  from dba_segments s where s.segment_name in
  51.          ('TCONVENT','TDIRECT'
  52.          ) ;
  53.          
  54.    alter table hr.tconvent allocate extent ( size 2G ) ;      
  55.       
  56.    alter table hr.tdirect move  tablespace  tbs05217;
  57.                                     
  58.        alter table hr.tdirect allocate extent ( size 2G ) ;                                    
  59.      alter database datafile '/home/oracle/ tbs05217.dbf' resize 6G;
复制代码
(52-26)上完1Z0-052第11章

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-20 08:24 , Processed in 0.104055 second(s), 24 queries .

快速回复 返回顶部 返回列表