- Extend your PATH to have the the necessary tools available.
You need $pnfs/tools and $pnfs/dbfs. $pnfs is the pnfs variable
in /usr/etc/pnfsSetup.
- For the following procedure you need the
database name as well as the
database full path.
Use mdb show to find whatever you need.
- Shut down the database you want to modify.
mdb disable <databaseName>
mdb update
- Get the database id of the desired database.
md2tool <databaseFullPath> getdbid
- Create a new empty database which will be the destination of the
shrinked database.
md2tool none create <databaseFullPath>.small <databaseID>
Take the <databaseID> from the getdbid command.
- Copy the large database to the newly created one.
md3shrink <databaseFullPath> <databaseFullPath>.small
The copy process may take awhile because it goes throu
some unnecessary pnfs layers. For each internal record one line of
output is written to stdout specifying the pnfsID of the record.
So stdout should be written to /dev/null to speedup the copy process.
If errors are reported to stderr, the database is somehow corrupted
and it is not recommended to proceed further.
- Backup or remove the large database and rename the small one.
mv <databaseFullPath> <databaseFullPath>.backup
mv <databaseFullPath>.small <databaseFullPath>
- Enable the database again.
mdb enable <databaseName>
mdb update