Installation guide

time in downloading and reinstalling but would require additional disk space and back up time.
Note
Regardless of the back-up method used, when you restore the Satellite from a back-up, you must
run the following command to schedule the recreation of s earch indexes the next time the rhn-
search service is started:
/etc/init.d/rhn-search cleanindex
8.4. Using RHN DB Control
RHN Satellite with Embedded Database requires a utility for managing that database. Red Hat provides
just such a tool: RHN DB Cont rol. This command line utility allows you to do everything from make,
verify, and restore backups to obtain database status and restart it when necessary. You must be the
oracle user to invoke RHN DB Cont rol. To begin, switch to the oracle user:
su - oracle
Next, issue the following command:
db-control option
8.4.1. DB Control Options
RHN DB Cont rol offers many command line options. T o use them, as oracle insert the option and the
appropriate value, if needed, after the db-control command.
Table 8.1. RHN DB Control Opt ions
Opt ion Description
help Lists these db-control options with additional details.
backup DIRNAME Backs up the database to the directory specified.
exam ine DIRNAME Examines the contents of a backup directory. Returns
the timestamp of backup creation and reports on its
contents.
extend Increase the RHN Oracle tablespace
gather-stats PCT Gather statistics on RHN Oracle database objects. PCT
is the percentage of rows to estimate (the default is
15%).
report Reports on current us age of database space.
report-stats Reports on segments with stale or empty statistics.
restore DIRNAME Restores the databas e from backup kept in DIRNAME.
Database must be stopped for this command to run
success fully.
start Starts the databas e instance. This can also be
accomplished by issuing the service oracle start
command as root.
shrink-segm ents Shrinks RHN Oracle database segments with signifcant
amounts of free space.
status Shows the current s tatus of the database, either
"running" or "offline".
stop Stops the database instance. This can also be
accomplished by issuing the service oracle stop
command as root.
tablesizes Show space report for each table
verify DIRNAME Verifies the contents of the backup kept in DIRNAME.
This command runs a checksum of each of the files
kept in the backup.
Note
Database statistics are collections of data that describe more details about the database and the
objects in the database. T hese statistics are used by the query optimizer to choose the best
execution plan for each SQL statement. Because the objects in a database can be constantly
changing, s tatistics must be regularly updated so that they accurately describe these database
objects. Statistics are maintained automatically by Oracle. However, if your database has
performance issues after a significant amount of data changes, consider performing manual
gathering of s tatistics.
Note
After deleting large amount of data, use the segm ent-shrink feature to reclaim fragmented free
space in an Oracle Database segment. The benefits of segm ent-shrink are compaction of
data that leads to better cache utilization and the compacted data requires fewer blocks to be
scanned in full table scans, which both lead to better performance.
The segment shrink feature works only on newly created Oracle Database 10 g Release 2 that
comes with RHN Satellite Server 5.2.0. Due to different default database settings in Oracle
Database 9i this feature does not work on databases that were upgraded from previous RHN
Satellite Server releases.
8.4.2. Backing up the Database
Red Hat recommends performing nightly backups of the Embedded Database and moving the res ulting
directory to another system via NFS, SCP, FT P, etc. Preferably, this backup s ystem resides off-site. T o
conduct a backup, shut down the database and related services first by issuing the following command
as root:
/usr/sbin/rhn-satellite stop
Then switch to the oracle user and issue this command to initiate the backup:
db-control backup DIRNAME
Red Hat Network Satellite 5.4 Installation Guide
36