Permission required: This command must be executed from the DBA account or an account that has DB_ADMIN privilege on the databases.
The arcclean command purges unneeded records from the Replicator shadow and archive tables. It then modifies those tables back to their current storage structures. Use this command to reclaim disk space and improve performance.
After the Replicator Server processes data in the local queues, the records remain in the shadow and archive tables. This data continues to grow until you use the arcclean command to purge unneeded records. After arrclean is run, access to the shadow and archive tables is greatly improved.
To detect and resolve collisions, Replicator needs records of the last transactions on each row. Therefore, after arcclean is run, there will still be at least one shadow record for each record in the base table that has been touched by a replicated transaction. However, if there are any records in the input or distribution queues, the associated transactions in the shadow and archive tables also remain. To ensure that records remaining in input and distribution queues are not removed, the arcclean command selects records eligible for deletion and places them in a temporary table. If arcclean aborts, this temporary table should be removed automatically. If it is not removed, you can safely drop the table manually and then rerun arcclean.
You should run the arcclean command at intervals using the job scheduling mechanism of the operating system (such as cron on UNIX, and a batch job on OpenVMS). In UNIX, you can place the arcclean command in a cron file if $II_SYSTEM/ingres/bin is in the path. In OpenVMS, you can run the arcclean command from a batch job if you have executed the ingdbadef.com command file that defines the arcclean symbol.
Caution! Do not use arcclean if you do not have checkpoints and journals or other types of recovery mechanisms. The data purged from the shadow and archive tables can be used to aid recovery in a disaster.
The arcclean command has the following format:
Windows, VMS:
arcclean [vnode::]dbname "before_time"[--udba_name] 
UNIX:
arcclean [vnode::]dbname 'before_time' [-udba_name] 
Specifies the name of the database to be cleaned.
Indicates that all records in the shadow and archive tables dated before the specified date and time are to be purged. Provide the date and time in standard Ingres date and time format. On UNIX, place single quotes around the date and time; on VMS and Windows, use double quotes.
Caution! The date you specify should be before the last successful checkpoint or backup.
Specifies the name of the database owner.
The following example purges from the database all records before a certain date.
Before issuing the arcclean command in this example, follow these steps to prepare the environment:
Removing records without a valid checkpoint could hinder recovery in the event of a system failure. For details, see the reconcil Command.
There should be no new transactions during the cleaning process. Also, the shadow and archive tables need exclusive locks to the base tables during the modification procedure.Make sure the input and distribution queues are empty. You can do this by allowing the servers to run until they complete processing of all pending transactions.
If records remain in the queues, the arcclean process will retain the relevant records in the shadow and archive tables on the local database. However, arcclean does not know which transactions are pending on other databases, and could therefore remove records on the local database that are required for an outstanding transaction on a target database. This situation may generate collisions when the outstanding transactions are distributed.
This command purges all records dated before 20-Feb-04 from the remote hq database:
Windows, VMS:
arcclean nyc::hq –unyc_dba "20-feb-04"
UNIX:
arcclean nyc::hq –unyc_dba '20-feb-04'