Showing posts with label history. Show all posts
Showing posts with label history. Show all posts

Wednesday, March 28, 2012

Maintenance Plan email report failure

Hello,
I have a simple daily maintenance plan for backups.(check integrity, back up, clean up history and then report) However, sending the email report always fails with the following error:

"Could not generate mail report.An exception occurred while executing a Transact-SQL statement or batch.Incorrect syntax near 'sys'."

How can the wizard output Incorrect syntax?

I have set up and tested Database mail and set the default public profile.
I have enabled the mail profile in SQL server agent properties and then restarted SQL server agent.
I have set up operator to receive the mail.
The frustrating thing is that if I set up and schedule a really simple test maintenance plan, the email report works! But it always fails on the real one.
How can I get more detail in the error message and actually see the SQL it is trying to execute when it send the mail?

Thanks,
Adam

More detail.

Having done a few tests it seems that this mail report error only occurs after the check integrity job fails. eg.

Executing the query "DBCC CHECKDB WITH NO_INFOMSGS
" failed with the following error:

"Incorrect PFS free space information for page (1:278) in object ID 60, index ID 1, partition ID 281474980642816, alloc unit ID 71776119065149440 (type LOB data). Expected value 0_PCT_FULL, actual value 100_PCT_FULL.
CHECKDB found 0 allocation errors and 1 consistency errors in table 'sys.sysobjvalues' (object ID 60).

CHECKDB found 0 allocation errors and 1 consistency errors in database 'RHJ'.
repair_allow_data_loss is the minimum repair level for the errors found by DBCC CHECKDB (RHJ).".

Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.


This failure does not affect the backup and maintenance cleanup tasks that run afterwards, only the email report that it tries to send at the end.

Wednesday, March 21, 2012

Maintanence plan challenge!

Heres a challenge...
Sudddenly our backup maintanence plan stoped working. In the job history the
following error is displayed:
The job failed. The job invoked by the user sa. The last step to run was
step 1 (Step 1).
Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
(Error 22029). The step failed.
The maintanence plan error log is empty.
The job does not backup transaction logs and i've deseleccted integrity
check. I've created a new database and recrated the maintanene plan on this
database with the same result. I also created a maintanence plan with only an
integrity check. Still the same result...
I′m going nuts....
Hi ,
Can you mail the syntax you are using for sqlmaint.exe along with any
switches that have been used.
Thanks & Regards
Vishal
"Stefan Andersson" wrote:

> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history the
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on this
> database with the same result. I also created a maintanence plan with only an
> integrity check. Still the same result...
> I′m going nuts....
|||The maintanence plan are scheduled in Enterprise Manager so i dont run it
with any switches. It does not matter which type of maintanece plan i create
(backup, integrity check, etc).
"Vishal Gandhi" wrote:
[vbcol=seagreen]
> Hi ,
> Can you mail the syntax you are using for sqlmaint.exe along with any
> switches that have been used.
> Thanks & Regards
> Vishal
> "Stefan Andersson" wrote:
|||Specify a report file for the plan and check for error messages from SQL Server in the report file.
If you are lucky, you find SQL Server errors there.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Stefan Andersson" <StefanAndersson@.discussions.microsoft.com> wrote in message
news:A79A5153-3A52-4456-AE97-28130C174A6B@.microsoft.com...
> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history the
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on this
> database with the same result. I also created a maintanence plan with only an
> integrity check. Still the same result...
> Im going nuts....

Maintanence plan challenge!

Heres a challenge...
Sudddenly our backup maintanence plan stoped working. In the job history the
following error is displayed:
The job failed. The job invoked by the user sa. The last step to run was
step 1 (Step 1).
Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
(Error 22029). The step failed.
The maintanence plan error log is empty.
The job does not backup transaction logs and i've deseleccted integrity
check. I've created a new database and recrated the maintanene plan on this
database with the same result. I also created a maintanence plan with only an
integrity check. Still the same result...
I´m going nuts....Hi ,
Can you mail the syntax you are using for sqlmaint.exe along with any
switches that have been used.
Thanks & Regards
Vishal
"Stefan Andersson" wrote:
> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history the
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on this
> database with the same result. I also created a maintanence plan with only an
> integrity check. Still the same result...
> I´m going nuts....|||The maintanence plan are scheduled in Enterprise Manager so i dont run it
with any switches. It does not matter which type of maintanece plan i create
(backup, integrity check, etc).
"Vishal Gandhi" wrote:
> Hi ,
> Can you mail the syntax you are using for sqlmaint.exe along with any
> switches that have been used.
> Thanks & Regards
> Vishal
> "Stefan Andersson" wrote:
> > Heres a challenge...
> >
> > Sudddenly our backup maintanence plan stoped working. In the job history the
> > following error is displayed:
> >
> > The job failed. The job invoked by the user sa. The last step to run was
> > step 1 (Step 1).
> >
> > Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> > (Error 22029). The step failed.
> >
> > The maintanence plan error log is empty.
> >
> > The job does not backup transaction logs and i've deseleccted integrity
> > check. I've created a new database and recrated the maintanene plan on this
> > database with the same result. I also created a maintanence plan with only an
> > integrity check. Still the same result...
> >
> > I´m going nuts....|||Specify a report file for the plan and check for error messages from SQL Server in the report file.
If you are lucky, you find SQL Server errors there.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Stefan Andersson" <StefanAndersson@.discussions.microsoft.com> wrote in message
news:A79A5153-3A52-4456-AE97-28130C174A6B@.microsoft.com...
> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history the
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on this
> database with the same result. I also created a maintanence plan with only an
> integrity check. Still the same result...
> I´m going nuts....sql

Maintanence plan challenge!

Heres a challenge...
Sudddenly our backup maintanence plan stoped working. In the job history the
following error is displayed:
The job failed. The job invoked by the user sa. The last step to run was
step 1 (Step 1).
Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE 42
000]
(Error 22029). The step failed.
The maintanence plan error log is empty.
The job does not backup transaction logs and i've deseleccted integrity
check. I've created a new database and recrated the maintanene plan on this
database with the same result. I also created a maintanence plan with only a
n
integrity check. Still the same result...
I′m going nuts....Hi ,
Can you mail the syntax you are using for sqlmaint.exe along with any
switches that have been used.
Thanks & Regards
Vishal
"Stefan Andersson" wrote:

> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history t
he
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE
42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on th
is
> database with the same result. I also created a maintanence plan with only
an
> integrity check. Still the same result...
> I′m going nuts....|||The maintanence plan are scheduled in Enterprise Manager so i dont run it
with any switches. It does not matter which type of maintanece plan i create
(backup, integrity check, etc).
"Vishal Gandhi" wrote:
[vbcol=seagreen]
> Hi ,
> Can you mail the syntax you are using for sqlmaint.exe along with any
> switches that have been used.
> Thanks & Regards
> Vishal
> "Stefan Andersson" wrote:
>|||Specify a report file for the plan and check for error messages from SQL Ser
ver in the report file.
If you are lucky, you find SQL Server errors there.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Stefan Andersson" <StefanAndersson@.discussions.microsoft.com> wrote in mess
age
news:A79A5153-3A52-4456-AE97-28130C174A6B@.microsoft.com...
> Heres a challenge...
> Sudddenly our backup maintanence plan stoped working. In the job history t
he
> following error is displayed:
> The job failed. The job invoked by the user sa. The last step to run was
> step 1 (Step 1).
> Executed as user: NT AUTHORITY\SYSTEM. sqlmaint.exe failed. [SQLSTATE
42000]
> (Error 22029). The step failed.
> The maintanence plan error log is empty.
> The job does not backup transaction logs and i've deseleccted integrity
> check. I've created a new database and recrated the maintanene plan on th
is
> database with the same result. I also created a maintanence plan with only
an
> integrity check. Still the same result...
> Im going nuts....

Monday, March 19, 2012

Maintain History

Hi All
I have a table that contains details regarding branch offices and as these
offices regularly change details such as the branch name and address I need
to always have the current details and also maintain a history of historical
details for each branch office. Initially I was think of having a duplicate
table with a datetime column to store when the last change was made and also
a column that contained the details of who changed the branch office details.
I was going to control this through the application but have identified that
there is any additional vendor application that also change details in this
table and the application can not be modified.
Is the best way to maintain a history of branch office details in this
scenario to create a trigger on the table and populate a duplicate table with
the details of the branch office as they where before being modified or is
there a better way to do this?
Thanks
- DavidHi David
There is a simple auditing example (E) in the Create Trigger topic in books
online. There may be an impact on the system if you implement these on all
your tables, in both the amount of storage used and time taken to make
changes. To reduce the performance degredation it is best to keep the trigger
as simple as you can , if any reconciliation is necessary then you can do
that during a quiet period of possibly offline.
Alternatively you can purchase a log reading program, you may want to log at
LogExplorer from Lumigent www.lumigent.com or LogPI which has been aquired
by Goldengate see www.logpi.com
John
"David" wrote:
> Hi All
> I have a table that contains details regarding branch offices and as these
> offices regularly change details such as the branch name and address I need
> to always have the current details and also maintain a history of historical
> details for each branch office. Initially I was think of having a duplicate
> table with a datetime column to store when the last change was made and also
> a column that contained the details of who changed the branch office details.
> I was going to control this through the application but have identified that
> there is any additional vendor application that also change details in this
> table and the application can not be modified.
> Is the best way to maintain a history of branch office details in this
> scenario to create a trigger on the table and populate a duplicate table with
> the details of the branch office as they where before being modified or is
> there a better way to do this?
> Thanks
> - David

Maintain History

Hi All
I have a table that contains details regarding branch offices and as these
offices regularly change details such as the branch name and address I need
to always have the current details and also maintain a history of historical
details for each branch office. Initially I was think of having a duplicate
table with a datetime column to store when the last change was made and also
a column that contained the details of who changed the branch office details
.
I was going to control this through the application but have identified that
there is any additional vendor application that also change details in this
table and the application can not be modified.
Is the best way to maintain a history of branch office details in this
scenario to create a trigger on the table and populate a duplicate table wit
h
the details of the branch office as they where before being modified or is
there a better way to do this?
Thanks
- DavidHi David
There is a simple auditing example (E) in the Create Trigger topic in books
online. There may be an impact on the system if you implement these on all
your tables, in both the amount of storage used and time taken to make
changes. To reduce the performance degredation it is best to keep the trigge
r
as simple as you can , if any reconciliation is necessary then you can do
that during a quiet period of possibly offline.
Alternatively you can purchase a log reading program, you may want to log at
LogExplorer from Lumigent www.lumigent.com or LogPI which has been aquired
by Goldengate see www.logpi.com
John
"David" wrote:

> Hi All
> I have a table that contains details regarding branch offices and as these
> offices regularly change details such as the branch name and address I nee
d
> to always have the current details and also maintain a history of historic
al
> details for each branch office. Initially I was think of having a duplica
te
> table with a datetime column to store when the last change was made and al
so
> a column that contained the details of who changed the branch office detai
ls.
> I was going to control this through the application but have identified t
hat
> there is any additional vendor application that also change details in thi
s
> table and the application can not be modified.
> Is the best way to maintain a history of branch office details in this
> scenario to create a trigger on the table and populate a duplicate table w
ith
> the details of the branch office as they where before being modified or is
> there a better way to do this?
> Thanks
> - David

Monday, March 12, 2012

Maint Plans

Hi
SQL Server 2005 sp2
I have a maint plan that was created via the wizzard using separate schedule
fpr each task
sub_plan1 - history clean up; scheduled onec a day at 03:00AM
sub_plan2 - Full backup for all databases; scheduled onec a day at 03:00AM
sub_plan3 - Log backup for specific databases ; scheduled daily every 10
minutes
sub_plan4 - maintenace cleanup; scheduled onec a day at 03:00AM
I face 2 problems:
1. sub_plan2(Full) works only for those databases that are not part of
sub_plan3(Log)
2. sub_plan4 does not work
I will appreciate any help.
Thanks,
Yaniv
Hi
Have you set up the reporting and logging options for the maintenance plan
(next to manage connections) on tool bar. Knowing what the error messages
are! Make sure that your log backups are not running at the same time as the
full backup.
John
"Yan" <yaniv.etrogi@.gmail.com> wrote in message
news:%23yeqwseVIHA.5596@.TK2MSFTNGP05.phx.gbl...
> Hi
> SQL Server 2005 sp2
> I have a maint plan that was created via the wizzard using separate
> schedule fpr each task
> sub_plan1 - history clean up; scheduled onec a day at 03:00AM
> sub_plan2 - Full backup for all databases; scheduled onec a day at 03:00AM
> sub_plan3 - Log backup for specific databases ; scheduled daily every 10
> minutes
> sub_plan4 - maintenace cleanup; scheduled onec a day at 03:00AM
> I face 2 problems:
> 1. sub_plan2(Full) works only for those databases that are not part of
> sub_plan3(Log)
> 2. sub_plan4 does not work
>
> I will appreciate any help.
> Thanks,
> Yaniv
>

Maint Plans

Hi
SQL Server 2005 sp2
I have a maint plan that was created via the wizzard using separate schedule
fpr each task
sub_plan1 - history clean up; scheduled onec a day at 03:00AM
sub_plan2 - Full backup for all databases; scheduled onec a day at 03:00AM
sub_plan3 - Log backup for specific databases ; scheduled daily every 10
minutes
sub_plan4 - maintenace cleanup; scheduled onec a day at 03:00AM
I face 2 problems:
1. sub_plan2(Full) works only for those databases that are not part of
sub_plan3(Log)
2. sub_plan4 does not work
I will appreciate any help.
Thanks,
YanivHi
Have you set up the reporting and logging options for the maintenance plan
(next to manage connections) on tool bar. Knowing what the error messages
are! Make sure that your log backups are not running at the same time as the
full backup.
John
"Yan" <yaniv.etrogi@.gmail.com> wrote in message
news:%23yeqwseVIHA.5596@.TK2MSFTNGP05.phx.gbl...
> Hi
> SQL Server 2005 sp2
> I have a maint plan that was created via the wizzard using separate
> schedule fpr each task
> sub_plan1 - history clean up; scheduled onec a day at 03:00AM
> sub_plan2 - Full backup for all databases; scheduled onec a day at 03:00AM
> sub_plan3 - Log backup for specific databases ; scheduled daily every 10
> minutes
> sub_plan4 - maintenace cleanup; scheduled onec a day at 03:00AM
> I face 2 problems:
> 1. sub_plan2(Full) works only for those databases that are not part of
> sub_plan3(Log)
> 2. sub_plan4 does not work
>
> I will appreciate any help.
> Thanks,
> Yaniv
>