home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
moodle.waes.ac.uk
/
moodle.waes.ac.uk.zip
/
moodle.waes.ac.uk
/
TMG
/
SP1-TMG-KB981324-AMD64-ENU.msp
/
PCW_CAB_SHFx2
/
F2143_msfpcui.dll
/
BINARY
/
25016
< prev
next >
Wrap
Text File
|
2010-06-15
|
3KB
|
90 lines
CREATE PROCEDURE [dbo].[ISA_spExecuteOnLogDb]
@DatabaseName varchar(50),
@DatabaseType varchar(4)
AS
BEGIN
SET NOCOUNT ON;
DECLARE @DbTblName varchar(100)
IF @DatabaseType = 'FWS'
BEGIN
SET @DbTblName = '[' + @DatabaseName + '].[dbo].[FirewallLog]'
END
ELSE
BEGIN
SET @DbTblName = '[' + @DatabaseName + '].[dbo].[WebproxyLog]'
END
-- create the index
DECLARE @strCreateIndx varchar(3000)
IF @DatabaseType = 'FWS'
BEGIN
SET @strCreateIndx =
'CREATE NONCLUSTERED INDEX [IDX_REPORTING_SUMM] ON ' + @DbTblName + '
([InternalServiceInfo],[Action], [resultcode])
INCLUDE ([DestinationIP], [SourceIP],[OriginalClientIP],[bytessentDelta],
[bytesrecvdDelta], [ClientUserName], [ClientAgent], [ApplicationProtocol],
[protocol],[DestinationPort],[logTime],[connectiontimeDelta])
WHERE ([Action] != 6 and [Action] != 9)
AND ([InternalServiceInfo] != 1048575)'
END
ELSE
BEGIN
SET @strCreateIndx =
'CREATE NONCLUSTERED INDEX [IDX_REPORTING_SUMM] ON ' + @DbTblName + '
([InternalServiceInfo],[Action], [resultcode])
INCLUDE ([ClientIP],[ClientUserName],[ClientAgent],[bytesrecvd],
[bytessent],[objectsource],[ThreatName],[MalwareInspectionAction],
[protocol],[DestHostPort],[transport], [UrlCategory],
[logTime],[processingtime])
WHERE ([InternalServiceInfo] != 1048575)'
END
PRINT 'Executing: ' + @strCreateIndx
BEGIN TRY
EXECUTE(@strCreateIndx)
END TRY
BEGIN CATCH
PRINT ERROR_MESSAGE()
PRINT 'Unable to create Index, ignoring error. index might exist'
PRINT 'Index details: ' + @strCreateIndx
END CATCH
DECLARE @StirlingEnabled Int
SET @StirlingEnabled = (SELECT [StirlingEnabled] FROM [tblSummaryParams])
IF @StirlingEnabled = 0
BEGIN
PRINT 'StirlingEnabled is FALSE, exiting'
RETURN
END
-- create the sas index
IF @DatabaseType = 'FWS'
BEGIN
SET @strCreateIndx =
'CREATE NONCLUSTERED INDEX [IDX_SAS_FWS] ON ' + @DbTblName +
'(
logTime,
SourceIP,
Action,
ipsScanResult,
DestinationIP,
DestinationPort
)'
END
ELSE
BEGIN
SET @strCreateIndx =
'CREATE NONCLUSTERED INDEX [IDX_SAS_WEB] ON ' + @DbTblName +
'(
logTime,
ClientIP,
ipsScanResult
)'
END
PRINT 'Executing: ' + @strCreateIndx
BEGIN TRY
EXECUTE(@strCreateIndx)
END TRY
BEGIN CATCH
PRINT ERROR_MESSAGE()
PRINT 'Unable to create Index, ignoring error. index might exist'
PRINT 'Index details: ' + @strCreateIndx
END CATCH
END