Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

How to centralize your SQL Server Event Logs. Expand / Collapse
Author
Message
Posted Saturday, November 6, 2010 2:20 PM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, September 22, 2014 11:29 AM
Points: 514, Visits: 1,733
Comments posted to this topic are about the item How to centralize your SQL Server Event Logs.
Post #1016895
Posted Monday, November 8, 2010 1:15 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 1:41 AM
Points: 123, Visits: 515
the only thing that i whould change, is running the vbs from windows schedule task and not from the sql server, i think it's more correct way.
This will give you the ability prepare a vbs that you can put on all of you server's, rather only in the db server (although you can query the event viewer of a remote server, which is little more work).
Post #1017024
Posted Monday, November 8, 2010 3:55 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, September 22, 2014 5:00 AM
Points: 39, Visits: 285
Hello,

your Article is really great. I tried to Run the Script on our Server (Windows Server 2003 R2 SERVICE PACK 1) but I get an error (see attached file). Can anyone Help me?

Thanks a lot




  Post Attachments 
error.jpg (66 views, 16.22 KB)
Post #1017076
Posted Monday, November 8, 2010 5:11 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, September 22, 2014 11:29 AM
Points: 514, Visits: 1,733
renasoursou (11/8/2010)
Hello,

your Article is really great. I tried to Run the Script on our Server (Windows Server 2003 R2 SERVICE PACK 1) but I get an error (see attached file). Can anyone Help me?

Thanks a lot




Do you have SQL running with a database called DBA on your server?
does the database DBA have the table EventLogStaging?
Post #1017100
Posted Monday, November 8, 2010 5:15 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, September 22, 2014 11:29 AM
Points: 514, Visits: 1,733
peleg (11/8/2010)
the only thing that i whould change, is running the vbs from windows schedule task and not from the sql server, i think it's more correct way.
This will give you the ability prepare a vbs that you can put on all of you server's, rather only in the db server (although you can query the event viewer of a remote server, which is little more work).


yes, you could use windows scheduler, however, since the DB is required to make it work, the script would have to include some logic to handle itself if the DB was not avaialble.
it is also designed to be used by a DBA. in some places, DBA's do not have access to the windows scheduler.

also, the script is only required on one server
Post #1017103
Posted Monday, November 8, 2010 5:22 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 1:41 AM
Points: 123, Visits: 515
since the DB is required to make it work, the script would have to include some logic to handle itself if the DB was not avaialble.


this logic should run from the vbscript.
Post #1017104
Posted Monday, November 8, 2010 5:24 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 1:41 AM
Points: 123, Visits: 515
the problem that newbie got, isn't related to the DB, rather to the query of the wmi object.
Post #1017107
Posted Monday, November 8, 2010 5:25 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Monday, September 22, 2014 5:00 AM
Points: 39, Visits: 285
Geoff A (11/8/2010)
renasoursou (11/8/2010)
Hello,

your Article is really great. I tried to Run the Script on our Server (Windows Server 2003 R2 SERVICE PACK 1) but I get an error (see attached file). Can anyone Help me?

Thanks a lot




Do you have SQL running with a database called DBA on your server?
does the database DBA have the table EventLogStaging?



Yes I have. On thIs Server there are running an 2000 Sql Server and a 2005 SQL Server Instance. I have changed this Line

--> objConn.Open "Provider=SQLOLEDB.1;Data Source=RLDB2,4949\RLDB2_05;Initial Catalog=DBA;Integrated Security=SSPI"

RLDB2,4949\RLDB2_05 --> This is our SQL Server 2005 Instance on this Server.

I dont understand this error...
Post #1017109
Posted Monday, November 8, 2010 5:29 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, September 10, 2014 1:41 AM
Points: 123, Visits: 515
you have problem with the WMI object, not with the DB.
what did you change with the code?
query = "Select * from __InstanceCreationEvent" _
& " " & "where TargetInstance isa 'Win32_NTLogEvent'" _
& " " & "and TargetInstance.Logfile = 'Application'" _
& " " & "and (TargetInstance.EventType = 1 or TargetInstance.EventType = 2)" _
& " " & "and (TargetInstance.SourceName like 'MSSQL%')"
' get ready to insert into our DBA table

the problem is when you try to run the query :
Set colMonitoredEvents = objWMIService.ExecNotificationQuery(query)


Post #1017111
Posted Monday, November 8, 2010 5:37 AM


Mr or Mrs. 500

Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500Mr or Mrs. 500

Group: General Forum Members
Last Login: Monday, September 22, 2014 11:29 AM
Points: 514, Visits: 1,733
renasoursou, try this;

create an alias for RLDB2,4949\RLDB2_05 and call it something like "monitor"

then change Data Source=RLDB2,4949\RLDB2_05 to Data Source=monitor
Post #1017116
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse