|
本帖最后由 botang 于 2016-3-11 10:12 编辑
(52-38)上完1Z0-053第18章
2016-03-07.sql:
- select bytes/1024/1024 from dba_segments s
- where s.owner='HR' and s.segment_name='T04209_UNAME';
-
- select bytes/1024/1024 from dba_segments s
- where s.owner='HR' and s.segment_name='IOT1';
-
- select index_name, index_type from
- dba_indexes i where i.table_name='IOT1';
-
-
- grant resumable to hr ;
-
- create tablespace tbs05318_z datafile size 10M autoextend off;
-
- select bytes/1024/1024,
- file_name from dba_data_files d where d.tablespace_name='TBS05318_Z';
-
- ---
- CREATE OR REPLACE TRIGGER SYS.TRG_SUSPEND
- AFTER SUSPEND
- ON DATABASE
- declare
- v_size number;
- pragma AUTONOMOUS_TRANSACTION;
- begin
- select bytes into v_size from dba_data_files
- where file_name='+DATA/orcl/datafile/tbs05318_z.267.905890157';
- v_size := v_size + 5242880;
- execute immediate 'alter database datafile
- ''+DATA/orcl/datafile/tbs05318_z.267.905890157'' resize '||v_size;
- commit;
- end;
- select * from dba_triggers t where t.trigger_name='TRG_SUSPEND';
- ----
- select u.username, u.initial_rsrc_consumer_group
- from dba_users u where u.username='HR';
-
-
- --
-
- select s.RESOURCE_CONSUMER_GROUP
- from v_$session s where s.TERMINAL='pts/6';
-
- ---
-
- select * from dba_rsrc_plans p where p.plan like 'PLAN%' ;
-
- ---
-
-
- BEGIN
- dbms_resource_manager.clear_pending_area();
- dbms_resource_manager.create_pending_area();
- dbms_resource_manager.create_plan( plan => 'PLAN3',
- comment => 'PLAN3',cpu_mth => 'RATIO'
- );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN3',
- group_or_subplan => 'OTHER_GROUPS',
- comment => 'OTHER_GROUPS',
-
- mgmt_p1 => 5
- );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN3',
- group_or_subplan => 'GROUP1',
- comment => 'GROUP1',
-
- mgmt_p1 => 3
- );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN3',
- group_or_subplan => 'GROUP2',
- comment => 'GROUP2',
-
- mgmt_p1 => 1
- );
- dbms_resource_manager.submit_pending_area();
- end;
- alter tablespace temp add tempfile '/home/oracle/temp01.dbf' size 20G;
- alter tablespace users add datafile '/home/oracle/users01.dbf' size 5G ;
- select * from dba_rsrc_plan_directives where plan='PLAN1';
-
复制代码
|
|