分类: Oracle
2005-05-21 15:46:15
select col_1, col_2, rowid from some_table
on size 1000000 format wrapped rowid_test ( id number, dummy1 varchar2(4000), dummy2 varchar2(4000), dummy3 varchar2(4000), dummy4 varchar2(4000) ); begin for i in 1 .. 400 loop insert into rowid_test values(i, lpad('1', i, '1'), lpad('2', i, '2'), lpad('3', i, '3'), lpad('4', i, '4')); end loop; -- delete but every 20th record delete from rowid_test where mod(id,20) <> 0; end; / declare r rowid; i number := 1; v_filename .file_name%type; begin for p in ( select rowid from rowid_test ) loop select file_name into v_filename from where file_id = (p.rowid); .put_line('row no : ' || i ); .put_line(' file : ' || v_filename); .put_line(' block no: ' || ); .put_line(' slot no : ' || ); .put_line(''); i := i+1; end loop; end; / drop table rowid_test;
row no : 1 file : D:ORACLEDATABASESORA10DATA.DBF block no: 3890 slot no : 19 row no : 2 file : D:ORACLEDATABASESORA10DATA.DBF block no: 3890 slot no : 39 [....]
select .rowid_block_number(rowid) from t where ....