Compaq SC RMS Server User Manual


 
Day-to-Day Operation
The data can be archived as a sequence of SQL statements using rmstbladm. The
following example archives data from the node statistics (node_stats) table (see
Section 10.2.15):
$ rmstbladm -d -t node_stats > nodestats.sql
Alternatively, you can execute a SQL query to extract the data, as follows:
$ rmsquery -v -u "select * from node_stats"
name ctime usercpu syscpu freemem ubc wired freeswap pages interrupts ...
--------------------------------------------------------------------------
atlas0 973162911 0 1 295 483 162 5103 4 1 ...
atlas3 973162917 0 0 117 35 61 5103 4 1 ...
atlas2 973162922 0 0 124 29 62 5108 5 0 ...
atlasms 973162907 22 54 61 301 90 137 10 531 ...
atlasms 973163027 23 59 62 301 89 138 4 566 ...
Use the ctime field to select old data. For example, select data that was collected 2 days
ago or more as follows:
now=‘rmsgettime‘
old=‘expr $now - 172800‘
rmsquery -v "select * from node_stats where ctime <= $old \
order by ctime" > node_stats.sql
The following queries return data from the jobs, resources and accounting statistics
tables. Accounting statistics can also be managed using the script described in
Section 9.4.3.
rmsquery -v "select * from jobs where endTime <> 0 and \
endTime < $old order by startTime" > jobs.dat
rmsquery -v "select * from resources where endTime <> 0 and \
endTime < $old order by startTime" > resources.dat
rmsquery -v "select * from acctstats where running = 0 and \
started < $old order by started" > acctstats.dat
After executing these queries, run rmstbladm to clean up the database as described in
Section 9.4.5.
9.4.5 Database Maintenance
Certain tables in the RMS database grow over time or as jobs are submitted, in
particular, the node statistics (node_stats) table, the resources table, the events
table and the jobs table. These tables can be kept to a reasonable size by periodically
Setting up RMS 9-7