Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Relocate extent in between datafile

2670775Aug 16 2016 — edited Aug 22 2016

I have the following query

set linesize 1000
select file_id,block_id ,bytes/1024/1024 SizeMB,  owner||'.'||segment_name "Name",block_id*8192/1024/1024 "Position MB" from sys.dba_extents where file_id=13
union
select file_id,block_id,bytes/1024/1024 SizeMB, 'Free' "Name",block_id*8192/1024/1024 "Position MB" from sys.dba_free_space  where file_id = 13;


select file_id,block_id ,bytes/1024/1024 SizeMB,  owner||'.'||segment_name "Name",block_id*8192/1024/1024 "Position MB" from sys.dba_extents where file_id=14
union
select file_id,block_id,bytes/1024/1024 SizeMB, 'Free' "Name",block_id*8192/1024/1024 "Position MB" from sys.dba_free_space  where file_id = 14;

and result
   FILE_ID   BLOCK_ID     SIZEMB Name                                                                                                             Position MB
---------- ---------- ---------- ---------------------------------------------------------------------------------------------------------------- -----------
        13        128      .0625 Free                                                                                                                       1
        13        136      .0625 Free                                                                                                                  1.0625
        13        144      .0625 Free                                                                                                                   1.125
        13        152      .0625 Free                                                                                                                  1.1875
        13        160      .0625 Free                                                                                                                    1.25
        13        168      .0625 Free                                                                                                                  1.3125
        13        176      .0625 Free                                                                                                                   1.375
        13        184      .0625 Free                                                                                                                  1.4375
        13        192      .0625 Free                                                                                                                     1.5
        13        200      .0625 Free                                                                                                                  1.5625
        13        208      .0625 Free                                                                                                                   1.625

   FILE_ID   BLOCK_ID     SIZEMB Name                                                                                                             Position MB
---------- ---------- ---------- ---------------------------------------------------------------------------------------------------------------- -----------
        13        216      .0625 Free                                                                                                                  1.6875
        13        224      .0625 Free                                                                                                                    1.75
        13        232      .0625 Free                                                                                                                  1.8125
        13        240      .0625 Free                                                                                                                   1.875
        13        248      .0625 Free                                                                                                                  1.9375
        13        256      .0625 Free                                                                                                                       2
        13        264      .0625 Free                                                                                                                  2.0625
        13        272      .0625 Free                                                                                                                   2.125
        13        280      .0625 Free                                                                                                                  2.1875
        13        288      .0625 Free                                                                                                                    2.25
        13        296      .0625 Free                                                                                                                  2.3125

   FILE_ID   BLOCK_ID     SIZEMB Name                                                                                                             Position MB
---------- ---------- ---------- ---------------------------------------------------------------------------------------------------------------- -----------
        13        304      .0625 Free                                                                                                                   2.375
        13        312      .0625 Free                                                                                                                  2.4375
        13        320      .0625 Free                                                                                                                     2.5
        13        328      .0625 Free                                                                                                                  2.5625
        13        336      .0625 Free                                                                                                                   2.625
        13        344      .0625 Free                                                                                                                  2.6875
        13        352      .0625 Free                                                                                                                    2.75
        13        360      .0625 Free                                                                                                                  2.8125
        13        368      .0625 Free                                                                                                                   2.875
        13        376      .0625 Free                                                                                                                  2.9375
        13        384          2 Free                                                                                                                       3

33 rows selected.

SQL> SQL> SQL>   2    3
   FILE_ID   BLOCK_ID     SIZEMB Name                                                                                                             Position MB
---------- ---------- ---------- ---------------------------------------------------------------------------------------------------------------- -----------
        14        128          1 Free                                                                                                                       1
        14        256        .25 Free                                                                                                                       2
        14        288      .0625 MYOWNER.TESTING03                                                                                                      2.25
        14        296      .0625 MYOWNER.SYS_LOB0000095715C00002$$                                                                                    2.3125
        14        304      .0625 MYOWNER.SYS_IL0000095715C00002$$                                                                                      2.375
        14        312     2.5625 Free                                                                                                                  2.4375

It's possible I can move the data to the starting block of the file id 14 ???

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2016
Added on Aug 16 2016
7 comments
788 views