Errorlog Monitoring && Job Outputs
Nov 2, 2004Considering email is setup, how would you send emails by scanning errorlog for any issues. Also, how to send program outputs using email.
Thanks
Considering email is setup, how would you send emails by scanning errorlog for any issues. Also, how to send program outputs using email.
Thanks
Hello all,
I don't know what I am doing wrong.
In my environment, we have monitoring tool that scan through sql errorlog
every 10minutes to capture some error that occurs.
I have been trying for days now to create an alert for any of our failed
backup to appear in the sql errorlog with the code below. After I add
message to the sysmessage table with sp_addmessage, and raising the error
with log option, I modified the existing scheduled backup job by creating
an alert with the num in the code.
For some reason, this error will not just show up in the sql errorlog when
it failed.
Has anyone any advise on what to do?
The code is:
sp_addmessage 50001, 25, 'Backup Failed for the '%.*ls' database.Please Contact MSSQL DBA Immediately!!!! '
GO
DECLARE @DBID INT
SET @DBID = DB_ID()
DECLARE @DBNAME NVARCHAR(128)
SET @DBNAME = DB_NAME()
RAISERROR (50001, 25, 1, @DBID, @DBNAME) with log
GO
Thanks
SA
We are in plan to build a Monitoring tool using PowerShell and Performance Monitor which could monitor 10 to 20 servers. Do you have any reference of any existing tool using Performance Monitor to monitor the SQL Server and available for free? I didn't want to put some effort, if something is available already.
View 2 Replies View RelatedHi!
Even though i see all the errorlog files physically stored in the log directory, I am not seeing any errorlog info on Enterprice Manager. I see all files like errorlog, errorlog1, errorlog2, etc, when i click current errorlog, it shows nothing, Please help me what could be the problem?
Appreciate all your ideas.
Mohan
what does the error "login failed-User: Reason : Not associated with a trusted
SQL Server connection" means in the errorlog? it keeps on writing in the errorlog. what could be the caused of this? and how to correct this?
thanks a lot!
I need to send the output of a report generated, automatically through email as an attachment to some customer.Is it possible?Can anyone help?
View 1 Replies View RelatedHi....Does anyone know if there is a similar command to SQL2K's DBCC ERRORLOG.
I'm currently writing a preventative maintenance script and want to force archiving of errorlogs. Any help greatly appreciated.
Hello-
I am getting a recurring error in my errorlog. This is the error:
"BlkHeader from strip 0 At 13531e00 ExpectedAt 13531e00 Size c00 PrevSize 200"
Has anyone seen this before?
Thanks,
Traci McPartland
I am trying to change the default number of SQL errorlogs from 6 to 12. Does anyone know how to change that?
View 7 Replies View RelatedI just spent the better part of a full day trying to figure out why my MSSQLSERVER service wouldn't start. Finally, after someone suggested I check out "C:Program FilesMicrosoft SQL Server[Instance Name]LogErrorLog" I found my problem. I opened it up to find: (newbie mistake, I know now!!)
2005-12-21 19:27:46.60 server SQL Server evaluation period has expired
So I thought I would pass this onto everyone I can think of so you will not make the mistake I just did.
It would have been nice if Microsoft, like just about every other software company out there, would have been loud & obnoxious about their trial software expiring. Instead they have to put a poor newbie soul thru what I just went thru.
*sigh*
Well if I helped 1 person with this, I've done some good!
I need to move the errorlog files from the d: drive to the e: drive on my NT servers. Does anyone know a way to accomplish this without having to re-install?
Thanks
tcb
We're running SQL 6.5 SP3, we recycle our SQL server every day, somehow starting last December, the errorlog kept appending to the previous one
without starting a new log, and it keeps on growing,
any one knows anywhere I should look into ?
If SQL behaves properly, it should starts a new log after each recycle.
I checked from Technet this problem may occur in 4.2 but I haven't seen anything in 6.5....Thanks
Anthony
Can someone please clarify:
If you have a data file, and you only want CERTAIN rows to pass to the destination, ie) a table
and you are using a script task to accomplish this,
is this a synchronous or asynchronous transformation?
Q. And how do you assign the values to the output? Do you have to create output columns, or not?
I am very very confused right now. I can't seem to find a decent answer to what is a very basic question either in my SSIS book or in the documenation. Perhaps it is so basic, that the question doesn't seem valid? I don't know. But I just don't understand this at all.
Thank you
Hi There,
I have been struggling day and night with the creation of a store procedure due to not being able to retieve the rows I need for SUM and AVG functions.
I have two tables ('actions' & 'incident_types') which both have a score value for each record. In my database, I have reports that contain both action codes and incident_type codes based on a personnel_code.
In simple terms I'm trying to do the following:-
For all reports, find each personnel member and thier attached incident_types and action codes and then, for each score from the actions and incident_types tables, create the SUM of the 'combined' scores.
I have successfully retrieved the output for the scores individually but I need the TOP(10) of the combined output.....
I'm currently using to seperate queries as follows :--
--This gives me the incident type output...... Creating the 'Volume' column which is the total Score for incidetn_types
SELECT Top (@Number) Personnel_details.personnel_code, Personnel_details.personnel_forename, Personnel_details.personnel_Surname, sum(incident_types.type_score) as 'Volume', avg(incident_types.type_score) as 'Average' INTO 'Incident_Scores' from Report_header
JOIN incident_types on incident_types.type_code = report_header.report_incident_Code
JOIN report_basedon on report_basedon.report_code = report_header.report_code
JOIN personnel_details on personnel_details.personnel_code = report_basedon.personnel_code
WHERE (report_header.report_date >= @fromDate and report_header.report_date <= @toDate)
AND (report_header.report_time >= @fromTime and report_header.report_time <= @toTime)
AND report_basedon.personnel_code <> 0
AND report_header.record_status=@recordStatus
group by Personnel_details.personnel_code, Personnel_details.personnel_forename, Personnel_details.personnel_Surname
-- I then use the following to get the total of all action scores, again in the 'Volume' column
SELECT Top (@Number) Personnel_details.personnel_code, Personnel_details.personnel_forename, Personnel_details.personnel_Surname, sum(actions.action_score) as 'Volume', AVG(actions.action_score) as 'Average' from profile
JOIN actions on actions.action_code = profile.action_code
JOIN report_header on report_header.report_code = profile.incident_ID
JOIN personnel_details on personnel_details.personnel_code = profile.personnel_code
WHERE (report_header.report_date >= @fromDate and report_header.report_date <= @toDate)
AND (report_header.report_time >= @fromTime and report_header.report_time <= @toTime)
AND personnel_details.personnel_code <> 0
AND report_header.record_status=@recordStatus
AND profile.record_status=@recordStatus
group by Personnel_details.personnel_code, Personnel_details.personnel_forename, Personnel_details.personnel_Surname
So my question is - How can I get the sum(incident_types.type_score) + sum(actions.action_score) and then get the TOP(10) rows?
Is it possible to output these 2 result to a new table and then join the new tables?
Thanks for any assistance, this is really draining me at the moment..... :-/
Hi.
I have a service on a server which contains Sql Server Express.
this service adds documents to the database to allow full text search features.
From some reason, the index crashes and than it writes to the ErrorLog file, the errorlog jumps to 20GB(!) causing the server to crash.
How can :
1. limit the size of the error log.
2. find out why the log jumps to this size (I can't open the error log file ofcourse...)
Thanks!
I have a stored procedure that I just need to return the output to my program.It is a Select All type statement.I will post my vb code that works when I use both inputs and outputs but not for all output procedure...I dont get it.
Here is the Stored Procedure.....
CREATE procedure dbo.IDXAppt_Settings_NET
(
@SQLADD nvarchar(15)Output,
@SQLDatabase nvarchar(20)Output,
@SQLLogin nvarchar(20)Output,
@SQLPass nvarchar(20)Output
)
as
select
@SQLADD=SQLAddress,
@SQLDatabase=SQLDatabase,
@SQLLogin=SQLLogin,
@SQLPass=SQLPassword
from
Clinic_Settings
GO
Here is the Vb.Net Code........
To retrieve the elements that does not give me an error just gives me no data....
Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim consql As New SqlConnection("server=myserver,database=APPOINTMENTS;uid=webtest;pwd=webtest")
Dim cmdsql As New SqlCommand
Dim parmSQLAddress As SqlParameter
Dim parmDatabase As SqlParameter
Dim parmLogin As SqlParameter
Dim parmSqlPass As SqlParameter
Dim strtest As String
Dim db As String
Dim login As String
Dim pass As String
cmdsql = New SqlCommand("Appt_Settings_NET", consql)
cmdsql.CommandType = CommandType.StoredProcedure
parmDatabase = cmdsql.Parameters.Add("@SQLData", SqlDbType.NVarChar)
parmDatabase.Size = 20
parmDatabase.Direction = ParameterDirection.Output
db = cmdsql.Parameters("@SQLData").Value
parmLogin = cmdsql.Parameters.Add("@SQLLogin", SqlDbType.NVarChar)
parmLogin.Size = 20
parmLogin.Direction = ParameterDirection.Output
login = cmdsql.Parameters("@SQLLogin").Value
parmSqlPass = cmdsql.Parameters.Add("@SQLPass", SqlDbType.NVarChar)
parmSqlPass.Size = 20
parmSqlPass.Direction = ParameterDirection.Output
pass = cmdsql.Parameters("@SQLPass").Value
parmSQLAddress = cmdsql.Parameters.Add("@SQLADD", SqlDbType.NVarChar)
parmSQLAddress.Size = 15
parmSQLAddress.Direction = ParameterDirection.Output
strtest = cmdsql.Parameters("@SQLADD").Value
consql.Open()
cmdsql.ExecuteNonQuery()
Label1.Text = strtest
End Sub
Hi everyone!
I have an stordprocedure that returns a resultset , an output value and an return value.
I invoked this procedure using an sqlcommand object ( by ExecudeReader method ) and I filled a SqlDataReader object by the resultset.
dr = cmd.ExecudeReader();
but I cant reach its output variable and its return value (cmd.parameters["@ret"].value).
an exception raises : object refrence error!
what is wrong in this approach ?
please help me.
Hi,
How print out a readable dump by using PRINTDMP, I didn't catch up the
parameters that I have to pass.
Thanks,
Herve Meftah
Obviously Excel is the tool of choice for most people but with it's limited ability to leverage RAM (32 bit) and it's limitation with rows at just over 1 million what other choices do we have for viewing data?
My bosses boss created several OLAP universes and they seems to fly a lot fast than regular relational database. This still doesn't work with the fact the data can't be worked with unless you have a strong front end that can handle processing all those rows.
We have set up a couple of SQL Server 2005 systems and I have foundthat the format of the ERRORLOG files and the SQL Agent's log filesare Unicode or some format that findstr cannot parse properly. "find"parses them fine, but it doesn't have the capabilities that I need --specifically, I can't search for multiple strings in one search.I see the checkbox on the SQL Agent's for "Write OEM File", but it isgrayed out so I am not able to try checking that. I also don't knowif that would affect the server's ERRORLOG file too or just theAgent's log file.So what am I missing? What is everyone else doing who is used tohaving scripts to parse these files looking for strings that indicateproblems? Is there a server setting that will force it to go back toa plain ANSI text file format for log files? Is that a bad thing todo?Thanks in advance for any insight,Teresa Masino
View 4 Replies View RelatedI have a table with email addresses and CC_Flag.
Email | CC_Flag
xxxx 0
yyyy 1
zzzz 1
Using Task SQL, I am trying to pass these email addresses to two separate variables - To_field, Cc_field on basis of the CC_Flag. Is it possible to fill two variables from a single SQl Task.
Hello, I am using a multicast with 5 outputs, I attempting to pass about four thousand rows to different destinations. However, upon execution only two of the outputs send the rows to the destination. After deleting the multicast and reinserting it, different destinations received the data. The number of destinations is also not consistant, sometimes 3 work and sometimes only 1 works.
Thank you.
Hi,
SQL Server 2005, sp2
What I am trying to do is very simple. I just want to run 2 stored procedures, then have the output from both sp's written to a single file.
I created a Data Flow task, then put 2 OLE DB Source adapters in the Data Flow task, one for each stored procedure.
Next, I dropped a Flat File destination object onto the page. However, I can only connect ONE arrow from one of the OLE DB Source adapters to the Flat File destination. It won't let me connect both.
What am I doing wrong here? How can I accomplish what I am trying to do here?
Thanks much
Hi,
I wonder if someone might be able to help me with scripting a script component. I'd like to include error redirection of rows within my script.
If the conversion of any of my inputs fail i'd like to catch the error and then just output all values to another output path. The output path will just take the input values without converting them from string data types and output them to an error table.
In the script i imagine i would use try catch statements and if it fails then set the output. I am not entirely sue as to how to go about switching between outputs though.
Any help on this matter would be greatfully recieved.
Cheers,
Grant
If you have an output that is not synchronous with the input what is the best way of processing the data.
I am currently using a generic queue, and a custom class. I am creating an instance of the class in the ProcessINputRow and then adding it to the Queue.
The CreateNewOutputRows Dequeues the class instances and creates buffer rows.
Is there a better solution?
Can someone please point me to one or more examples of a Source component that has two or more outputs?
I wrote a source, which works with a single output, but after adding a second output, I see no rows there. I've single-stepped the code in the debugger, and it looks like it should be adding rows to the second output, but the downstream component never sees any.
Thanks.
On URL: http://technet.microsoft.com/en-us/library/ms135931.aspx among other things there is an VB example for "Creating and Configuring Output Columns" of Custom Transformation Component with Asynchronous Outputs:
Public Overrides Sub OnInputPathAttached(ByVal inputID As Integer)
Dim input As IDTSInput90 = ComponentMetaData.InputCollection.GetObjectByID(inputID)
Dim output As IDTSOutput90 = ComponentMetaData.OutputCollection(0)
Dim vInput As IDTSVirtualInput90 = input.GetVirtualInput()
For Each vCol As IDTSVirtualInputColumn90 In vInput.VirtualInputColumnCollection
Dim outCol As IDTSOutputColumn90 = output.OutputColumnCollection.New()
outCol.Name = vCol.Name
outCol.SetDataTypeProperties(vCol.DataType, vCol.Length, vCol.Precision, vCol.Scale, vCol.CodePage)
Next
End Sub
When I copy-paste given code into ScriptMain of Ascynchronous Script Transformation Component I receive error message "sub 'OnInputPathAttached' cannot be declared 'Overrides' because it does not override a sub in a base class."
Hi
I was not able to connect to SQL Server machine. On examining the Error log (which was huge 53MB), I found the following messages that filled 95% of the logfile. Is this something to do with memory allocation.
Someone, please let me know what is going on. After the server reboot everything works fine.
I am worrired that this message may occur again.
Thanks
Machilu
2004-11-30 20:15:03.64 logon Login failed for user 'NT AUTHORITYSYSTEM'
2004-12-01 08:15:03.77 logon Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
2004-12-01 00:47:25.28 spid70 WARNING: Failed to reserve contiguous memory of Size= 65536.
2004-12-01 00:47:25.31 spid70 Buffer Distribution: Stolen=127590 Free=4176 Procedures=182443
Inram=0 Dirty=14180 Kept=0
I/O=0, Latched=154, Other=10049
2004-12-01 00:47:25.31 spid70 Buffer Counts: Commited=338592 Target=338592 Hashed=24383
InternalReservation=357 ExternalReservation=0 Min Free=256
2004-12-01 00:47:25.31 spid70 Procedure Cache: TotalProcs=66212 TotalPages=182443 InUsePages=88547
2004-12-01 00:47:25.31 spid70 Dynamic Memory Manager: Stolen=310033 OS Reserved=38512
OS Committed=38457
OS In Use=38388
Query Plan=332158 Optimizer=0
General=15540
Utilities=8 Connection=473
2004-12-01 00:47:25.31 spid70 Global Memory Objects: Resource=10685 Locks=119
SQLCache=4540 Replication=2
LockBytes=2 ServerGlobal=45
Xact=201
2004-12-01 00:47:25.31 spid70 Query Memory Manager: Grants=0 Waiting=0 Maximum=92118 Available=92118
2004-12-01 00:50:04.10 logon Login failed for user 'NT AUTHORITYSYSTEM'.
2004-12-01 00:50:04.32 logon Login failed for user 'NT AUTHORITYSYSTEM'.
2004-12-01 00:51:08.78 spid70 WARNING: Failed to reserve contiguous memory of Size= 65536.
2004-12-01 00:51:08.82 spid70 Buffer Distribution: Stolen=138829 Free=5944 Procedures=169283
Inram=0 Dirty=14431 Kept=0
I/O=0, Latched=154, Other=9951
2004-12-01 00:51:08.82 spid70 Buffer Counts: Commited=338592 Target=338592 Hashed=24536
InternalReservation=360 ExternalReservation=0 Min Free=256
2004-12-01 00:51:08.82 spid70 Procedure Cache: TotalProcs=67783 TotalPages=169283 InUsePages=76116
2004-12-01 00:51:08.82 spid70 Dynamic Memory Manager: Stolen=308112 OS Reserved=38512
OS Committed=38457
OS In Use=38398
Query Plan=330249 Optimizer=0
General=15535
Utilities=8 Connection=476
2004-12-01 00:51:08.82 spid70 Global Memory Objects: Resource=10685 Locks=118
SQLCache=4540 Replication=2
LockBytes=2 ServerGlobal=45
Xact=202
Rather than the real code, here's a sample we came up with.
Here's the C# Code:
public class sptest : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
private DataSet dtsData;
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
string strSP = "sp_testOutput";
SqlParameter[] Params = new SqlParameter[2];
Params[0] = new SqlParameter("@Input", "Pudding");
Params[1] = new SqlParameter("@Error_Text", "");
Params[1].Direction = ParameterDirection.Output;
try
{
this.dtsData = SqlHelper.ExecuteDataset(ConfigurationSettings.AppSettings["SIM_DSN"], CommandType.StoredProcedure, strSP, Params);
Label1.Text = Params[0].Value.ToString() + "--Returned Val is" + Params[1].Value.ToString();
}
//catch (System.Data.SqlClient.SqlException ex)
catch (Exception ex)
{
Label1.Text = ex.ToString();
}
}
Here is the stored procedure:
CREATE PROCEDURE [user1122500].[sp_testOutput](@Input nvarchar(76),@Error_Text nvarchar(10) OUTPUT)AS
SET @Error_Text = 'Test'GO
When I run this, it prints up the input variable, but not the output variable.
Hi, all
recently, I use the following script(somebody else) to create a database on a remote server: the script is as follow:
/*************************/
CREATE DATABASE [ErrorLog]
GO
Use ErrorLog
CREATE TABLE [dbo].[Errors] (
[ID] [int] IDENTITY (1, 1) NOT NULL ,
[SessionID] [char] (12) NULL ,
[RequestMethod] [char] (5) NULL ,
[ServerPort] [char] (5) NULL ,
[HTTPS] [char] (3) NULL ,
[LocalAddr] [char] (15) NULL ,
[HostAddress] [char] (15) NULL ,
[UserAgent] [varchar] (255) NULL ,
[URL] [varchar] (400) NULL ,
[CustomerRefID] [varchar] (20) NULL ,
[FormData] [varchar] (2000),
[AllHTTP] [varchar] (2000),
[ErrASPCode] [char] (10) NULL ,
[ErrNumber] [char] (11) NULL ,
[ErrSource] [varchar] (255) NULL ,
[ErrCategory] [varchar] (50) NULL ,
[ErrFile] [varchar] (255) NULL ,
[ErrLine] [int] NULL ,
[ErrColumn] [int] NULL,
[ErrDescription] [varchar] (1000) NULL ,
[ErrAspDescription] [varchar] (1000) NULL ,
[InsertDate] [datetime] NOT NULL
) ON [PRIMARY]
--Create the user "ErrorLog"
if not exists (select * from master.dbo.syslogins where loginname = N'ErrorLog')
BEGIN
declare @logindb nvarchar(132), @loginlang nvarchar(132) select @logindb = N'Navigator', @loginlang = N'us_english'
if @logindb is null or not exists (select * from master.dbo.sysdatabases where name = @logindb)
select @logindb = N'master'
if @loginlang is null or (not exists (select * from master.dbo.syslanguages where name = @loginlang) and @loginlang <> N'us_english')
select @loginlang = @@language
exec sp_addlogin N'ErrorLog', 'secret', @logindb, @loginlang
END
GO
if not exists (select * from dbo.sysusers where name = N'ErrorLog' and uid < 16382)
EXEC sp_grantdbaccess N'ErrorLog', N'ErrorLog'
GO
Grant select, insert On Errors to ErrorLog
/***************************/
in my *.asp program, I used the following string to connect to the database on the remote server.
/********
con.open "dsn=ErrorLog;uid=ErrorLog;pwd=secret;"
********/
the following message comes up:
/********/
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E4D)
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'ErrorLog'.
/*********/
what is the problem here?
when I set up dsn ErrorLOG, I used "abc" userID and password "XXX" which is our server database administrator assigned to me. I tested connection in odbc, it is OK
I just don't get, ther user ErrorLog already had login id and granted access to database errorlog. any clue, please help!
Betty
Hello,
Is there a way I could get the total cpu usuage of the box other than Task Manager and Profiler
Thanks
Rea
I understand the rule of thumb that the CPU should not be over 90%. If you take the four counters (%processor time,%privileged time, %user time, %interrupt time, and interrupt seconds), what combination gives you your CPU
time ?
Hello,
I am looking for a reliable and easy manner to poll a domain for any box running the sql server service. Our current monitoring tool doesn't do this.
Many thanks!