|
- select * from dba_audit_policies ;
- create table tfga( a varchar2(1000)) ;
- create or replace procedure procfga(p_1 varchar2,
- p_2 varchar2,
- p_3 varchar2)
- is
- begin
- insert into tfga values ('The user is '||sys_context('userenv','session_user')||'.'||
- 'The time is '||to_char(sysdate,'YYYY-MM-DD:HH24:MI:SS')||'.'||'The IP is '||
- sys_context('userenv','ip_address')||p_1||' '||p_2||' '||p_3);
- end;
- select * from user_errors;
- select * from dba_objects o where o.owner='SYS'
- and o.object_type='PROCEDURE'
- and o.object_name='PROCFGA';
- select sys_context('userenv','session_user'), sys_context('userenv','ip_address')
- from dual;
- DML
- TCL
- DDL execute immediate
- DCL execute immediate
- DQL(select) select into(1rows)
- begin
- dbms_fga.add_policy(object_schema => 'HR',
- object_name => 'EMPLOYEES',
- policy_name => 'POLICY1',
- audit_condition => 'department_id=20',
- audit_column => 'SALARY,COMMISSION_PCT',
- handler_schema => 'SYS',
- handler_module => 'PROCFGA',
- statement_types => 'UPDATE,SELECT',
- audit_trail =>dbms_fga.XML+dbms_fga.EXTENDED,
- audit_column_opts =>dbms_fga.ANY_COLUMNS);
- end;
-
- select * from dba_fga_audit_trail ;
-
- select * from v$xml_audit_trail where db_user='HR' order by 6 desc ;
-
- select * from dba_common_audit_trail order by 6 desc ;
-
- select * from tfga;
-
- ----
- create tablespace tbs05217 datafile '/home/oracle/ tbs05217.dbf' size 5G;
-
-
- create table hr.tconvent tablespace tbs05217 as select * from dba_source;
-
- select s.segment_name, bytes/1024/1024 from dba_segments s where s.segment_name in
- ('TCONVENT','TDIRECT'
- ) ;
-
- alter table hr.tconvent allocate extent ( size 2G ) ;
-
- alter table hr.tdirect move tablespace tbs05217;
-
- alter table hr.tdirect allocate extent ( size 2G ) ;
- alter database datafile '/home/oracle/ tbs05217.dbf' resize 6G;
复制代码 (52-26)上完1Z0-052第11章
|
|