Download Websense Enterprise Explorer Log Database Maintenance

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

IMDb wikipedia , lookup

Microsoft Access wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Oracle Database wikipedia , lookup

SQL wikipedia , lookup

Btrieve wikipedia , lookup

Open Database Connectivity wikipedia , lookup

PL/SQL wikipedia , lookup

Concurrency control wikipedia , lookup

Database wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Ingres (database) wikipedia , lookup

Relational model wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Database model wikipedia , lookup

ContactPoint wikipedia , lookup

Clusterpoint wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Transcript
v5.5
v6.1
Websense Enterprise Explorer
Log Database Maintenance Recommendations
© Websense, Inc. November 21, 2005
Websense Enterprise Reporting
©1996–2005, Websense, Inc.
All rights reserved.
10240 Sorrento Valley Rd., San Diego, CA 92121, USA
Published November 21, 2005
Printed in the United States of America
This document may not, in whole or in part, be copied, photocopied, reproduced, translated, or reduced to any electronic medium or machine-readable
form without prior consent in writing from Websense Inc.
Every effort has been made to ensure the accuracy of this manual. However, Websense Inc., makes no warranties with respect to this documentation
and disclaims any implied warranties of merchantability and fitness for a particular purpose. Websense Inc. shall not be liable for any error or for
incidental or consequential damages in connection with the furnishing, performance, or use of this manual or the examples herein. The information in
this documentation is subject to change without notice.
Trademarks
Websense and Websense Enterprise are registered trademarks of Websense, Inc. in the United States and certain international markets. Websense has
numerous other unregistered trademarks in the United States and internationally. All other trademarks are the property of their respective owners.
Microsoft, Windows NT, Windows 2000, Windows 2003, Windows XP, Internet Explorer, and Active Directory are trademarks or registered trademarks of Microsoft Corporation.
Solaris is a registered trademark of Sun Microsystems, Inc., in the United States and other countries. Sun, Sun ONE and all Sun ONE based trademarks
and logos are trademarks of Sun Microsystems, Inc.
Netscape is a registered trademark of Netscape Communications Corporation in the U.S. and other countries. Netscape Navigator and Netscape Communicator are also trademarks of Netscape Communications Corporation and may be registered outside the U.S.
The following is a registered trademark of Novell, Inc., in the United States and other countries: Novell Directory Services.
Adobe, Acrobat, and Acrobat Reader are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States and/or other
countries.
Pentium is a registered trademark of Intel Corporation.
Red Hat is a registered trademark of Red Hat, Inc., in the United States and other countries.
Linux is a trademark of Linus Torvalds, in the United States and other countries.
This product includes software distributed by the Apache Software Foundation (http://www.apache.org).
Copyright (c) 2000. The Apache Software Foundation. All rights reserved.
Other product names mentioned in this manual may be trademarks or registered trademarks of their respective companies and are the sole property of
their respective manufacturers.
Log Database Maintenance Plan
Introduction
An effective Log Database maintenance plan is crucial for preserving the performance of any large
and/or busy Log Database. The design, implementation, and monitoring of a maintenance plan are a
few of the vital tasks of the database administrator (DBA) responsible for your Websense Enterprise
Reporting v5.5 or v6.1 Log Database. This document presents a set of recommendations for your
DBA that will help maintain the performance of Websense Explorer in Websense Enterprise
Reporting v5.5 or v6.1.
Tests and Tasks
There are four primary maintenance elements to consider for preserving the performance of Explorer:
1. Index Fragmentation
2. Statistics
3. Physical Disk Fragmentation
4. Table Size
i
IMPORTANT
Be sure to back up your Log Database before running any of the procedures
described in this document.
Index Fragmentation
Queries that selectively extract information from a database table are most affected by index
fragmentation. Indexes are used by the database server to return the results of queries more
efficiently. Each element in the index contains a pointer to the location in the data file where the
associated record is stored. When properly designed and maintained, the database server can use the
index to quickly search for the desired record(s) without the need of an exhaustive scan of the entire
data table.
However, indexes are much less effective when they become fragmented. Index fragmentation exists
when the logical ordering of the index elements are different from the physical ordering of the
records in the data file. The database server is then required to examine many more possibilities to
find the desired record(s) and do much more internal work in retrieving the data.
Fragmented indexes are a natural development in tables where new records are inserted and/or data
values are frequently changed in indexed columns. Therefore, a Log Database maintenance plan that
routinely examines the level of index fragmentation and takes the appropriate steps to reduce
significant fragmentation is particularly important for these tables.
At the Websense Enterprise Reporting v5.5 and v6.1 Log Database levels, there are tables that are
likely to suffer from significant index fragmentation over time. The tables listed below, along with
Websense, Inc.
3
Websense Enterprise Explorer
Log Database Maintenance Plan
their associated indexes, are most likely to benefit from maintenance: See the appropriate
descriptions for Websense Enterprise Explorer v5.5 and v6.1.
Tables and Indexes to Maintain in Websense Enterprise Explorer v5.5
Table Name
Index Name
SUMMARY_USER
UQ_SUMMARY_USER_1B0907CE (clustered)
USER_GROUPS
UserGroupsIndex
UserGroupsIndex1
INCOMING
PK_INCOMING (non-clustered primary key)
WS_INDEX_INCOMING_DATE_TIME (clustered)
WS_INDEX_INCOMING_USER_ID
WS_INDEX_INCOMING_CATEGORY
WS_INDEX_INCOMING_URL
Tables and Indexes to Maintain in Websense Explorer v6.1
Websense, Inc.
Table Name
Index Name
DELEGATED_ADMIN_MAPPING
idx_da_mapping_admin_id
idx_da_mapping_user_id
idx_da_mapping_startip
DIR_OBJECT_USER_MAPPING
ix_dir_object_user_mapping
DIRECTORY_OBJECT
pk_directory_object
directory_object_name_indx
SUMMARY
idx_summary_datetime
pk_summary
idx_summary
idx_summary_user_id
SUMMARY_URL
idx_summary_url_datetime
pk_summary_url
idx_summary_url_url
idx_summary_url_destination_ip_int
USER_NAMES
pk_user_names
UserLoginNameIndex
USER_MANAGERS
UQ__user_managers_29572725
USER_GROUPS
UserGroupsIndex
UserGroupsIndex1
GROUPS
pk_groups
GroupsIndex
GROUP_VIEWS
UQ__group_views__2B3F6F97
4
Websense Enterprise Explorer
Log Database Maintenance Plan
Tables and Indexes to Maintain in Websense Explorer v6.1
Table Name
Index Name
INCOMING
pk_incoming
ws_index_incoming_date_time
ws_index_incoming_combined1
ws_index_incoming_combined2
ws_index_incoming_combined3
ws_index_incoming_source_server
INCOMING_KEYWORD
ix_incoming_keyword
Diagnosing Index Fragmentation Issues
Your database server should provide a utility with which to examine the fragmentation level of the
indexes. For SQL Server 2000, this is the “DBCC SHOWCONTIG” command. For other database
platforms, please see your server documentation.
If your Websense Enterprise Reporting Services v6.1 Log Database is hosted on SQL Server 2000,
the DBA responsible could run the following command from Query Analyzer, replacing
“<tablename>” with the name of the table being examined:
DBCC SHOWCONTIG (<tablename>) WITH ALL_INDEXES, ALL_LEVELS
Metrics
A set of metrics is returned for each index on the specified table. The most important metrics returned
from SQL Server’s DBCC SHOWCONTIG, for purposes of diagnosing fragmentation that could
impact performance, are:
1. Logical Scan Fragmentation: The percentage of out of order pages when scanning an index
should ideally be at 0%.
2. Scan Density: The percentage of time that an index scan can read contiguously without a jump
should ideally be at 100%.
3. Average Page Density: Indicates how much jumping around is required to read ordered records,
which should ideally be at 100% or the FILLFACTOR specified when the index was created.
4. Extent Scan Fragmentation: Percentage of “out of order extents” (in SQL Server an extent is a
space allocation unit of 8 pages, each of 8K bytes), which should ideally be at 0%.
While the results must be considered in context of your particular needs and configuration, metric #1,
Logical Scan Fragmentation, makes a reasonably good litmus test for Explorer when determining
whether or not index fragmentation is having an impact on performance.
Fixing Index Fragmentation Issues
If Logical Scan Fragmentation is Between 20% and 40%
If logical scan fragmentation is below 20%, then its impact on performance is probably low.
However, if logical scan fragmentation is between 20% and 40%, a moderate amount of
fragmentation of the index exists and the DBA responsible should consider running the online
defragmentation procedure appropriate to your particular database platform.
Websense, Inc.
5
Websense Enterprise Explorer
Log Database Maintenance Plan
For SQL Server 2000, this is the “DBCC INDEXDEFRAG” command. Depending on the load on
the table during the process, this will provide a moderate level of reduction in leaf-level
fragmentation while not locking out other processes. However, this process does not address extent
fragmentation.
To do this on SQL Server 2000, run the following command from Query Analyzer:
DBCC INDEXDEFRAG (<databasename>, <tablename>, <indexname>)
Replacing the following to complete the command:
„
„
„
<databasename> with the name of the database
<tablename> with the name of the table
<indexname> with the name of the index
If Logical Scan Fragmentation is Greater than 40% and/or Extent Scan
Fragmentation is Over 40%
If logical scan fragmentation is greater than 40% and/or extent scan fragmentation is over 40%, then
severe index fragmentation exists and the impact to performance of Explorer is high. In these cases,
you may want to consider an offline process to rebuild the affected indexes.
In SQL Server 2000, one approach to this is to run the “DBCC DBREINDEX” command.This is an
offline process, which requires locking out any other processes from using the table while it is
running.
To rebuild all indexes on a table, run the following command, replacing “<tablename>” with the
name of the table:
DBCC DBREINDEX (<tablename>)
Statistics
The database server uses summary statistics about the content and distribution of values in the
indexes to help optimize queries. If these statistics are out-of-date and no longer accurately reflect
the current state of the associated index, then the performance of queries can suffer.
Diagnosing Statistics Issues
Most database server software feature some tool with which to get the current status of statistics. In
SQL Server 2000, this is the “DBCC SHOW_STATISTICS” command.
Run the following command:
DBCC SHOW_STATISTICS (<tablename>, <indexname>)
Replacing the following to complete the command:
„
„
<tablename> with the name of the table
<indexname> with the name of the index
The piece of information in the output of this command that is of primary interest to determine if
stale statistics are potentially impacting performance is the “Updated” column in the first block of
results. This is the date at which the statistics were last updated.
Websense, Inc.
6
Websense Enterprise Explorer
Log Database Maintenance Plan
Fixing Statistics Issues
Interpretation of this result depends heavily on your particular circumstances. In high volume
installations, statistics that are more than a few days old could be harmful to the database server’s
ability to pick an optimal execution plan.
It the statistics have not been updated recently, you should execute the particular database’s
functionality for updating/refreshing the statistics. In SQL Server 2000, this is the “UPDATE
STATISTICS” command.
Run the following command from Query Analyzer, replacing “<tablename>” with the name of the
table:
UPDATE STATISTICS <tablename>
Most database servers have a setting for whether or not the server should automatically update the
statistics for a given database. This ensures that the statistics are recalculated from time to time based
on a sampling of the current state of the data. However, many DBAs turn this setting off, because it
does cause a small, but definite, increase in overhead on the server. If stale statistics are a repeated
problem on your server, you may want to consider enabling this feature.
To determine if automatic update of statistics is turned on for a given database in SQL Server 2000,
run the following command, replacing “<databasename>” with the name of the database:
SELECT DATABASEPROPERTYEX(‘<databasename>’, ‘IsAutoUpdateStatistics’)
If the feature is turned on, a value of 1 is returned.
To turn on the automatic update of statistics for a database in SQL Server 2000, run the following the
command, replacing “<databasename>” with the name of the database:
ALTER DATABASE <databasename> SET AUTO_UPDATE_STATISTICS ON
Physical Disk Fragmentation
Fragmentation of the file system on which the database server stores the data or logs can, even in
striped RAID arrays, cause a decrease in performance for the database. This is due to the increased
amount of time spent in I/O.
For SQL Server 2000, you can use Performance Monitor’s Logical Disk Average Disk Queue Length
to determine if disk I/O is a bottleneck. A value of less than 2 per spindle is desirable.
If disk I/O looks like a problem, your system administrator can evaluate physical disk fragmentation
and correct it if necessary, using the appropriate software for your particular hardware configuration.
Table Size
A final option, if Explorer performance has degraded, is to eliminate data that is no longer useful
from the database table. Websense Enterprise Reporting v6.1 includes the DBManager utility to help
you manage the size of your Log Database.
For information on using this tool, consult your Websense Enterprise Reporting product
documentation.
Websense, Inc.
7
Websense Enterprise Explorer