|
上完1Z0-053第18章
1Z0-052共19章(上完19章),1Z0-053共21章(上完21章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的40章
压缩建议者(唯一没有出现在Advisor Home的建议者),建议Exadata HCC 压缩率:
- declare
- v_blkcnt_cmp number;
- v_blkcnt_uncmp number;
- v_row_cmp number;
- v_row_uncmp number;
- v_cmp_ratio number;
- v_comptype_str varchar2(200);
- BEGIN
- DBMS_COMPRESSION.GET_COMPRESSION_RATIO(scratchtbsname => 'USERS',
- ownname =>'HR',
- OBJNAME =>'T_BASIC_BIG',
- SUBOBJNAME =>null,
- comptype => 16,
- blkcnt_cmp => v_blkcnt_cmp,
- blkcnt_uncmp => v_blkcnt_uncmp,
- row_cmp =>v_row_cmp,
- row_uncmp => v_row_uncmp,
- cmp_ratio => v_cmp_ratio,
- comptype_str =>v_comptype_str);
- DBMS_OUTPUT.PUT_LINE('Blk count compressed = ' || v_blkcnt_cmp);
- DBMS_OUTPUT.PUT_LINE('Blk count uncompressed = ' || v_blkcnt_uncmp);
- DBMS_OUTPUT.PUT_LINE('Row count per block compressed = ' || v_row_cmp);
- DBMS_OUTPUT.PUT_LINE('Row count per block uncompressed = ' || v_row_uncmp);
- DBMS_OUTPUT.PUT_LINE('ratio: '||v_cmp_ratio);
- DBMS_OUTPUT.PUT_LINE('Compression type = ' || v_comptype_str);
- end;
复制代码 BASIC压缩,不能删除列:
- create table t_basic_col( a number , b varchar2(20)) compress ;
- insert into t_basic_col values ( 1,'A') ;
- commit;
- create table t_oltp_col( a number , b varchar2(20)) compress for oltp;
- insert into t_oltp_col values ( 1,'A') ;
- commit;
- select * from t_basic_col;
- select * from t_oltp_col;
- alter table t_basic_col drop column b;
- alter table t_basic_col drop ( b);
- alter table t_oltp_col drop column b;
- select * from t_oltp_col;
复制代码 BASIC压缩,不能shrink space:
- SQL> select count(*) from t_big_basic;
- select count(*) from t_big_basic
- *
- ERROR at line 1:
- ORA-00942: table or view does not exist
- SQL> select count(*) from t_basic_big;
- COUNT(*)
- ----------
- 326450
- SQL> delete from t_basic_big;
- 326450 rows deleted.
- SQL> commit;
- Commit complete.
- SQL> alter table t_basic_big shrink space compact;
- alter table t_basic_big shrink space compact
- *
- ERROR at line 1:
- ORA-10635: Invalid segment or tablespace type
- SQL> delete from tbig;
- 326449 rows deleted.
- SQL> commit;
- Commit complete.
- SQL> alter table tbig shrink space compact;
- alter table tbig shrink space compact
- *
- ERROR at line 1:
- ORA-10636: ROW MOVEMENT is not enabled
- SQL> alter table tbig enable ROW MOVEMENT;
- Table altered.
- SQL> alter table tbig shrink space compact;
- Table altered.
- SQL> SQL>
- SQL> alter table tbig shrink space;
- Table altered.
- SQL> alter table tbig shrink space compact;
- Table altered.
- SQL> alter table t_basic_big shrink space compact;
- alter table t_basic_big shrink space compact
- *
- ERROR at line 1:
- ORA-10635: Invalid segment or tablespace type
- SQL>
- SQL> alter table t_basic_big shrink space;
- alter table t_basic_big shrink space
- *
- ERROR at line 1:
- ORA-10635: Invalid segment or tablespace type
- SQL> alter table t_basic_big move tablespace users;
- Table altered.
复制代码 关于IOT:
- select s.BYTES/1024/1024
- from dba_segments s
- where s.SEGMENT_NAME='T04209_UNAME';
-
- select *
- from dba_indexes i where i.TABLE_NAME='IOT1';
-
- select * from dba_objects o
- where o.OBJECT_NAME='IOT1';
-
- select * from dba_tables t
- where t.TABLE_NAME like '%97831%';
-
- select * from hr.SYS_IOT_OVER_97831;
-
- select * from hr.SYS_IOT_MAP_97831;
-
- grant resumable to hr;
-
- create tablespace tbs3 datafile size 5M autoextend off;
-
- select * from dba_resumable;
-
复制代码 关于SUSPEND:
- create table t3 ( a number ) tablespace tbs3 storage ( initial 6M ) ;
复制代码- 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='/u01/app/oracle/oradata/ORCL/datafile/o1_mf_tbssmall_7137jokm_.dbf';
- v_size := v_size + 524288;
- execute immediate 'alter database datafile ''/u01/app/oracle/oradata/ORCL/datafile/o1_mf_tbssmall_7137jokm_.dbf'' resize '||v_size;
- commit;
- end;
复制代码
|
|