|
本帖最后由 botang 于 2015-6-1 16:05 编辑
- select * from v$database_block_corruption;
- select * from v$backup_corruption;
- select * from v$copy_corruption;
- select * from dba_tablespaces;
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'REPAIR_TABLE',
- table_type => DBMS_REPAIR.REPAIR_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from REPAIR_TABLE;
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'ORPHAN_KEY_TABLE',
- table_type => DBMS_REPAIR.ORPHAN_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from ORPHAN_KEY_TABLE;
- DECLARE
- num_corrupt INT;
- BEGIN
- num_corrupt := 0;
- DBMS_REPAIR.CHECK_OBJECT (
- schema_name => 'HR',
- object_name => 'TLOGICAL',
- repair_table_name => 'REPAIR_TABLE',
- corrupt_count => num_corrupt);
- dbms_output.put_line( 'Find '|| num_corrupt||' Bolcks.' );
- END;
- DECLARE
- num_fix INT;
- BEGIN
- num_fix := 0;
- DBMS_REPAIR.FIX_CORRUPT_BLOCKS (
- schema_name => 'HR',
- object_name => 'TLOGICAL',
- object_type => DBMS_REPAIR.TABLE_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- fix_count => num_fix );
- dbms_output.put_line( 'Fixed '|| num_fix||' Bolcks.' );
- END;
- select * from dba_indexes i where table_name='TLOGICAL';
- select * from ORPHAN_KEY_TABLE;
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'ILOGICAL_B',
- object_type => DBMS_REPAIR.INDEX_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- orphan_table_name => 'ORPHAN_KEY_TABLE',
- key_count => num_orphans);
- DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
- END;
- select * from ORPHAN_KEY_TABLE where index_name='ILOGICAL_B' and keyrowid||' '='AAASOAAIgAAAAACAAA'||' ' ;
- select * from v$database_block_corruption;
- select * from v$backup_corruption;
- select * from v$copy_corruption;
- select * from dba_tablespaces;
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'REPAIR_TABLE',
- table_type => DBMS_REPAIR.REPAIR_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from REPAIR_TABLE;
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'ORPHAN_KEY_TABLE',
- table_type => DBMS_REPAIR.ORPHAN_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from ORPHAN_KEY_TABLE;
- DECLARE
- num_corrupt INT;
- BEGIN
- num_corrupt := 0;
- DBMS_REPAIR.CHECK_OBJECT (
- schema_name => 'HR',
- object_name => 'TLOGICAL',
- repair_table_name => 'REPAIR_TABLE',
- corrupt_count => num_corrupt);
- dbms_output.put_line( 'Find '|| num_corrupt||' Bolcks.' );
- END;
- DECLARE
- num_fix INT;
- BEGIN
- num_fix := 0;
- DBMS_REPAIR.FIX_CORRUPT_BLOCKS (
- schema_name => 'HR',
- object_name => 'TLOGICAL',
- object_type => DBMS_REPAIR.TABLE_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- fix_count => num_fix );
- dbms_output.put_line( 'Fixed '|| num_fix||' Bolcks.' );
- END;
- select * from dba_indexes i where table_name='TLOGICAL';
- select * from ORPHAN_KEY_TABLE;
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'ILOGICAL_B',
- object_type => DBMS_REPAIR.INDEX_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- orphan_table_name => 'ORPHAN_KEY_TABLE',
- key_count => num_orphans);
- DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
- END;
- select * from ORPHAN_KEY_TABLE where index_name='ILOGICAL_B' and keyrowid||' '='AAASOAAIgAAAAACAAA'||' ' ;
- alter tablespace tbsa offline immediate;
- begin
- dbms_repair.skip_corrupt_blocks('HR','TLOGICAL');
- end;
- select dump(key) from ORPHAN_KEY_TABLE where index_name='ILOGICAL_A' and keyrowid||' '='AAASOAAIgAAAAACAAA'||' ' ;
- 195,3,33,56
- select * from v$diag_info;
- select * from V$HM_CHECK where name like '%Matadata%';
- select * from V$HM_CHECK_PARAM where id=24 ;
- select * from v$hm_run;
- begin
- dbms_hm.run_check('Dictionary Integrity Check',
- 'mycheck',0,'TABLE_NAME=tab
- migrate_chain_rows.sql:
- [code]create table t05318_chain(a varchar2(2000), b varchar2(2000), c varchar2(2000), d varchar2(2000));
- insert into t05318_chain(a) values('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
- analyze table t05318_chain list chained rows;
- select * from CHAINED_ROWS;
- select * from dba_tablespaces;
- select * from dba_Tables t where t.owner='HR' and t.table_name='T05318_CHAIN';
- create tablespace tbs16k datafile size 5M blocksize 16384;
- alter system set db_16k_cache_size=1M;
- create tablespace tbs16k datafile size 5M blocksize 16384;
- alter table hr.T05318_CHAIN move tablespace tbs16k;
- select * from CHAINED_ROWS;
- analyze table t05318_chain list chained rows;
- select * from CHAINED_ROWS;
- -----
- create table t05318_migrate( a varchar2(2000)) pctfree 0;
- truncate table t05318_migrate;
- begin
- for i in 1..733
- loop
- insert into t05318_migrate values('A');
- end loop;
- commit;
- end;
- analyze table t05318_migrate list chained rows;
- select * from CHAINED_ROWS;
- select distinct dbms_rowid.rowid_block_number(rowid)
- from t05318_migrate;
- select dbms_rowid.rowid_block_number(rowid) myrow ,count( dbms_rowid.rowid_block_number(rowid) )
- from t05318_migrate group by dbms_rowid.rowid_block_number(rowid) ;
-
- insert into t05318_migrate values('A');
-
-
- update t05318_migrate set a='AAAAAA';
-
- analyze table t05318_migrate list chained rows;
- select * from CHAINED_ROWS;
- select distinct dbms_rowid.rowid_block_number(rowid)
- from t05318_migrate;
- select dbms_rowid.rowid_block_number(rowid) myrow ,count( dbms_rowid.rowid_block_number(rowid) )
- from t05318_migrate group by dbms_rowid.rowid_block_number(rowid) ;
-
- select * from user_Tables t where t.TABLE_NAME='T05318_MIGRATE';
-
-
- alter table T05318_MIGRATE move tablespace users;
-
- truncate table CHAINED_ROWS;
-
- analyze table t05318_migrate list chained rows;
- select * from CHAINED_ROWS;
- select distinct dbms_rowid.rowid_block_number(rowid)
- from t05318_migrate;
- select dbms_rowid.rowid_block_number(rowid) myrow ,count( dbms_rowid.rowid_block_number(rowid) )
- from t05318_migrate group by dbms_rowid.rowid_block_number(rowid) ;
-
-
复制代码
compress.sql:
- --sys--
- create tablespace tbs_nocompression datafile size 10M autoextend on;
- create tablespace tbs_basic datafile size 10M autoextend on default compress basic;
- create tablespace tbs_oltp datafile size 10M autoextend on default compress for oltp;
- create tablespace tbs_query datafile size 10M autoextend on default compress for query;
- create tablespace tbs_archive datafile size 10M autoextend on default compress for archive;
- select t.tablespace_name, t.def_tab_compression, t.compress_for from dba_tablespaces t
- where t.tablespace_name in ('TBS_NOCOMPRESSION',
- 'TBS_BASIC', 'TBS_OLTP',
- 'TBS_QUERY',
- 'TBS_ARCHIVE');
- --hr--
- create table t_nocompression (a varchar2(200)) tablespace tbs_nocompression;
- create table t_basic (a varchar2(200)) tablespace tbs_basic;
- create table t_oltp (a varchar2(200)) tablespace tbs_oltp;
- --hr-error--
- create table t_query (a varchar2(200)) tablespace tbs_query;
- create table t_archive (a varchar2(200)) tablespace tbs_archive;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_nocompression values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_basic values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_oltp values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- select t.TABLE_NAME, t.PCT_FREE , t.COMPRESSION , t.COMPRESS_FOR, t.TABLESPACE_NAME
- from user_tables t where t.TABLE_NAME in ('T_NOCOMPRESSION','T_BASIC','T_OLTP');
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_oltp group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid)
- from hr.T_BASIC group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid);
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP',row_id => rowid)
- from hr.T_OLTP group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP',row_id => rowid);
- --hr--
- create table t_basic2 (a varchar2(200)) tablespace tbs_nocompression compress;
- create table t_oltp2 (a varchar2(200)) tablespace tbs_nocompression compress for oltp;
- --hr-error--
- create table t_query2 (a varchar2(200)) tablespace tbs_nocompression compress for query;
- create table t_archive2 (a varchar2(200)) tablespace tbs_nocompression compress for archive;
- --hr--
- select t.TABLE_NAME, t.PCT_FREE , t.COMPRESSION , t.COMPRESS_FOR, t.TABLESPACE_NAME
- from user_tables t where t.TABLE_NAME in ('T_NOCOMPRESSION','T_BASIC','T_OLTP', 'T_BASIC2','T_OLTP2' );
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_basic2 values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_oltp2 values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic2 group by substr(rowid, 10, 6 );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_oltp2 group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC2',row_id => rowid)
- from hr.T_BASIC2 group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC2',row_id => rowid);
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP2',row_id => rowid)
- from hr.T_OLTP2 group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP2',row_id => rowid);
- --hr--
- alter table t_nocompression compress for oltp;
- select t.TABLE_NAME, t.PCT_FREE , t.COMPRESSION , t.COMPRESS_FOR, t.TABLESPACE_NAME
- from user_tables t where t.TABLE_NAME in ('T_NOCOMPRESSION','T_BASIC','T_OLTP', 'T_BASIC2','T_OLTP2' );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_nocompression values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --hr--
- alter table t_nocompression move tablespace tbs_nocompression;
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --hr--
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- insert /*+ append */ into t_basic select * from t_basic;
- commit;
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid)
- from hr.T_BASIC group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid);
- --hr--
- alter table t_basic move tablespace TBS_NOCOMPRESSION;
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid)
- from hr.T_BASIC group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid);
- --sys-evolution--
- drop table hr.t_basic_big;
- create table hr.t_basic_big compress as select * from dba_source;
- --sys-advisor--
- 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',
- tabname =>'T_BASIC_BIG',
- partname =>null,
- comptype => 2,
- 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;
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC_BIG',row_id => rowid)
- from hr.T_BASIC_BIG group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC_BIG',row_id => rowid);
- --hr--
- 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;
复制代码
);
end;
select dbms_hm.get_run_report('mycheck') from dual;
select * from dba_segments s where s.owner='HR' and s.segment_name='I05318_PART';
select * from dba_ind_partitions ip where ip.index_owner='HR' and ip.index_name='I05318_PART';
select s.segment_name ,s.bytes/1024/1024 from dba_segments s where s.owner='HR' and s.segment_name='I05318_A';
select i.index_name,i.compression
from dba_indexes i where i.owner='HR' and i.index_name='I05318_A' ;
[/code]
migrate_chain_rows.sql:
compress.sql:
- --sys--
- create tablespace tbs_nocompression datafile size 10M autoextend on;
- create tablespace tbs_basic datafile size 10M autoextend on default compress basic;
- create tablespace tbs_oltp datafile size 10M autoextend on default compress for oltp;
- create tablespace tbs_query datafile size 10M autoextend on default compress for query;
- create tablespace tbs_archive datafile size 10M autoextend on default compress for archive;
- select t.tablespace_name, t.def_tab_compression, t.compress_for from dba_tablespaces t
- where t.tablespace_name in ('TBS_NOCOMPRESSION',
- 'TBS_BASIC', 'TBS_OLTP',
- 'TBS_QUERY',
- 'TBS_ARCHIVE');
- --hr--
- create table t_nocompression (a varchar2(200)) tablespace tbs_nocompression;
- create table t_basic (a varchar2(200)) tablespace tbs_basic;
- create table t_oltp (a varchar2(200)) tablespace tbs_oltp;
- --hr-error--
- create table t_query (a varchar2(200)) tablespace tbs_query;
- create table t_archive (a varchar2(200)) tablespace tbs_archive;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_nocompression values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_basic values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_oltp values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- select t.TABLE_NAME, t.PCT_FREE , t.COMPRESSION , t.COMPRESS_FOR, t.TABLESPACE_NAME
- from user_tables t where t.TABLE_NAME in ('T_NOCOMPRESSION','T_BASIC','T_OLTP');
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_oltp group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid)
- from hr.T_BASIC group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid);
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP',row_id => rowid)
- from hr.T_OLTP group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP',row_id => rowid);
- --hr--
- create table t_basic2 (a varchar2(200)) tablespace tbs_nocompression compress;
- create table t_oltp2 (a varchar2(200)) tablespace tbs_nocompression compress for oltp;
- --hr-error--
- create table t_query2 (a varchar2(200)) tablespace tbs_nocompression compress for query;
- create table t_archive2 (a varchar2(200)) tablespace tbs_nocompression compress for archive;
- --hr--
- select t.TABLE_NAME, t.PCT_FREE , t.COMPRESSION , t.COMPRESS_FOR, t.TABLESPACE_NAME
- from user_tables t where t.TABLE_NAME in ('T_NOCOMPRESSION','T_BASIC','T_OLTP', 'T_BASIC2','T_OLTP2' );
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_basic2 values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_oltp2 values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic2 group by substr(rowid, 10, 6 );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_oltp2 group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC2',row_id => rowid)
- from hr.T_BASIC2 group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC2',row_id => rowid);
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP2',row_id => rowid)
- from hr.T_OLTP2 group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_OLTP2',row_id => rowid);
- --hr--
- alter table t_nocompression compress for oltp;
- select t.TABLE_NAME, t.PCT_FREE , t.COMPRESSION , t.COMPRESS_FOR, t.TABLESPACE_NAME
- from user_tables t where t.TABLE_NAME in ('T_NOCOMPRESSION','T_BASIC','T_OLTP', 'T_BASIC2','T_OLTP2' );
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --hr--
- begin
- for i in 1..400
- loop
- insert into t_nocompression values('AAAAAAAAAAAAAAAAAAAA');
- end loop;
- commit;
- end;
- --hr--
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --hr--
- alter table t_nocompression move tablespace tbs_nocompression;
- select count(*) , substr(rowid, 10, 6 ) from hr.t_nocompression group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid)
- from hr.T_NOCOMPRESSION group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_NOCOMPRESSION',row_id => rowid);
- --hr--
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- insert /*+ append */ into t_basic select * from t_basic;
- commit;
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid)
- from hr.T_BASIC group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid);
- --hr--
- alter table t_basic move tablespace TBS_NOCOMPRESSION;
- select count(*) , substr(rowid, 10, 6 ) from hr.t_basic group by substr(rowid, 10, 6 );
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid)
- from hr.T_BASIC group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC',row_id => rowid);
- --sys-evolution--
- drop table hr.t_basic_big;
- create table hr.t_basic_big compress as select * from dba_source;
- --sys-advisor--
- 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',
- tabname =>'T_BASIC_BIG',
- partname =>null,
- comptype => 2,
- 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;
- --sys--
- select count(*) , dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC_BIG',row_id => rowid)
- from hr.T_BASIC_BIG group by dbms_compression.get_compression_type(ownname => 'HR',tabname => 'T_BASIC_BIG',row_id => rowid);
- --hr--
- 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;
复制代码
- create table hr.tbig as select * from dba_source;
- select segment_name , bytes from dba_segments where segment_name='T_BASIC_BIG';
- grant resumable to hr;
- select file_name, bytes/1024/1024 from dba_data_files where tablespace_name='TBSSUS';
- select bytes/1024/1024 from dba_segments where segment_name='T05318_B';
- alter database datafile '+DATA/orcl/datafile/tbs05318_small.279.881085711' resize 70M;
- 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/tbssus.280.881086139';
- v_size := v_size +5242880 ;
- execute immediate 'alter database datafile ''+DATA/orcl/datafile/tbssus.280.881086139'' resize '||v_size;
- commit;
- end;
复制代码- SQL> create table t05318_part ( a number )
- 2 partition by range (a)
- 3 (partition p1 values less than (10),
- 4 partition p2 values less than (maxvalue)) ;
- Table created.
- SQL> insert into t05318_part values (9) ;
- 1 row created.
- SQL> insert into t05318_part values (10) ;
- 1 row created.
- SQL> commit;
- Commit complete.
- SQL> select * from t05318_part ;
- A
- ----------
- 9
- 10
- SQL> select * from t05318_part partition(p1) ;
- A
- ----------
- 9
- SQL> select * from t05318_part partition(p2) ;
- A
- ----------
- 10
- SQL> create index i05318_part on t05318_part(a) local ;
- Index created.
- SQL> alter table t05318_part move partition p1 tablespace example ;
- Table altered.
- SQL> alter index i05318_part partition p1 rebuild;
- alter index i05318_part partition p1 rebuild
- *
- ERROR at line 1:
- ORA-02243: invalid ALTER INDEX or ALTER MATERIALIZED VIEW option
- SQL> alter index i05318_part rebuild partition p1 ;
- Index altered.
- SQL>
复制代码
|
|