|
1. 补充Moving Data中遗漏的部分:
- impdp user1/oracle_4U parfile=par2.par
- parfile:
- directory=datadir1
- network_link=dblink1
- flashback_scn=9727454
- tables=hr.ta
- remap_schema=hr:user1
- public database link:
- create public database link ....
复制代码 2. 2017-03-02.sql:
- select u.USERNAME, u.INITIAL_RSRC_CONSUMER_GROUP
- from dba_users u
- where u.USERNAME='HR';
-
- DECLARE
- spfileValue VARCHAR2(1000);
- execText VARCHAR2(1000);
- scopeValue VARCHAR2(30) := 'MEMORY';
- planName VARCHAR2(100) :='PLAN1';
- BEGIN
- dbms_resource_manager.clear_pending_area();
- dbms_resource_manager.create_pending_area();
- dbms_resource_manager.create_plan( plan => 'PLAN1', comment => 'plan1',max_iops => NULL,max_mbps => NULL );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN1',
- group_or_subplan => 'GROUP1',
- comment => '',
- switch_elapsed_time => NULL,
- max_utilization_limit => null,
- mgmt_p1 => NULL, mgmt_p2 => 80, mgmt_p3 => NULL, mgmt_p4 => NULL,
- mgmt_p5 => NULL, mgmt_p6 => NULL, mgmt_p7 => NULL, mgmt_p8 => NULL ,
- parallel_degree_limit_p1 => NULL ,
- parallel_target_percentage => NULL ,
- parallel_queue_timeout => NULL ,
- parallel_stmt_critical => 'false' ,
- switch_io_logical => NULL ,
- switch_io_reqs => NULL ,
- switch_io_megabytes => NULL ,
- active_sess_pool_p1 => NULL,
- queueing_p1 => NULL,
- switch_group => '',
- switch_time => NULL,
- switch_estimate => case 'false' when 'false' then false when 'true' then true else false end,
- undo_pool => NULL ,
- max_idle_time => NULL,
- max_idle_blocker_time => NULL,
- switch_for_call => case 'true' when 'false' then false when 'true' then true else false end
- );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN1',
- group_or_subplan => 'GROUP2',
- comment => '',
- switch_elapsed_time => NULL,
- max_utilization_limit => null,
- mgmt_p1 => NULL, mgmt_p2 => 20, mgmt_p3 => NULL, mgmt_p4 => NULL,
- mgmt_p5 => NULL, mgmt_p6 => NULL, mgmt_p7 => NULL, mgmt_p8 => NULL ,
- parallel_degree_limit_p1 => NULL ,
- parallel_target_percentage => NULL ,
- parallel_queue_timeout => NULL ,
- parallel_stmt_critical => 'false' ,
- switch_io_logical => NULL ,
- switch_io_reqs => NULL ,
- switch_io_megabytes => NULL ,
- active_sess_pool_p1 => NULL,
- queueing_p1 => NULL,
- switch_group => '',
- switch_time => NULL,
- switch_estimate => case 'false' when 'false' then false when 'true' then true else false end,
- undo_pool => NULL ,
- max_idle_time => NULL,
- max_idle_blocker_time => NULL,
- switch_for_call => case 'true' when 'false' then false when 'true' then true else false end
- );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN1',
- group_or_subplan => 'LOW_GROUP',
- comment => '',
- switch_elapsed_time => NULL,
- max_utilization_limit => null,
- mgmt_p1 => NULL, mgmt_p2 => NULL, mgmt_p3 => 100, mgmt_p4 => NULL,
- mgmt_p5 => NULL, mgmt_p6 => NULL, mgmt_p7 => NULL, mgmt_p8 => NULL ,
- parallel_degree_limit_p1 => NULL ,
- parallel_target_percentage => NULL ,
- parallel_queue_timeout => NULL ,
- parallel_stmt_critical => 'false' ,
- switch_io_logical => NULL ,
- switch_io_reqs => NULL ,
- switch_io_megabytes => NULL ,
- active_sess_pool_p1 => NULL,
- queueing_p1 => NULL,
- switch_group => '',
- switch_time => NULL,
- switch_estimate => case 'false' when 'false' then false when 'true' then true else false end,
- undo_pool => NULL ,
- max_idle_time => NULL,
- max_idle_blocker_time => NULL,
- switch_for_call => case 'true' when 'false' then false when 'true' then true else false end
- );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN1',
- group_or_subplan => 'OTHER_GROUPS',
- comment => '',
- switch_elapsed_time => NULL,
- max_utilization_limit => null,
- mgmt_p1 => NULL, mgmt_p2 => NULL, mgmt_p3 => NULL, mgmt_p4 => 100,
- mgmt_p5 => NULL, mgmt_p6 => NULL, mgmt_p7 => NULL, mgmt_p8 => NULL ,
- parallel_degree_limit_p1 => NULL ,
- parallel_target_percentage => NULL ,
- parallel_queue_timeout => NULL ,
- parallel_stmt_critical => 'false' ,
- switch_io_logical => NULL ,
- switch_io_reqs => NULL ,
- switch_io_megabytes => NULL ,
- active_sess_pool_p1 => NULL,
- queueing_p1 => NULL,
- switch_group => '',
- switch_time => NULL,
- switch_estimate => case 'false' when 'false' then false when 'true' then true else false end,
- undo_pool => NULL ,
- max_idle_time => NULL,
- max_idle_blocker_time => NULL,
- switch_for_call => case 'true' when 'false' then false when 'true' then true else false end
- );
- dbms_resource_manager.create_plan_directive(
- plan => 'PLAN1',
- group_or_subplan => 'SYS_GROUP',
- comment => '',
- switch_elapsed_time => NULL,
- max_utilization_limit => null,
- mgmt_p1 => 100, mgmt_p2 => NULL, mgmt_p3 => NULL, mgmt_p4 => NULL,
- mgmt_p5 => NULL, mgmt_p6 => NULL, mgmt_p7 => NULL, mgmt_p8 => NULL ,
- parallel_degree_limit_p1 => NULL ,
- parallel_target_percentage => NULL ,
- parallel_queue_timeout => NULL ,
- parallel_stmt_critical => 'false' ,
- switch_io_logical => NULL ,
- switch_io_reqs => NULL ,
- switch_io_megabytes => NULL ,
- active_sess_pool_p1 => NULL,
- queueing_p1 => NULL,
- switch_group => '',
- switch_time => NULL,
- switch_estimate => case 'false' when 'false' then false when 'true' then true else false end,
- undo_pool => NULL ,
- max_idle_time => NULL,
- max_idle_blocker_time => NULL,
- switch_for_call => case 'true' when 'false' then false when 'true' then true else false end
- );
- dbms_resource_manager.submit_pending_area();
- END;
- select s.USERNAME, s.RESOURCE_CONSUMER_GROUP
- from v$session s
- where s.TERMINAL='pts/3';
- select s.USERNAME, s.RESOURCE_CONSUMER_GROUP
- from v$session s
- where s.TERMINAL='pts/3';
-
-
- select * from dict where table_name like 'DBA_SCHEDULER_%';
-
- grant execute on jobclass1 to hr;
-
- ---
- create table hr.t05317_lw( a date ) ;
- create or replace procedure hr.proc05317_lw
- is
- begin
- insert into hr.t05317_lw values(sysdate);
- commit;
- end;
- --em
- select * from hr.t05317_lw;
-
- begin
- dbms_scheduler.create_job(
- job_name => 'hr.job8',
- program_name=>'hr.program8',
- schedule_name=>'hr.schedule8',
- job_style=>'LIGHTWEIGHT',
- enabled=> true);
- end;
-
- DECLARE
- newjob sys.job;
- newjobarr sys.job_array;
- BEGIN
- -- Create an array of JOB object types
- newjobarr := sys.job_array();
- -- Allocate sufficient space in the array
- newjobarr.extend(100);
- -- Add definitions for jobs
- FOR i IN 1..100 LOOP
- -- Create a JOB object type
- newjob := sys.job(job_name => 'HR.JOB8_' || to_char(i),
- job_style => 'LIGHTWEIGHT',
- job_template => 'HR.PROGRAM8',
- enabled => TRUE );
- -- Add job to the array
- newjobarr(i) := newjob;
- END LOOP;
- -- Call CREATE_JOBS to create jobs in one transaction
- DBMS_SCHEDULER.CREATE_JOBS(newjobarr, 'TRANSACTIONAL');
- END;
复制代码
|
|