Changing the table locking scheme

Locking schemes in Adaptive Server versions 12.0.x and later are:

The datapages and datarows schemes are collectively called data-only locking.

Changing between allpages and data-only locking

Conversions between allpages locking and either data-only locking scheme can be expensive in time, I/O, and space. These conversions are implemented by table copies and index re-creation. They require planning and preparation.

StepsChanging between allpages and either of the data-only locking schemes

  1. Perform a database dump.

  2. Update statistics on the table that you plan to alter. The conversion runs better with accurate statistics.

  3. Determine if there is enough space to perform the conversion.

  4. Select the table icon, then select File | Properties.

  5. Click the Locking Scheme tab.

  6. Set any space management properties that should be applied to the copy of the table or its rebuilt indexes.

  7. If the table is partitioned and requires a parallel sort, use sp_dboption to set select into/bulkcopy/pllsort to true, and then run checkpoint in the database. Also, make sure configuration parameters are set for optimum parallel sort performance as described in the Adaptive Server Enterprise Performance and Tuning Guide.

  8. Click the new locking scheme. The conversion from allpages to data-only locking or vice versa may take a long time and is I/O intensive.

  9. After conversion, check table and database consistency.

  10. Perform a database dump. After converting from allpages to data-only locking or vice versa, you must perform a full database dump before you can back up the transaction log with dump transaction.

Changing between datapages and datarows locking

Conversions between datapages and datarows locking is quick and inexpensive. These conversions are implemented by updates to system tables.

NoteChanging from datapages to datarows locking can increase the number of locks required, since a lock is needed for each row. Check the server-wide number of locks configuration parameter.

StepsChanging between datapages and datarows locking

  1. Open the table property sheet.

  2. Click the Locking Scheme tab.

  3. Click the desired locking scheme.