Which activity is performed when the preceding command is executed?

Examine the following command:

SQL> ALTER TABLE booking SHRINK SPACE COMPACT;

Which activity is performed when the preceding command is executed?

Examine the following command:

SQL> ALTER TABLE booking SHRINK SPACE COMPACT;

Which activity is performed when the preceding command is executed?

A.
The shrink operation touches every block in the BOOKING table

B.
The high-water mark (HWM) for the BOOKING table is shifted from its original position

C.
The progress of the shrink operation is saved in the bitmap blocks of the BOOKING table

D.
The data manipulation language (DML) triggers on the BOOKING table are executed because the shrink operation is internally handled by the INSERT/DELETE operation

Explanation:
http://www.oracle-base.com/articles/10g/SpaceObjectTransactionManagement10g.php

Based on the recommendations from the segment advisor you can recover space from specific objects using one of the variations of the ALTER TABLE … SHRINK SPACE commands.

The shrink is accomplished by moving rows between blocks, hence the requirement for row movement to be enabled for the shrink to take place. This can cause problem with ROWID based triggers. The shrinking process is only available for objects in tablespaces with automatic segment-space management enabled.

The COMPACT option allows the shrink operation to be broken into two stages. First the rows are moved using the COMPACT option but the HWM is not adjusted so no parsed SQL statements are invalidated. The HWM can be adjusted at a later date by reissuing the statement without the COMPACT option. At this point any depenedant SQL statements will need to be reparsed.

http://books.google.com/books?id=0iwrL9P25Z0C&pg=PA190&lpg=PA190&dq=shrink+operation+is+saved+in+the+bitmap+blocks&source=bl&ots=MGoTq9AT0m&sig=y0EgXfO2MZnWlOZTgKXo5CDbFJw&hl=en&ei=L0gATdqaNsG1nAfsrZjlDQ&sa=X&oi=book_result&ct=result&resnum=4&ved=0CCcQ6AEwAw#v=onepage&q=shrink%20operation%20is%20saved%20in%20the%20bitmap%20blocks&f=false

A shrink operation may cause ROWIDs to change in heap-organized segments. So row movement has to be enabled to circumvent this issue before a shrink operation. To enable row movement, use the {CREATE|ALTER} TABLE ENABLE ROW movement command.

A shrink operation consists of thw phases, compaction and adjusting the HWM to release the unused space. If the COMPACT option is used, only the first phase is executed. The shrink results are saved in bitmap blocks of the corresponding segment, Oracle 10g will remember what has been done. If CASCADE is specified, the shrinking cascades to all dependent segments that support a shrink operation.

During the COMPACT phase, individual rowlocks are held. Concurrent DML operations serialize on thes rowlocks and DML operations can block the compaction progress. When the HWM is adjusted in the second phase, the object is locked in exclusive mode for a short duration.



Leave a Reply 0

Your email address will not be published. Required fields are marked *