Site sponsored by: Idera The gold standard of SQL Server performance monitoring & diagnostics.
SQL Server Performance

  • Home
  • Articles
  • Forums
  • Tips
  • Quiz
  • FAQ's
  • Blogs
  • Software
  • Books
  • About Us
RSS Feeds
Sign in | Join


Article Topics

All Articles
Performance Tuning
Audit
Business Intelligence
Clustering
Reporting Services
Developer
General DBA
ASP.NET / ADO.NET

Write for Us

Share your SQL Server knowledge with others and raise your profile in the community More...
Latest Articles

System Data Collection Reports
Recover Data Using Database Snapshots
Analyze and Fix Index Fragmentation in SQL Server 2008
Powerful Geographical Visualisations made easy with SQL 2008 Spatial (Part 2) ...

More     
 
Latest FAQ's

How to alter a User Defined Data Type?
How to unzip a File in SSIS?
How to view previous query plans?
ALTER TABLE SWITCH statement failed because the object '%.*ls' is not ...

More     
   
Latest Software Reviews

Spotlight on ApexSQL Doc 2008
ApexSQL Enforce
Embarcadero Change Manager
SQL Server DBA Dashboard

More     

articles >> general dba >> Monitor Your Database Servers with DTS, Part ...

Monitor Your Database Servers with DTS, Part 2: Errorlog Monitoring of SQL Servers

By : Neeraj Nagpal
May 26, 2005

Page 2 / 2


How to Add/Remove a New Server to the Monitoring Process?

  1. Create the dbamaint database on the new server.

    if not exists (select * from master..sysdatabases where name='dbamaint')
    create database dbamaint
    go
  2. Create a new "Microsoft OLE DB connection" to the new server in the DTS package.

  3. Create a new "Execute SQL task" in DTS package with the following query:

    use dbamaint

    go
    if not exists (select * from dbamaint..sysobjects where name='errorlog_srv' and type='U')
    create table dbamaint..errorlog_srv
    (server_name varchar(25) default @@servername,errlog_text varchar(255),c2 int)

    if exists (select * from dbamaint..sysobjects where name='temp_errorlog' and type='U')
    drop table dbamaint..temp_errorlog

    create table dbamaint..temp_errorlog
    (server_name varchar(25) default @@servername,errlog_text varchar(255),c2 int)

    insert dbamaint..temp_errorlog (errlog_text,c2)
    exec master..xp_readerrorlog

    if exists (select * from dbamaint..sysobjects where name='new_errorlog_rows' and type='U')
    drop table dbamaint..new_errorlog_rows

    create table dbamaint..new_errorlog_rows
    (server_name varchar(25) default @@servername,errlog_text varchar(255),c2 int)

    insert dbamaint..new_errorlog_rows (errlog_text,c2)
    select errlog_text,c2 from dbamaint..temp_errorlog where errlog_text not in (select errlog_text from dbamaint..errorlog_srv)

    --select * from dbamaint..new_errorlog_rows

    insert dbamaint..errorlog_srv
    select * from dbamaint..new_errorlog_rows


  4. Create a "Transform Data Task Properties" task and enter the following query:

    select * from dbamaint..new_errorlog_rows

  5. Add the workflow so that the transform step runs after the "Execute sql task."

  6. Don't forget to save the DTS package.

You have now successfully completed the setup of errorlog monitoring.



In the next article, I will explain how to set up the space monitoring report.


<< Prev Page         








Home | Peformance Articles | Audit Articles | Business Intelligence Articles | Clustering Articles | Developer Articles | Reporting Services Articles | DBA Articles | ASP.NET / ADO.NET Articles | DBA FAQ's | Developer Peformance FAQ's | DBA Peformance FAQ's | Developer FAQ's | Clustering FAQ's | Error Messages | Audit Tool Reviews | Backup Tool Reviews | Coding Tool Reviews | Compare Tool Reviews | Documentation Tool Reviews | Design Tool Reviews | Monitoring Tool Reviews | Log Tool Reviews | Reporting Tool Reviews | Clustering Tool Reviews | Security Tool Reviews | Change Management Tool Reviews | Remote Access Tool Reviews | Book Reviews | Security Tool Reviews | QDPMA Performance Tuning | ADO.NET / ASP.NET | Administration | Analysis/OLAP Services | Application Development | Configuration | Components | ETL | Hardware | High Availability | Hints | Index | Misc | Operating Systems | Performance Tuning | Replication | T-SQL | Views


              © 1999-2008 by T10 Media. All rights reserved