Vous êtes sur la page 1sur 5

LIST OF COMMAND FOR DATABASE

Item Task Command Remarks


1 Enter the RealSecure Db osql -E -d RealSecureDB
console

2 Increase database size alter database RealSecureDB modify file Increase data file size
(name='SiteProtector site database primary data
file', maxsize= 2GB)

alter database RealSecureDB modify file Force increase database file


(name='SiteProtector site database primary data
file', size= 2GB)

Alter database RealSecureDB modify file Increase transaction logs size


(name='SiteProtector site database log file',
maxsize= 2GB)

alter database RealSecureDB modify file Force increase log file size
(name='SiteProtector site database log file', size=
2GB)

3 Purge database iss_PurgeObs Removes records from the Observances tables


(removed based on a
date) iss_PurgeSD Removes records from the Sensor Data tables

exec iss_PurgeSD @BeginDate='March 26, 2006', This will purge all type of data before 3/26/2006.
@ObsType='0,1,2,3,4,5,6,7,8,9,10'

exec iss_PurgeSD @BeginDate='DATE', This will purge all type of data before 3/26/2006.
@ObsType='0,1,2,3,4,5,6,7,8,9', @PurgeFlag=1 (SP6.1 & above)
exec iss_PurgeObs @BeginDate='March 26, 2006', This will only purge the data that has been
@ObsType='0,1,2,3,4,5,6,7,8,9,10', cleared in the SiteProtector Console’s Analysis
@PurgeFlag=1, @clearedonly=1 View

exec iss_GetPurgeStatus Check status of the purge

ObsType Description
-------------- ------------------------------
0 Incomplete data
1 Intrusion Detection
2 Vulnerability
3 Informational Only
4 AntiVirus
5 Firewall
6 WebFilter
7 AntiSpam
8 Application Compliance
9 Network Anomaly Detection
10 File Integrity

4 Truncate database exec iss_TruncateTables This will truncate the event data
(simply deletes all of the
event data – faster than backup log realsecuredb with truncate_only This will truncate the transaction logs
purge)

5 Shrink database dbcc shrinkdatabase ('RealSecureDB') This will shrink both the data and log files.
(allow for more disk
space) dbcc shrinkfile (name= 'siteprotector site database This will shrink the data file to the initial size if
primary data file') possible.

dbcc shrinkfile (name= 'siteprotector site database This will shrink the log file to the initial size if
log file') possible.
6 Backup exec iss_AddBackupDevice This will backup the database to the location
selected in the SiteProtector automatic
exec iss_BackupDatabase 'RealSecureDB' maintenance

NOTE: also can be done under SQL Server


Management Studio Express

7 Attach sp_detach_db 'RealSecureDB'

8 Detach sp_attach_db 'RealSecureDB',


'C:\Datai\RealSecureDB.mdf','C:\Datai\RealSecure
DBLog.mdf'

If your database is 100% full, the size of the database may have to be increased before you can purge or clear your database. Keep in mind, you
can not increase your database larger than the size of the hard drive the database is on, or past 2GB if you are using MSDE. If you have your
database set to grow, and you still have plenty of space on your hard drive, but your database keeps getting filled at 100%, you may also want to
increase the growth rate of your database.

 Every command must be followed by ‘go’

Purges should be scheduled using the automated database maintenance tool that is accessible from the RealSecure SiteProtector Console.
However, if you need to initiate a purge manually, the procedures utilized by the maintenance tool may be invoked manually to perform the
purge.

 iss_PurgeAnalysisLog - Removes records from the AnalysisLog table. This table logs the queries performed during data analysis.
 iss_PurgeExceptions - Removes records from the Observances and SensorData tables. These records correspond to events that have
been included in an exception.
 iss_PurgeHosts - Removes records from the Hosts table. These records correspond to the host objects that may be grouped and
managed with the console.
 iss_PurgeIncidents - Removes records from the Observances and SensorData tables. These records correspond to events that have been
included in an incident.
 iss_PurgeJobs - Removes records from the ActionJob, ActionDetails, and Schedule tables. These records correspond to the job entries
seen in the console for hosts, groups, and sensors.
 iss_PurgeMaintenanceLog - Removes records from the MaintenanceLog table. This table logs all of the messages produced by the
maintenance procedures.
 iss_PurgeMessageLog - Removes records from the MessageLog table. This table logs all of the errors and messages produced by the
error trapping of the database procedures.
 iss_PurgeMetrics - Removes records from the Metrics table. These records correspond to the trending data seen in the dashboard
console.
 iss_PurgeObs - Removes records from the Observances tables. These records correspond to the first level event information seen in the
console.
 iss_PurgeSD - Removes records from the SensorData tables. These records correspond to the detailed information seen when drilling
into events on the console. These procedures take one parameter. This value is the date before which all data will be deleted. For example, if
you enter 20030201, all data prior to 2003-02-01 (YYYY-MM-DD) will be deleted by the procedure.

1. Disable the automated maintenance process for the database. The automated maintenance process should not be used when manual purges
are being performed.

2. Start the Microsoft SQL Server Query Analyzer tool.

3. Connect to the database server where the RealSecureDB is located.

4. Select the RealSecureDB database from the dropdown menu on the toolbar at the top of the Query Analyzer window.

5. In the query window enter the command for the type of data you wish to purge. For example, enter the following to purge SensorData: exec
iss_PurgeSD '20030201'

6. Press the F5 key and wait for the purge to complete. This could take a long time depending on how much data will be purged.

In the above examples, replace the date with the date before which you would like all data to be purged. It is strongly recommended that you
only invoke the purge procedures manually only when directed to perform this action by ISS Technical Support.

In general, the most space will be made available by using the iss_PurgeSD procedure. Following that, the most space is likely to be made
available by purging with the iss_PurgeObs and iss_PurgeHosts procedures.
Finally, if you would like to attempt to shrink the database files, you can use the iss_ShrinkDB procedure. This procedure accepts no parameters
and will attempt to release all of the free space at the end of the data file back to the operating system.

This may not result in much, if any, reduction in the data file size.

1. Verify that the automated maintenance process for the database is disabled.

2. Start the Microsoft SQL Server Query Analyzer tool.

3. Connect to the database server where the RealSecureDB is located.

4. Select the RealSecureDB database from the dropdown menu on the toolbar at the top of the Query Analyzer window.

5. In the query window enter the following to shrink the database files: exec iss_ShrinkDB

6. Press the F5 key and wait for the shrink to complete. In the above examples, replace the date with the date before which you would like all
data to be purged. It is strongly recommended that you only invoke the purge procedures manually only when directed to perform this action by
ISS Customer Support.

Vous aimerez peut-être aussi