# 22. Virtuoso Functions Guide - DB.DBA.VACUUM

Chapter Contents | Prev | Next
Keyword Search:
www.openlinksw.com
docs.openlinksw.com
Book Home
Contents
Preface
Virtuoso Functions Guide
Administration
db.dba.vacuum
user_change_password
user_create
user_drop
user_get_option
user_grant_role
user_revoke_role
user_role_create
user_role_drop
user_set_option
user_set_qualifier
cfg_item_count
cfg_item_name
cfg_item_value
cfg_section_count
cfg_section_name
cfg_write
checkpoint_interval
disconnect_user
fk_check_input_value...
log_enable
log_text
prof_enable
prof_sample
status
sys_lockdown
sys_stat
system
trace_status
user_set_password
virtuoso_ini_path
Aggregate Functions
Array Manipulation
BPEL APIs
Backup
Compression
Cursor
Date & Time Manipulation
Debug
Dictionary Manipulation
Encoding & Decoding
File Manipulation
Free Text
Hashing / Cryptographic
LDAP
Locale
Mail
Miscellaneous
Number
Remote SQL Data Source
Replication
SOAP
SQL
String
Transaction
Type Mapping
UDDI
User Defined Types & The CLR
Virtuoso Java PL API
Virtuoso Server Extension Interface (VSEI)
Web Server & Internet
XML
XPATH & XQUERY
Functions Index

## DB.DBA.VACUUM

Compact the database
DB.DBA.VACUUM (in table_name varchar (default %), in index_name varchar (default %));
Description

This function reads through the specified tables and indices and finds groups of adjacent pages holding data that will fit on fewer pages than it currently occupies. If such a compression can be made, the pages are thus compacted.

The pages become part of the committed state and will be written to the checkpoint space on the next checkpoint.

The vacuum operation is non-locking and can be run on a busy database. It will simply skip pages with ongoing activity such as pending cursors or locks. The vacuum procedure returns only after it has read through the indices it affects but it will not prevent other activity on the indices. The vacuum operation may run out of disk space even if it makes net gains because the modified pages will not be final until the next checkpoint and the ooriginals will not be free unntil this same checkpoint. Thus manually running a checkpoint after vacuum runs out of space will free the space and vacuum may be rerun.

Parameters
table_name – This is a LIKE pattern for tables to vacuum.The default is all tables. The name is case sensitive and must have all the three parts given, e.g. APP.USER.DATA
index_name – This allows specifying an individual index to compress. The specified table(s) must have this index. The index name is a LIKE pattern and if given should match the case and spelling of index names as returned by the ODBC call SQLStatistics or equivalent, which is also the KEY_NAME column of SYS_KEYS.
Return Types

Errors

Examples
Simple example

Compact the entire database:

            SQL> DB.DBA.vacuum ();