Wednesday, March 28, 2012
Problems with SQL-DMO.Job Script method
Agent Jobs. In this program I am using the SQL-DMO objects for SQL
Server.
When the output is generated from the Job.Script method the job steps
are not in the correct order. They are ordered by step_name rather
than the step_id. Scripts generated from Enterprise Manager works
fine. It is just the ones from the DMO objects that get out of order.
Anybody have this problem as well?
Thanks in advance.
KeithProblem solved!
The msdb statistics were not updated and the query was using the
non-clustered index rather than the clustered index. The non-clustered
index was job_id, step_name. The clustered index is job_id , step_id.
Updated the statistics on msdb tables and it worked fine.
Problems with SQL Server agent
I have som problems with a SQL Server agent job.
I have created a DTS package that extracts data from database and saves
the data to a csv file on the
network.
When I run the DTS package manually the file is created and all is OK.
But when I create a scheduled SQL Server agent job to run my DTS
package I get the following error message:
"Executed as user: SERVER\SYSTEM.
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
(80004005)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
Error Detail Records:
Error: 5 (5); Provider Error: 5 (5)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
TSRun: Package execution complete. Process Exit Code 1. The step
failed."
I understand as much as the user running the job hasn't got access to
the file...
So.. how do I change the user that executes the job?
Thanks for your help.
Mikael
McA wrote:
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job?
> Thanks for your help.
> Mikael
>
Are the SQL Server and SQL Agent services configured to run as "Local
System" or as a domain user? When you run the DTS package manually, it
runs using the permissions that your personal login has. When it runs
from a job, it uses the permissions that SQL Server has. To access
network resources, SQL must be running as a domain user, and that domain
user must have the necessary permissions to access the resource.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||Check the services application. Is the SQL Server Agent service running as
a domain user account or as the local system?
You need to make sure that the account that the SQL Server Agent is running
under has permissions to the file/directory.
Keith Kratochvil
"McA" <mikael.ahlberg@.gmail.com> wrote in message
news:1160055899.543735.146020@.i42g2000cwa.googlegr oups.com...
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job?
> Thanks for your help.
> Mikael
>
|||Hello
It looks like the SQLSERVERAGENT runs with the Local System account.
So if I change the "Log On As" user to at user with rights to my file
I'll be OK?
I'll try that thanks..
Mikael
|||McA wrote:
> Hello
> It looks like the SQLSERVERAGENT runs with the Local System account.
> So if I change the "Log On As" user to at user with rights to my file
> I'll be OK?
> I'll try that thanks..
> Mikael
>
There's more to consider than whether the user has rights to your file,
but yes, that's the solution to your problem. You need to read about
Service Accounts in Books Online before changing anything, to make sure
you understand the requirements.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Problems with SQL Server agent
I have som problems with a SQL Server agent job.
I have created a DTS package that extracts data from database and saves
the data to a csv file on the
network.
When I run the DTS package manually the file is created and all is OK.
But when I create a scheduled SQL Server agent job to run my DTS
package I get the following error message:
"Executed as user: SERVER\SYSTEM.
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
(80004005)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
Error Detail Records:
Error: 5 (5); Provider Error: 5 (5)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
TSRun: Package execution complete. Process Exit Code 1. The step
failed."
I understand as much as the user running the job hasn't got access to
the file...
So.. how do I change the user that executes the job'
Thanks for your help.
MikaelMcA wrote:
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>
Are the SQL Server and SQL Agent services configured to run as "Local
System" or as a domain user? When you run the DTS package manually, it
runs using the permissions that your personal login has. When it runs
from a job, it uses the permissions that SQL Server has. To access
network resources, SQL must be running as a domain user, and that domain
user must have the necessary permissions to access the resource.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Check the services application. Is the SQL Server Agent service running as
a domain user account or as the local system?
You need to make sure that the account that the SQL Server Agent is running
under has permissions to the file/directory.
Keith Kratochvil
"McA" <mikael.ahlberg@.gmail.com> wrote in message
news:1160055899.543735.146020@.i42g2000cwa.googlegroups.com...
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>|||Hello
It looks like the SQLSERVERAGENT runs with the Local System account.
So if I change the "Log On As" user to at user with rights to my file
I'll be OK?
I'll try that thanks..
Mikael|||McA wrote:
> Hello
> It looks like the SQLSERVERAGENT runs with the Local System account.
> So if I change the "Log On As" user to at user with rights to my file
> I'll be OK?
> I'll try that thanks..
> Mikael
>
There's more to consider than whether the user has rights to your file,
but yes, that's the solution to your problem. You need to read about
Service Accounts in Books Online before changing anything, to make sure
you understand the requirements.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Problems with SQL Server agent
I have som problems with a SQL Server agent job.
I have created a DTS package that extracts data from database and saves
the data to a csv file on the
network.
When I run the DTS package manually the file is created and all is OK.
But when I create a scheduled SQL Server agent job to run my DTS
package I get the following error message:
"Executed as user: SERVER\SYSTEM.
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
(80004005)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
Error Detail Records:
Error: 5 (5); Provider Error: 5 (5)
Error string: Error opening datafile: Access is denied.
Error source: Microsoft Data Transformation Services Flat File Rowset
Provider
Help file: DTSFFile.hlp
Help context: 0
DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
TSRun: Package execution complete. Process Exit Code 1. The step
failed."
I understand as much as the user running the job hasn't got access to
the file...
So.. how do I change the user that executes the job'
Thanks for your help.
MikaelMcA wrote:
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>
Are the SQL Server and SQL Agent services configured to run as "Local
System" or as a domain user? When you run the DTS package manually, it
runs using the permissions that your personal login has. When it runs
from a job, it uses the permissions that SQL Server has. To access
network resources, SQL must be running as a domain user, and that domain
user must have the necessary permissions to access the resource.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||Check the services application. Is the SQL Server Agent service running as
a domain user account or as the local system?
You need to make sure that the account that the SQL Server Agent is running
under has permissions to the file/directory.
--
Keith Kratochvil
"McA" <mikael.ahlberg@.gmail.com> wrote in message
news:1160055899.543735.146020@.i42g2000cwa.googlegroups.com...
> Hi,
> I have som problems with a SQL Server agent job.
> I have created a DTS package that extracts data from database and saves
> the data to a csv file on the
> network.
> When I run the DTS package manually the file is created and all is OK.
> But when I create a scheduled SQL Server agent job to run my DTS
> package I get the following error message:
> "Executed as user: SERVER\SYSTEM.
> DTSRun: Loading...
> DTSRun: Executing...
> DTSRun OnStart: DTSStep_DTSDataPumpTask_1
> DTSRun OnError: DTSStep_DTSDataPumpTask_1, Error = -2147467259
> (80004005)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> Error Detail Records:
> Error: 5 (5); Provider Error: 5 (5)
> Error string: Error opening datafile: Access is denied.
> Error source: Microsoft Data Transformation Services Flat File Rowset
> Provider
> Help file: DTSFFile.hlp
> Help context: 0
> DTSRun OnFinish: DTSStep_DTSDataPumpTask_1 D
> TSRun: Package execution complete. Process Exit Code 1. The step
> failed."
> I understand as much as the user running the job hasn't got access to
> the file...
> So.. how do I change the user that executes the job'
> Thanks for your help.
> Mikael
>|||Hello
It looks like the SQLSERVERAGENT runs with the Local System account.
So if I change the "Log On As" user to at user with rights to my file
I'll be OK?
I'll try that thanks..
Mikael|||McA wrote:
> Hello
> It looks like the SQLSERVERAGENT runs with the Local System account.
> So if I change the "Log On As" user to at user with rights to my file
> I'll be OK?
> I'll try that thanks..
> Mikael
>
There's more to consider than whether the user has rights to your file,
but yes, that's the solution to your problem. You need to read about
Service Accounts in Books Online before changing anything, to make sure
you understand the requirements.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Monday, March 26, 2012
Problems with SQL 2005 64bit sending emails
Whenever SQL agent is trying to send an email, it fails and I get this
error message in logs:
[264] An attempt was made to send an email when no email session has
been established
If I run the test email manually is working correctly. If I try to
send email using msdb.dbo.sp_send_dbmail is working correctly. If I
run manually a service intregation package that is sending the email is
running correctly.
But if I try to run a service integration package thats sending email
through a SQL Agent Job, then it fails with previous error message.
I have the same error when attempting to send a message on an alert with
SQLAgent, although test mails work fine. I found a reference to this on
Google Groups:
http://groups.google.com/group/micro...8aea3b8f3ac1f0
but no resolution...
"marian@.dumitrascu.net" <md@.dumitrascu.net> wrote in message
news:1143045307.345110.165550@.u72g2000cwu.googlegr oups.com...
> I have SQL 2005 on WS 2003 64 bit
> Whenever SQL agent is trying to send an email, it fails and I get this
> error message in logs:
> [264] An attempt was made to send an email when no email session has
> been established
> If I run the test email manually is working correctly. If I try to
> send email using msdb.dbo.sp_send_dbmail is working correctly. If I
> run manually a service intregation package that is sending the email is
> running correctly.
> But if I try to run a service integration package thats sending email
> through a SQL Agent Job, then it fails with previous error message.
>
|||Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
editions. See http://support.microsoft.com/kb/908360/en-us
I do wish they will fix this, but it does not look like it made it in
SP1.
Kevin
|||"Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
news:1143130284.972295.178130@.e56g2000cwe.googlegr oups.com...
> Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> editions. See http://support.microsoft.com/kb/908360/en-us
> I do wish they will fix this, but it does not look like it made it in
> SP1.
> Kevin
>
*sigh* All these little things that seem to be missing when you want to use
64-bit are most annoying. (Not just talking about SQL Server)
Problems with SQL 2005 64bit sending emails
Whenever SQL agent is trying to send an email, it fails and I get this
error message in logs:
[264] An attempt was made to send an email when no email session has
been established
If I run the test email manually is working correctly. If I try to
send email using msdb.dbo.sp_send_dbmail is working correctly. If I
run manually a service intregation package that is sending the email is
running correctly.
But if I try to run a service integration package thats sending email
through a SQL Agent Job, then it fails with previous error message.I have the same error when attempting to send a message on an alert with
SQLAgent, although test mails work fine. I found a reference to this on
Google Groups:
[url]http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thr
ead/de66aea413263523/c28aea3b8f3ac1f0?lnk=st&q=%22An+attempt+was+made+to+send+an+e
mail+when+no+email+session+has+been+esta
blished%22&rnum=1&hl=en#c28aea3b8f3ac1f0[/
url]
but no resolution...
"marian@.dumitrascu.net" <md@.dumitrascu.net> wrote in message
news:1143045307.345110.165550@.u72g2000cwu.googlegroups.com...
> I have SQL 2005 on WS 2003 64 bit
> Whenever SQL agent is trying to send an email, it fails and I get this
> error message in logs:
> [264] An attempt was made to send an email when no email session has
> been established
> If I run the test email manually is working correctly. If I try to
> send email using msdb.dbo.sp_send_dbmail is working correctly. If I
> run manually a service intregation package that is sending the email is
> running correctly.
> But if I try to run a service integration package thats sending email
> through a SQL Agent Job, then it fails with previous error message.
>|||Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
editions. See http://support.microsoft.com/kb/908360/en-us
I do wish they will fix this, but it does not look like it made it in
SP1.
Kevin|||"Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
> Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> editions. See http://support.microsoft.com/kb/908360/en-us
> I do wish they will fix this, but it does not look like it made it in
> SP1.
> Kevin
>
*sigh* All these little things that seem to be missing when you want to use
64-bit are most annoying. (Not just talking about SQL Server)|||Well now that SP1 is out, it appears to be working on x64!
"Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
> Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> editions. See http://support.microsoft.com/kb/908360/en-us
> I do wish they will fix this, but it does not look like it made it in
> SP1.
> Kevin
>|||You know, its weird I am on 64 bit too, the maintenance plans send email, db
mail is config properly and can send a test email, but all sql jobs I set up
cannot send any notification with the same error listed here -
--
John F.
"Michael D'Angelo" wrote:
> Well now that SP1 is out, it appears to be working on x64!
> "Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
> news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
>
>|||What do you mean working? We have sp1 and I haven't been able to get this to
work using database mail OR SQL Mail. The KB article is messed up b/c it say
s:
Note If this option is not available, enable SQL Server Agent Mail by using
the Surface Area Configuration tool, and then use the Surface Area
Configuration tool to set up a mail profile .
Well, there is nothing that I see called SQL Server Agent Mail in SAC (I'm
assuming that they mean SQL Mail). PLUS, there's nothing that I see in SAC
for setting up a mail profile (I think that this is done using Outlook
Express). It also doesn't tell you that you have to be logged on to the
server as the service account when setting up the mail profile (I'm pretty
sure that's true). Anyway, this article has too many things that might not b
e
exactly correct that I'm not sure if I'm missing something or if I have some
other problem.
Looking for help!
Michelle
"Michael D'Angelo" wrote:
> Well now that SP1 is out, it appears to be working on x64!
> "Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
> news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
>
>|||The article also neglects to mention that you have to restart the sql server
agent service after assigning the profile for it to use. That's what worked
for me for BOTH SQL Mail and Database Mail. So, I guess that was my problem
all along. BOL doesn't mention restarting the agent service in the How to:
Configure SQL Server Agent Mail to Use Database Mail. I don't think that I
had to restart the service on the 32-bit machine. Who knows...Anyway,
database mail DOES seem to work on 64-bit machines with Agent and sp1. That
KB Article really needs to be cleaned up, though.
"Michelle" wrote:
[vbcol=seagreen]
> What do you mean working? We have sp1 and I haven't been able to get this
to
> work using database mail OR SQL Mail. The KB article is messed up b/c it s
ays:
> Note If this option is not available, enable SQL Server Agent Mail by usin
g
> the Surface Area Configuration tool, and then use the Surface Area
> Configuration tool to set up a mail profile .
> Well, there is nothing that I see called SQL Server Agent Mail in SAC (I'm
> assuming that they mean SQL Mail). PLUS, there's nothing that I see in SAC
> for setting up a mail profile (I think that this is done using Outlook
> Express). It also doesn't tell you that you have to be logged on to the
> server as the service account when setting up the mail profile (I'm pretty
> sure that's true). Anyway, this article has too many things that might not
be
> exactly correct that I'm not sure if I'm missing something or if I have so
me
> other problem.
> Looking for help!
> Michelle
> "Michael D'Angelo" wrote:
>|||What do you mean working? We have sp1 and I haven't been able to get this to
work using database mail OR SQL Mail. The KB article is messed up b/c it say
s:
Note If this option is not available, enable SQL Server Agent Mail by using
the Surface Area Configuration tool, and then use the Surface Area
Configuration tool to set up a mail profile .
Well, there is nothing that I see called SQL Server Agent Mail in SAC (I'm
assuming that they mean SQL Mail). PLUS, there's nothing that I see in SAC
for setting up a mail profile (I think that this is done using Outlook
Express). It also doesn't tell you that you have to be logged on to the
server as the service account when setting up the mail profile (I'm pretty
sure that's true). Anyway, this article has too many things that might not b
e
exactly correct that I'm not sure if I'm missing something or if I have some
other problem.
Looking for help!
Michelle
"Michael D'Angelo" wrote:
> Well now that SP1 is out, it appears to be working on x64!
> "Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
> news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
>
>|||The article also neglects to mention that you have to restart the sql server
agent service after assigning the profile for it to use. That's what worked
for me for BOTH SQL Mail and Database Mail. So, I guess that was my problem
all along. BOL doesn't mention restarting the agent service in the How to:
Configure SQL Server Agent Mail to Use Database Mail. I don't think that I
had to restart the service on the 32-bit machine. Who knows...Anyway,
database mail DOES seem to work on 64-bit machines with Agent and sp1. That
KB Article really needs to be cleaned up, though.
"Michelle" wrote:
[vbcol=seagreen]
> What do you mean working? We have sp1 and I haven't been able to get this
to
> work using database mail OR SQL Mail. The KB article is messed up b/c it s
ays:
> Note If this option is not available, enable SQL Server Agent Mail by usin
g
> the Surface Area Configuration tool, and then use the Surface Area
> Configuration tool to set up a mail profile .
> Well, there is nothing that I see called SQL Server Agent Mail in SAC (I'm
> assuming that they mean SQL Mail). PLUS, there's nothing that I see in SAC
> for setting up a mail profile (I think that this is done using Outlook
> Express). It also doesn't tell you that you have to be logged on to the
> server as the service account when setting up the mail profile (I'm pretty
> sure that's true). Anyway, this article has too many things that might not
be
> exactly correct that I'm not sure if I'm missing something or if I have so
me
> other problem.
> Looking for help!
> Michelle
> "Michael D'Angelo" wrote:
>sql
Problems with SQL 2005 64bit sending emails
Whenever SQL agent is trying to send an email, it fails and I get this
error message in logs:
[264] An attempt was made to send an email when no email session has
been established
If I run the test email manually is working correctly. If I try to
send email using msdb.dbo.sp_send_dbmail is working correctly. If I
run manually a service intregation package that is sending the email is
running correctly.
But if I try to run a service integration package thats sending email
through a SQL Agent Job, then it fails with previous error message.I have the same error when attempting to send a message on an alert with
SQLAgent, although test mails work fine. I found a reference to this on
Google Groups:
http://groups.google.com/group/microsoft.public.sqlserver.server/browse_thread/thread/de66aea413263523/c28aea3b8f3ac1f0?lnk=st&q=%22An+attempt+was+made+to+send+an+email+when+no+email+session+has+been+established%22&rnum=1&hl=en#c28aea3b8f3ac1f0
but no resolution...
"marian@.dumitrascu.net" <md@.dumitrascu.net> wrote in message
news:1143045307.345110.165550@.u72g2000cwu.googlegroups.com...
> I have SQL 2005 on WS 2003 64 bit
> Whenever SQL agent is trying to send an email, it fails and I get this
> error message in logs:
> [264] An attempt was made to send an email when no email session has
> been established
> If I run the test email manually is working correctly. If I try to
> send email using msdb.dbo.sp_send_dbmail is working correctly. If I
> run manually a service intregation package that is sending the email is
> running correctly.
> But if I try to run a service integration package thats sending email
> through a SQL Agent Job, then it fails with previous error message.
>|||Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
editions. See http://support.microsoft.com/kb/908360/en-us
I do wish they will fix this, but it does not look like it made it in
SP1.
Kevin|||"Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
> Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> editions. See http://support.microsoft.com/kb/908360/en-us
> I do wish they will fix this, but it does not look like it made it in
> SP1.
> Kevin
>
*sigh* All these little things that seem to be missing when you want to use
64-bit are most annoying. (Not just talking about SQL Server)|||Well now that SP1 is out, it appears to be working on x64!
"Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
> Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> editions. See http://support.microsoft.com/kb/908360/en-us
> I do wish they will fix this, but it does not look like it made it in
> SP1.
> Kevin
>|||You know, its weird I am on 64 bit too, the maintenance plans send email, db
mail is config properly and can send a test email, but all sql jobs I set up
cannot send any notification with the same error listed here -
--
John F.
"Michael D'Angelo" wrote:
> Well now that SP1 is out, it appears to be working on x64!
> "Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
> news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
> > Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> > editions. See http://support.microsoft.com/kb/908360/en-us
> >
> > I do wish they will fix this, but it does not look like it made it in
> > SP1.
> >
> > Kevin
> >
>
>|||What do you mean working? We have sp1 and I haven't been able to get this to
work using database mail OR SQL Mail. The KB article is messed up b/c it says:
Note If this option is not available, enable SQL Server Agent Mail by using
the Surface Area Configuration tool, and then use the Surface Area
Configuration tool to set up a mail profile .
Well, there is nothing that I see called SQL Server Agent Mail in SAC (I'm
assuming that they mean SQL Mail). PLUS, there's nothing that I see in SAC
for setting up a mail profile (I think that this is done using Outlook
Express). It also doesn't tell you that you have to be logged on to the
server as the service account when setting up the mail profile (I'm pretty
sure that's true). Anyway, this article has too many things that might not be
exactly correct that I'm not sure if I'm missing something or if I have some
other problem.
Looking for help!
Michelle
"Michael D'Angelo" wrote:
> Well now that SP1 is out, it appears to be working on x64!
> "Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
> news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
> > Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> > editions. See http://support.microsoft.com/kb/908360/en-us
> >
> > I do wish they will fix this, but it does not look like it made it in
> > SP1.
> >
> > Kevin
> >
>
>|||The article also neglects to mention that you have to restart the sql server
agent service after assigning the profile for it to use. That's what worked
for me for BOTH SQL Mail and Database Mail. So, I guess that was my problem
all along. BOL doesn't mention restarting the agent service in the How to:
Configure SQL Server Agent Mail to Use Database Mail. I don't think that I
had to restart the service on the 32-bit machine. Who knows...Anyway,
database mail DOES seem to work on 64-bit machines with Agent and sp1. That
KB Article really needs to be cleaned up, though.
"Michelle" wrote:
> What do you mean working? We have sp1 and I haven't been able to get this to
> work using database mail OR SQL Mail. The KB article is messed up b/c it says:
> Note If this option is not available, enable SQL Server Agent Mail by using
> the Surface Area Configuration tool, and then use the Surface Area
> Configuration tool to set up a mail profile .
> Well, there is nothing that I see called SQL Server Agent Mail in SAC (I'm
> assuming that they mean SQL Mail). PLUS, there's nothing that I see in SAC
> for setting up a mail profile (I think that this is done using Outlook
> Express). It also doesn't tell you that you have to be logged on to the
> server as the service account when setting up the mail profile (I'm pretty
> sure that's true). Anyway, this article has too many things that might not be
> exactly correct that I'm not sure if I'm missing something or if I have some
> other problem.
> Looking for help!
> Michelle
> "Michael D'Angelo" wrote:
> > Well now that SP1 is out, it appears to be working on x64!
> >
> > "Kevin Madsen" <kevin.madsen@.gmail.com> wrote in message
> > news:1143130284.972295.178130@.e56g2000cwe.googlegroups.com...
> > > Unfortunately SQLAgent cannot use dbmail as an alerting option in x64
> > > editions. See http://support.microsoft.com/kb/908360/en-us
> > >
> > > I do wish they will fix this, but it does not look like it made it in
> > > SP1.
> > >
> > > Kevin
> > >
> >
> >
> >
Friday, March 23, 2012
Problems with replicating large batch inserts
I have transactional replication set up between 2 SQL Server 2005 databases on 2 different boxes. Both the log reader and distribution agent run in continuous mode. The distributor is residing on a third SQL Server box. We are having performance issues with replication when there are large batch deletes/inserts happening on the publisher. There is a batch job that runs for about 8-10 hours everyday on the publisher and deletes/inserts thousands of records as part of transactions. The amount of time to replicate all this data on the subscriber is around 13-15 hours which is not acceptable to our user community. While monitoring I found that the distribution database (MSRepl_commands table) at times has millions of records in it which would explain why the latency is so high. Add to it the fact that there are large transactions occuring on the publisher.
I was wondering if anyone has faced similar problem before. Are there any conifguration changes I can make to the replication infrastructure to reduce latency?
Would appreciate your help.
Thanks.
I wasn't sure if the large MSrepl_commands table is the root cause of your performance problem, but there are some parameters you can change to potentially reduce the size of this table. The parameters are @.max_disretention and @.history_retention of sp_adddistributiondb (you can change it use sp_chagnedistributiondb or through SQL Server Management Studio UI Distributor Property page). The default value is 72 and 48 hours each. Be careful when changing those parameters, your subscription may be deactivated if they haven't synced with publisher beyond the retention period. See SQL Server 2005 Books Online topic for sp_adddistributiondb for details.
If disk I/O is your problem, then you could probably change the location of distribution db to a different physical drive than publication db, that may give you some performance boost as well.
There are some parameters of logreader agent and distribution agent job may help you with replication performance, you can experiment with those parameters to see if they help. (see http://msdn2.microsoft.com/en-us/library/ms151223.aspx for details)
Thanks,
Zhiqiang Feng
|||
Do you know if the latency is higher for the logreader agent or the distribution agent? You can experimenet with tracer tokens to figure this out. But for now, let's assume distribution agent is the bottleneck. If this is the case, performance can be any one of these:
- if you have large transaction size, distribution agent will not start replication the transaction until it has completed. FOr example, if your transaction has an update statement that affects 1 million rows, until the transaction is completed, and until the logreader agent has completed replicating the last update, the distribution will not pick up those commands.
- With such high activity, could disk be a bottleneck at the distributor?
- WIth such large transaction size, distribution agent will apply the same large transaction to the subscriber. Could there be blocking at the subscriber? Could subscriber's tempdb be growing?
- Could you benefit from Distribution Agent's -SubscriptionStreams parameter?
- As Zhiqiang mentioned above, do you have too much history laying around?
- In the UI, the tab that shows the latency for logreader and distribution agent - it runs an expensive query to determine latency. Please use it carefully.
- Your batch processing, is it or can it be done inside of a stored procedure? If so, you could definitely benefit from replicating the execution of a stored procedure, have you considered this? THis saves space in the distribution database, and should improve performance.
- check distribution database to see if filegrowth is occurring.
Friday, March 9, 2012
Problems with executing ssis package by job
I have created ssis package and am trying to execute it using sql
server agent job.
The problem is, that the job failes to find or load the package. It
tries to run it from the server side and failes to find it. I don't
really understand how can I publish the package on the server from the
client side.
Thanks in advance.Qwert wrote:
> Hi All,
> I have created ssis package and am trying to execute it using sql
> server agent job.
> The problem is, that the job failes to find or load the package. It
> tries to run it from the server side and failes to find it. I don't
> really understand how can I publish the package on the server from the
> client side.
> Thanks in advance.
Hi
Have you saved your package in SQL Server ?
from file menu in Microsoft Visual Studio select Save copy of package
as and save your package in SQL Server.
or
Connect to intergation service in Management studio and import package.
Regards
Amish Shah
http://shahamishm.tripod.com
Regards
Amish Shah|||Qwert wrote:
> Hi All,
> I have created ssis package and am trying to execute it using sql
> server agent job.
> The problem is, that the job failes to find or load the package. It
> tries to run it from the server side and failes to find it. I don't
> really understand how can I publish the package on the server from the
> client side.
> Thanks in advance.
Hi
Have you saved your package in SQL Server ?
from file menu in Microsoft Visual Studio select Save copy of package
as and save your package in SQL Server.
or
Connect to intergation service in Management studio and import package.
Regards
Amish Shah
http://shahamishm.tripod.com
Regards
Amish Shah|||amish wrote:
> Hi
> Have you saved your package in SQL Server ?
> from file menu in Microsoft Visual Studio select Save copy of package
> as and save your package in SQL Server.
> or
> Connect to intergation service in Management studio and import package.
>
> Regards
> Amish Shah
> http://shahamishm.tripod.com
>
> Regards
> Amish Shah
Hi, thanks for replying,
Yes I tried both things, what I get is
Executed as user: CLUSTERNET\admin. The package could not be loaded.
The step failed.
Yours Qwert
Problems with DTS package. Access denied
I made a DTS-package and it works when I execute it manually, but when it is
run by the SQL Server Agent, it fails.
I have use the guide to create a maintenance plan. That doesn't work so good
either. It runs Optimizations, but not integrity checks or backups (probably
because integrity checks failed).
The following from the log file:
Executed as user: HT-DOMAIN\INTRAB-SQL. ...:
DTSStep_DTSExecuteSQLTask_2 DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_2
DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1 DTSRun OnFinish:
DTSStep_DTSExecuteSQLTask_1 DTSRun OnStart: DTSStep_DTSDataPumpTask_1
DTSRun OnStart: DTSStep_DTSDataPumpTask_3 DTSRun OnError:
DTSStep_DTSDataPumpTask_1,
Error = -2147024891 (80070005) Error string: Access is denied.
Error source: Microsoft Data Transformation Services (DTS) Package
Help file: sqldts80.hlp Help context: 1100 Error Detail Records:
Error: -2147024891 (80070005); Provider Error: 0 (0) Error string:
Access is denied. Error source: Microsoft Data Transformation
Services (DTS) Package Help file: sqldts80.hlp Help context:
1100 Error: -2147024891 (80070005); Provider Error: 0 (0)
Error string: Cannot open a log file of specified name. Access is denied.
Error source: Micr... Process Exit Code 1. The step failed.
Log-file endeth here....
My "data-sources"/Connections is set up to use sql-server
authentication where I enter superuser name+password, not windows
authentication.
If I browse around using SQL-EM:
Under Security - Logins HT-DOMAIN\intrab-sql:
Tab General: Grant Access
Tab Server Roles: System Administrators
Tab Database Access: checkmark at Mbestil, user=dbo; database roles
for mbestil = public + db_owner
I also have som problems identifying where the package fails. I have given
the individual "steps"/"transformations" some pretty good names, but in the
log-file it still shows the "old" names.
The DTS package empties a table, then fills it by copying data from another
table in another database on another server.
Anyone with some useful tips ?
/jimIn the services management you will find SQL Agent is
configured with a user account on the operating system.
What OS are you on?
This OS account needs the appropriate DB access that is
equivalent to yours when running interactively.
Once this is fixed, because SQL Agent handles the automated
tasks, your backups, reorganisations, maintenance plans,
DTS tasks and anything else you need to automate in
the environment should have no problems in running
unattended.
Hope this helps.
Pete Brown
Falls Creek
Oz
"Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
news:btdvco$1ad$1@.sunsite.dk...
> Hi,
> I made a DTS-package and it works when I execute it manually, but when it
is
> run by the SQL Server Agent, it fails.
> I have use the guide to create a maintenance plan. That doesn't work so
good
> either. It runs Optimizations, but not integrity checks or backups
(probably
> because integrity checks failed).
> The following from the log file:
...[trim]...
> Log-file endeth here....
> My "data-sources"/Connections is set up to use sql-server
> authentication where I enter superuser name+password, not windows
> authentication.
> If I browse around using SQL-EM:
> Under Security - Logins HT-DOMAIN\intrab-sql:
> Tab General: Grant Access
> Tab Server Roles: System Administrators
> Tab Database Access: checkmark at Mbestil, user=dbo; database roles
> for mbestil = public + db_owner
> I also have som problems identifying where the package fails. I have given
> the individual "steps"/"transformations" some pretty good names, but in
the
> log-file it still shows the "old" names.
> The DTS package empties a table, then fills it by copying data from
another
> table in another database on another server.
> Anyone with some useful tips ?
> /jim|||mountain man wrote:
> In the services management you will find SQL Agent is
> configured with a user account on the operating system.
Found it.
> What OS are you on?
Will check (not at problem site right now)
> This OS account needs the appropriate DB access that is
> equivalent to yours when running interactively.
Why ? I can understand it, when it comes to the backup, etc. But I have
supplied the name and password in the Connection properties in the DTS
package. And I _think_ (will have to check) that it actually empties the
table (first step in the package).
> Once this is fixed, because SQL Agent handles the automated
> tasks, your backups, reorganisations, maintenance plans,
> DTS tasks and anything else you need to automate in
> the environment should have no problems in running
> unattended.
I sure hope it has some kind of domino-effect :-)
> Hope this helps.
Me too. Will get back.
thx
Jim
> "Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
> news:btdvco$1ad$1@.sunsite.dk...
>> Hi,
>>
>> I made a DTS-package and it works when I execute it manually, but
>> when it is run by the SQL Server Agent, it fails.
>>
>> I have use the guide to create a maintenance plan. That doesn't work
>> so good either. It runs Optimizations, but not integrity checks or
>> backups (probably because integrity checks failed).
>>
>> The following from the log file:
> ...[trim]...
>> Log-file endeth here....
>>
>> My "data-sources"/Connections is set up to use sql-server
>> authentication where I enter superuser name+password, not windows
>> authentication.
>>
>> If I browse around using SQL-EM:
>> Under Security - Logins HT-DOMAIN\intrab-sql:
>> Tab General: Grant Access
>> Tab Server Roles: System Administrators
>> Tab Database Access: checkmark at Mbestil, user=dbo; database roles
>> for mbestil = public + db_owner
>>
>> I also have som problems identifying where the package fails. I have
>> given the individual "steps"/"transformations" some pretty good
>> names, but in the log-file it still shows the "old" names.
>>
>> The DTS package empties a table, then fills it by copying data from
>> another table in another database on another server.
>>
>> Anyone with some useful tips ?
>>
>> /jim|||"Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
news:btgjk3$r7u$1@.sunsite.dk...
> mountain man wrote:
> > This OS account needs the appropriate DB access that is
> > equivalent to yours when running interactively.
> Why ? I can understand it, when it comes to the backup, etc.
I believe all tasks run via SQL Agent will try to use the SQL Agent
user account nominated in the services detail.
> But I have
> supplied the name and password in the Connection properties in the DTS
> package. And I _think_ (will have to check) that it actually empties the
> table (first step in the package).
Also check the name of the owner (you, admin?) of the automated package.
The SQL Agent account needs to have equivalent access on the database end.
> > Hope this helps.
> Me too. Will get back.
Good luck with it Jim. Sometimes it is a little fiddly getting SQL Agent
up and running for the first time. Also, there have been a multitude of
threads in here in the past concerning this very issue.
So if the MS doco is not conducive to the solution, try an advance google
through the mssql newsgroups only, for the term "SQL Agent". If all else
fails write back.
Pete Brown
Falls Creek
Oz|||mountain man wrote:
> "Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
> news:btgjk3$r7u$1@.sunsite.dk...
>> mountain man wrote:
>>> This OS account needs the appropriate DB access that is
>>> equivalent to yours when running interactively.
>>
>> Why ? I can understand it, when it comes to the backup, etc.
> I believe all tasks run via SQL Agent will try to use the SQL Agent
> user account nominated in the services detail.
>> But I have
>> supplied the name and password in the Connection properties in the
>> DTS package. And I _think_ (will have to check) that it actually
>> empties the table (first step in the package).
> Also check the name of the owner (you, admin?) of the automated
> package. The SQL Agent account needs to have equivalent access on the
> database end.
User JIM is now system administrator equivalent on the server. I split the
package in 3 parts to avoid any misunderstandings about workflow. All
packages are owned by JIM
Pack1 copies data from a remote server table to local table X.
Pack2 massages data from local table X and copies it to another local table
Y.
Pack3 copies some other data from remote server to another local table.
And then 3 jobs in sql server agent, 1 minute apart (each task takes a
second or 2).
It is Pack2 that fails. "Error string: Cannot open a log file of specified
name. Access is denied."
What does that mean ?
All packages run fine when I execute them manually.
I would have expected it to be either pack1 or 3. But now I think I'm gonna
change pack3 so it reads AND massages data from the remote server table to
local table Y.
It just puzzles me...
/jim|||"Jim Andersen" <jimVK@.officeconsult.dk> wrote in message news:<bu5svi$s7t$1@.sunsite.dk>...
> mountain man wrote:
> > "Jim Andersen" <jimVK@.officeconsult.dk> wrote in message
> > news:btgjk3$r7u$1@.sunsite.dk...
> >> mountain man wrote:
> >>> This OS account needs the appropriate DB access that is
> >>> equivalent to yours when running interactively.
> >>
> >> Why ? I can understand it, when it comes to the backup, etc.
> > I believe all tasks run via SQL Agent will try to use the SQL Agent
> > user account nominated in the services detail.
> >> But I have
> >> supplied the name and password in the Connection properties in the
> >> DTS package. And I _think_ (will have to check) that it actually
> >> empties the table (first step in the package).
> > Also check the name of the owner (you, admin?) of the automated
> > package. The SQL Agent account needs to have equivalent access on the
> > database end.
> User JIM is now system administrator equivalent on the server. I split the
> package in 3 parts to avoid any misunderstandings about workflow. All
> packages are owned by JIM
> Pack1 copies data from a remote server table to local table X.
> Pack2 massages data from local table X and copies it to another local table
> Y.
> Pack3 copies some other data from remote server to another local table.
> And then 3 jobs in sql server agent, 1 minute apart (each task takes a
> second or 2).
> It is Pack2 that fails. "Error string: Cannot open a log file of specified
> name. Access is denied."
> What does that mean ?
> All packages run fine when I execute them manually.
> I would have expected it to be either pack1 or 3. But now I think I'm gonna
> change pack3 so it reads AND massages data from the remote server table to
> local table Y.
> It just puzzles me...
> /jim
You might find this KB article useful - it gives quite a lot of detail
on how scheduled DTS packages are executed, and which security
contexts are relevant:
http://support.microsoft.com/defaul...4&Product=sql2k
Simon