|
上完1Z0-052第13章/1Z0-053第13和14章
1Z0-052共19章(上完19章),1Z0-053共21章(上完19章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的38章
监控模块:
- execute dbms_application_info.set_module('GL','1');
- select count(*) from t04209_uname a , t04209_uname b, t04209_uname c ;
复制代码 手工查看顶级SQL:
- select *
- from ( select s.SQL_TEXT , s.sql_id
- from v$sql s
- order by s.CPU_TIME desc)
- where rownum <=5;
-
- ---
- select sid, serial# from v$session
- where sql_id='6z1r90qj0y1za';
复制代码 老的ADVICE类视图:
- select * from v$memory_dynamic_components;
复制代码
- select o.OBJECT_NAME, o.STATUS
- from dba_objects o
- where o.OWNER='HR' and o.OBJECT_TYPE='PROCEDURE';
复制代码
- SQL> alter table t05213 add ( b varchar2(20)) ;
- Table altered.
- SQL> alter table t05213 drop (a) ;
- Table altered.
- SQL> create or replace procedure proc0513
- 2 is
- 3 v_1 number ;
- 4 begin
- 5 select count(b) into v_1 from t05213 ;
- 6 end;
- 7 /
- Procedure created.
- SQL> alter table t05213 add ( c varchar2(20)) ;
- Table altered.
- SQL> alter table t05213 drop (b) ;
- Table altered.
- SQL> alter table t05213 add ( b number ) ;
- Table altered.
- SQL> exec proc0513 ;
- PL/SQL procedure successfully completed.
- SQL> alter procedure proc0513 compile ;
- Procedure altered.
复制代码- SQL> alter table employees storage ( buffer_pool keep ) ;
- alter table employees storage ( buffer_pool keep )
- *
- ERROR at line 1:
- ORA-00942: table or view does not exist
- SQL> alter table hr.employees storage ( buffer_pool keep ) ;
- Table altered.
- SQL> alter index hr.emp_emp_ix storage ( buffer_pool keep ) ;
- alter index hr.emp_emp_ix storage ( buffer_pool keep )
- *
- ERROR at line 1:
- ORA-01418: specified index does not exist
- SQL> alter index hr.emp_emp_id_pk storage ( buffer_pool keep ) ;
- Index altered.
- SQL>
复制代码- select i.INDEX_NAME
- from dba_indexes i
- where i.TABLE_OWNER='HR' and i.TABLE_NAME='EMPLOYEES';
- ----
-
- select db.NAME, db.KEPT from v$db_object_cache db
- where db.NAME='PROC0513';
-
- begin
- dbms_shared_pool.keep('HR.PROC0513');
- end;
-
- begin
- dbms_shared_pool.unkeep('HR.PROC0513');
- end;
复制代码- SQL> show parameter workarea_size
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- workarea_size_policy string AUTO
- SQL> show parameter sort_area
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- sort_area_retained_size integer 0
- sort_area_size integer 65536
复制代码- select a.uname,a.uvalue, b.department_id ,b.department_name from t04209_uname a, departments b order by a.uname;
复制代码- SQL> show parameter sampl
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- optimizer_dynamic_sampling integer 2
复制代码- SELECT c.cust_city, t.calendar_quarter_desc, SUM(s.amount_sold) sales_amount
- FROM sh.sales s, sh.times t, sh.customers c, sh.channels ch
- WHERE s.time_id = t.time_id AND s.cust_id = c.cust_id AND s.channel_id = ch.channel_id
- AND c.cust_state_province = 'FL'
- AND ch.channel_desc = 'Direct Sales'
- AND t.calendar_quarter_desc IN ('2000-01', '2000-02','1999-12') GROUP BY c.cust_city,
- t.calendar_quarter_desc
复制代码
- select * from dba_Tab_col_statistics tcs
- where tcs.TABLE_NAME='T04209_UNAME';
-
- begin
- dbms_stats.gather_table_stats('HR','T04209_UNAME',
- method_opt=>'for all columns size 254');
- end;
-
- begin
- dbms_advisor.quick_tune (
- 'SQL Access Advisor',
- 'MYSAA5',
- 'select count(*) from hr.tbig group by text ',
- TEMPLATE=>'SQLACCESS_OLTP');
- end;
-
-
- select * from dba_tab_histograms th where
- th.TABLE_NAME='T04209_UNAME' ;
复制代码
|
|