PACKDISK IN TERADATA

Share via:
PACKDISK IN TERADATA

In this article, we will see the PACKDISK IN TERADATA

Purpose 

The PACKDISK command arranges (packs and unpacks) data on the storage associated with the tables in the current scope, leaving a specified percentage, the free space percent (FSP), of the storage empty. This allows for table growth within the currently allocated storage, and can free up cylinders for new storage allocations.

Syntax 

/Y:

to bypass user confirmation.

If you do not specify the /Y option, then Ferret requests for user confirmation before proceeding with PACKDISK.

FREESPACEPERCENT

Optionally specifies the percentage of storage space that PACKDISK should leave unoccupied on cylinders for tables in the current scope. This free space percent (FSP) allows tables to grow in place, deferring the need for allocation of new free storage cylinders.

Because read-only tables do not grow, they do not require free space.

The FSP for a table can also be specified when the table is created or modified using CREATE TABLE and ALTER TABLE statements. If defined for a table, this FSP value takes precedence over the PACKDISK FREESPACEPERCENT value, unless the FORCE option is used.

If FREESPACEPERCENT is not specified with PACKDISK, and no FSP was specified with CREATE TABLE or ALTER TABLE, PACKDISK uses the free space percent value defined by the FreeSpacePercent setting in DBS Control.

Number

Percentage of storage space to be left free in the cylinders of tables in the current scope.

Force

Forces PACKDISK to pack table data to the FREESPACEPERCENT value, regardless of current FSP values that might have been set using CREATE TABLE or ALTER TABLE statements.

Note: For tables that have an FSP set with CREATE TABLE or ALTER TABLE, results from using the FORCE option of PACKDISK are only temporary. When the periodic background AutoCylPack task runs, it returns table free space to the FSP value set using CREATE TABLE or ALTER TABLE statements.

IF FORCE is not used, PACKDISK honors the current FSP values that have been explicitly set using CREATE TABLE or ALTER TABLE. For tables with no explicit FSP, PACKDISK uses the system default defined in DBS Control.

The Ferret INQUIRE (or INQ) and ABORT commands can be used to check on the progress or halt this operation during command execution.

Usage Notes

PACKDISK packs cylinders for tables in the currently defined Ferret scope.

Packing applies to cylinders, not to the space in individual data blocks within those cylinders. Data block sizes remain the same after the PACKDISK operation.

Teradata Database can isolate some file system errors to a specific data or index subtable, or to a contiguous range of rows (“region”) in a data or index subtable. In these cases, Teradata Database marks only the affected subtable or region down. This improves system performance and availability by allowing transactions that do not require access to the down subtable or rows to proceed, without causing a database crash that would require a system restart.

If PACKDISK encounters down regions, it skips these regions, and displays the percentage of total space that was skipped.

Precedence of FSP Settings

FSP specifies the minimum amount free space that should be left on the cylinder during a data load operation. This reserves space for future table updates. Because read-only tables do not grow, they do not require free space.

Because FSP can be specified in a number of places, the amount of space that PACKDISK leaves free is determined in the following way:

1 If the PACKDISK FREESPACEPERCENT option is used with the FORCE option, PACKDISK packs to the specified FREESPACEPERCENT.

2 If the PACKDISK FORCE option is not used, the FSP specified when the table was created or modified using the CREATE TABLE or ALTER TABLE statement takes precedence.

3 If no FSP was specified when the table was created or modified, PACKDISK packs to the value specified by the PACKDISK FREESPACEPERCENT option.

4 If no FSP was specified when the table was created or modified, and the PACKDISK FREESPACEPERCENT option is not used, PACKDISK packs to the value of the FSP system default, specified by the FreeSpacePercent DBS Control setting.

Limiting Use of the FREESPACEPERCENT Option

The FREESPACEPERCENT option of PACKDISK is not intended for routine use. It is intended for exceptional situations, such as:

Preliminary tests scoped to a small prototype table to determine the optimal value for the FSP.

Later tests of various FSPs on live tables that might require adjustment to ensure more optimal cylinder packing in the future.

The AutoCylPack background task runs periodically to return cylinder FSPs to the levels specified when tables were created or modified, or, if no FSP was specified for the tables, AutoCylPack returns cylinders to the system default for FSP defined in DBS Control.

If the PACKDISK FREESPACEPERCENT option is used to explicitly specify a different FSP value for a PACKDISK run, the AutoCylPack background task will, at some point, return the FSP values to those defaults.

Example 

Thank you for giving your valuable time to read the above information.
Follow us on 
Website  www.ktexperts.com
Facebook Page KTExperts Facebook
Linkedin Page : KT EXPERTS Linkedin

 

Share via:
Note: Please test scripts in Non Prod before trying in Production.
1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Add Comment