Showing posts with label job. Show all posts
Showing posts with label job. Show all posts

Friday, March 23, 2012

Problem in BACKUP job

Hi,
I am using a job to take daily backup.
BACKUP DATABASE databasenameTO DISK=N'path'
WITH INIT,NOUNLOAD,NAME=N'name',
NOSKIP,STATS=10,NOFORMAT
and it was working fine.
When I tried to restore the backup, I couldn't restore it, the backup was
uncompleted(I know this only when i tried to restore it). But in Enterprise
manager Last Run Status shows 'Succeeded'.
Is there any option to check whether the backup is in good condition or to
check the integrity of the backup immediately after the completion of
backup(through query without restoring the backup).
Thanks,
Soura
Please try using RESTORE VERIFYONLY on your dodgy backup file - it might be
sufficient in this case.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thank you Paul. It satisfies me.
Thanks,
Soura.
"Paul Ibison" wrote:

> Please try using RESTORE VERIFYONLY on your dodgy backup file - it might be
> sufficient in this case.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
>

Wednesday, March 21, 2012

Problem getting execution status of a SQL Agent Job

I’m having trouble retrieving the execution status of a job – perhaps someone can help me.

I have a stored proc (on SQL 2005) that dynamically creates and executes a SQL Agent Job. The stored proc first has to check whether the job exists. If it already exists and is not active then I simply reuse the existing job. However if the job exists but is currently executing then I need to create a new job because there can be multiple instances of the program that the job runs. My problem is how to check whether the job is currently executing. I tried using sp_help_job as shown below but the rowcount seems to return 1 even when there are no jobs executing!

Exec msdb.dbo.sp_help_job

@.job_aspect = 'JOB',

@.execution_status = 0,

@.job_name = @.JobName

If @.@.rowcount > 0 Begin

End

I then tried this code…

If (select count(*) from msdb.dbo.sysjobs j

left outer join msdb.dbo.sysjobhistory h on j.job_id = h.job_id where name = @.JobName and

h.step_id = 1 and

run_status = 4) > 0

Begin

End

… but it doesn’t seem to pick up records even when the job is currently executing.

How can I, in T-SQL, get the execution status of the job?

I have the same issue. When I began to dig into sp_help_job, I noticed a call within the procedure to build a temp table:

exec master.dbo.xp_sqlagent_enum_jobs 1, {insert job owner here}

This procedure outputs a 'Running' field that will return a 1 if it the job is running, or otherwise a 0. This is not complete code for you, but should get you pointed in the right direction. I am going to build a temp table with this XP and filter on the job ID to return the status.

|||sp_help_jobactivity is the sp that should give status of jobs in SQL2005. See BOL for more info on this SP.sql

Wednesday, March 7, 2012

Problem creating Job from tsql

I'm attempting to create a job on a client's server using tsql over a VPN.
* I've created this procedure before using the same tsql and VPN
* The same tsql works presently on my server
* I'm not having any other problems on the server
* We're using NT auth, and my userid is sa
When I try to create a job from query analyzer, I get:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (se
nd()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
Any ideas?
Thanks!
GregSeems that 'sp_add_jobstep' is generating the error. Anyone have a similar
experience?
--
Greg C
"Greg C" <uce@.ftc.com> wrote in message news:QAxoc.88432$Dn1.44627@.fe2.texas
.rr.com...
I'm attempting to create a job on a client's server using tsql over a VPN.
* I've created this procedure before using the same tsql and VPN
* The same tsql works presently on my server
* I'm not having any other problems on the server
* We're using NT auth, and my userid is sa
When I try to create a job from query analyzer, I get:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (se
nd()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
Any ideas?
Thanks!
Greg

Problem creating Job from tsql

I'm attempting to create a job on a client's server using tsql over a VPN.
* I've created this procedure before using the same tsql and VPN
* The same tsql works presently on my server
* I'm not having any other problems on the server
* We're using NT auth, and my userid is sa
When I try to create a job from query analyzer, I get:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
Any ideas?
Thanks!
Greg
Seems that 'sp_add_jobstep' is generating the error. Anyone have a similar experience?
Greg C
"Greg C" <uce@.ftc.com> wrote in message news:QAxoc.88432$Dn1.44627@.fe2.texas.rr.com...
I'm attempting to create a job on a client's server using tsql over a VPN.
* I've created this procedure before using the same tsql and VPN
* The same tsql works presently on my server
* I'm not having any other problems on the server
* We're using NT auth, and my userid is sa
When I try to create a job from query analyzer, I get:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
Any ideas?
Thanks!
Greg

Problem creating Job from tsql

This is a multi-part message in MIME format.
--=_NextPart_000_008B_01C43846.EBF4ED60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I'm attempting to create a job on a client's server using tsql over a = VPN.
* I've created this procedure before using the same tsql and VPN
* The same tsql works presently on my server
* I'm not having any other problems on the server
* We're using NT auth, and my userid is sa
When I try to create a job from query analyzer, I get:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite = (send()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
Any ideas?
Thanks!
Greg
--=_NextPart_000_008B_01C43846.EBF4ED60
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

I'm attempting to create a job on a client's = server using tsql over a VPN.

* I've created this procedure before using the same = tsql and VPN
* The same tsql works presently on my = server
* I'm not having any other problems on the = server
* We're using NT auth, and my userid is = sa

When I try to create a job from query analyzer, I get:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()). Server: = Msg 11, Level 16, State 1, Line 0 General network error. = Check your network documentation.

Connection Broken

Any ideas?

Thanks!
Greg
--=_NextPart_000_008B_01C43846.EBF4ED60--This is a multi-part message in MIME format.
--=_NextPart_000_000D_01C438DD.3B28E440
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Seems that 'sp_add_jobstep' is generating the error. Anyone have a =similar experience?
--
Greg C
"Greg C" <uce@.ftc.com> wrote in message =news:QAxoc.88432$Dn1.44627@.fe2.texas.rr.com...
I'm attempting to create a job on a client's server using tsql over a =VPN.
* I've created this procedure before using the same tsql and VPN
* The same tsql works presently on my server
* I'm not having any other problems on the server
* We're using NT auth, and my userid is sa
When I try to create a job from query analyzer, I get:
[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite =(send()).
Server: Msg 11, Level 16, State 1, Line 0
General network error. Check your network documentation.
Connection Broken
Any ideas?
Thanks!
Greg
--=_NextPart_000_000D_01C438DD.3B28E440
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&

Seems that 'sp_add_jobstep' is generating the =error. Anyone have a similar experience?
-- Greg C
"Greg C" =wrote in message news:QAxoc.88432$Dn1=.44627@.fe2.texas.rr.com...

I'm attempting to create a job on a client's =server using tsql over a VPN.

* I've created this procedure before using the =same tsql and VPN
* The same tsql works presently on my =server
* I'm not having any other problems on the server
* We're using NT auth, and my userid is =sa

When I try to create a job from query analyzer, I get:

[Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send()). =Server: Msg 11, Level 16, State 1, Line 0 General network =error. Check your network documentation.

Connection Broken

Any ideas?

Thanks!
Greg

--=_NextPart_000_000D_01C438DD.3B28E440--

Problem Creating Job and Running The JOb

Hello All,
I am having problem with my SQL Server 2000. I don't know this
is best place to put this question but i don't have any other way. I have sql
server with service pack 4 installed on it. I create a simple DTS package and
then Try to schedule it which will automatically create a Job. When i try to
run this job. It failed with the following error.
"The system cannot find the file specified"
Please any help .......................
Does the job work when you run it manually?
Do you run it on your computer or the server when run manually.
Is it using any files that reside on the hard drive?
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
> Hello All,
> I am having problem with my SQL Server 2000. I don't know
> this
> is best place to put this question but i don't have any other way. I have
> sql
> server with service pack 4 installed on it. I create a simple DTS package
> and
> then Try to schedule it which will automatically create a Job. When i try
> to
> run this job. It failed with the following error.
> "The system cannot find the file specified"
> Please any help .......................
|||Hi,
Thanks for quick reply. I run it manually and it fail. With the same
error. The dts is simple select statement. And i run it. it works fine.
Another information which i think is usefull:
When i try to run DTSRUN command from command prompt it will say Unknown
command. Which means it is the problem of installation.
I run the Installation file again and fix the registry but the problem is
still there.
I run again the service pack 4 but not help full
Thanks in advance......
"Nik Marshall-Blank" wrote:

> Does the job work when you run it manually?
> Do you run it on your computer or the server when run manually.
> Is it using any files that reside on the hard drive?
> --
> Nik Marshall-Blank MCSD/MCDBA
> Linz, Austria
> "Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
> news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
>
>
|||If the installation is corrupted then applying SP4 will not fix it. You may
have to ununstall and re-install. If you do this take a backup of your user
databases or detach them first and copy them to another folder. You can copy
them back and restore/attach after re-installing.
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"Faisal Mirza" <FaisalMirza@.discussions.microsoft.com> wrote in message
news:18C9C988-5F88-4C58-900D-3E69C4E7104A@.microsoft.com...[vbcol=seagreen]
> Hi,
> Thanks for quick reply. I run it manually and it fail. With the same
> error. The dts is simple select statement. And i run it. it works fine.
> Another information which i think is usefull:
> When i try to run DTSRUN command from command prompt it will say Unknown
> command. Which means it is the problem of installation.
> I run the Installation file again and fix the registry but the problem is
> still there.
> I run again the service pack 4 but not help full
> Thanks in advance......
> "Nik Marshall-Blank" wrote:
|||Hi Faisal,
Do sql Agent is runing.
Is sql agent running under local system user account
Can u manually create a job.
HTH
from
Doller
Faisal Mirza wrote:[vbcol=seagreen]
> Hi,
> Thanks for quick reply. I run it manually and it fail. With the same
> error. The dts is simple select statement. And i run it. it works fine.
> Another information which i think is usefull:
> When i try to run DTSRUN command from command prompt it will say Unknown
> command. Which means it is the problem of installation.
> I run the Installation file again and fix the registry but the problem is
> still there.
> I run again the service pack 4 but not help full
> Thanks in advance......
> "Nik Marshall-Blank" wrote:

Problem Creating Job and Running The JOb

Hello All,
I am having problem with my SQL Server 2000. I don't know this
is best place to put this question but i don't have any other way. I have sq
l
server with service pack 4 installed on it. I create a simple DTS package an
d
then Try to schedule it which will automatically create a Job. When i try to
run this job. It failed with the following error.
"The system cannot find the file specified"
Please any help .......................Does the job work when you run it manually?
Do you run it on your computer or the server when run manually.
Is it using any files that reside on the hard drive?
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
> Hello All,
> I am having problem with my SQL Server 2000. I don't know
> this
> is best place to put this question but i don't have any other way. I have
> sql
> server with service pack 4 installed on it. I create a simple DTS package
> and
> then Try to schedule it which will automatically create a Job. When i try
> to
> run this job. It failed with the following error.
> "The system cannot find the file specified"
> Please any help .......................|||Hi,
Thanks for quick reply. I run it manually and it fail. With the same
error. The dts is simple select statement. And i run it. it works fine.
Another information which i think is usefull:
When i try to run DTSRUN command from command prompt it will say Unknown
command. Which means it is the problem of installation.
I run the Installation file again and fix the registry but the problem is
still there.
I run again the service pack 4 but not help full
Thanks in advance......
"Nik Marshall-Blank" wrote:

> Does the job work when you run it manually?
> Do you run it on your computer or the server when run manually.
> Is it using any files that reside on the hard drive?
> --
> Nik Marshall-Blank MCSD/MCDBA
> Linz, Austria
> "Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
> news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
>
>|||If the installation is corrupted then applying SP4 will not fix it. You may
have to ununstall and re-install. If you do this take a backup of your user
databases or detach them first and copy them to another folder. You can copy
them back and restore/attach after re-installing.
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"Faisal Mirza" <FaisalMirza@.discussions.microsoft.com> wrote in message
news:18C9C988-5F88-4C58-900D-3E69C4E7104A@.microsoft.com...[vbcol=seagreen]
> Hi,
> Thanks for quick reply. I run it manually and it fail. With the same
> error. The dts is simple select statement. And i run it. it works fine.
> Another information which i think is usefull:
> When i try to run DTSRUN command from command prompt it will say Unknown
> command. Which means it is the problem of installation.
> I run the Installation file again and fix the registry but the problem is
> still there.
> I run again the service pack 4 but not help full
> Thanks in advance......
> "Nik Marshall-Blank" wrote:
>|||Hi Faisal,
Do sql Agent is runing.
Is sql agent running under local system user account
Can u manually create a job.
HTH
from
Doller
Faisal Mirza wrote:[vbcol=seagreen]
> Hi,
> Thanks for quick reply. I run it manually and it fail. With the same
> error. The dts is simple select statement. And i run it. it works fine.
> Another information which i think is usefull:
> When i try to run DTSRUN command from command prompt it will say Unknown
> command. Which means it is the problem of installation.
> I run the Installation file again and fix the registry but the problem is
> still there.
> I run again the service pack 4 but not help full
> Thanks in advance......
> "Nik Marshall-Blank" wrote:
>

Problem Creating Job and Running The JOb

Hello All,
I am having problem with my SQL Server 2000. I don't know this
is best place to put this question but i don't have any other way. I have sql
server with service pack 4 installed on it. I create a simple DTS package and
then Try to schedule it which will automatically create a Job. When i try to
run this job. It failed with the following error.
"The system cannot find the file specified"
Please any help .......................Does the job work when you run it manually?
Do you run it on your computer or the server when run manually.
Is it using any files that reside on the hard drive?
--
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
> Hello All,
> I am having problem with my SQL Server 2000. I don't know
> this
> is best place to put this question but i don't have any other way. I have
> sql
> server with service pack 4 installed on it. I create a simple DTS package
> and
> then Try to schedule it which will automatically create a Job. When i try
> to
> run this job. It failed with the following error.
> "The system cannot find the file specified"
> Please any help .......................|||Hi,
Thanks for quick reply. I run it manually and it fail. With the same
error. The dts is simple select statement. And i run it. it works fine.
Another information which i think is usefull:
When i try to run DTSRUN command from command prompt it will say Unknown
command. Which means it is the problem of installation.
I run the Installation file again and fix the registry but the problem is
still there.
I run again the service pack 4 but not help full
Thanks in advance......
"Nik Marshall-Blank" wrote:
> Does the job work when you run it manually?
> Do you run it on your computer or the server when run manually.
> Is it using any files that reside on the hard drive?
> --
> Nik Marshall-Blank MCSD/MCDBA
> Linz, Austria
> "Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
> news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
> > Hello All,
> > I am having problem with my SQL Server 2000. I don't know
> > this
> > is best place to put this question but i don't have any other way. I have
> > sql
> > server with service pack 4 installed on it. I create a simple DTS package
> > and
> > then Try to schedule it which will automatically create a Job. When i try
> > to
> > run this job. It failed with the following error.
> > "The system cannot find the file specified"
> >
> > Please any help .......................
>
>|||If the installation is corrupted then applying SP4 will not fix it. You may
have to ununstall and re-install. If you do this take a backup of your user
databases or detach them first and copy them to another folder. You can copy
them back and restore/attach after re-installing.
--
Nik Marshall-Blank MCSD/MCDBA
Linz, Austria
"Faisal Mirza" <FaisalMirza@.discussions.microsoft.com> wrote in message
news:18C9C988-5F88-4C58-900D-3E69C4E7104A@.microsoft.com...
> Hi,
> Thanks for quick reply. I run it manually and it fail. With the same
> error. The dts is simple select statement. And i run it. it works fine.
> Another information which i think is usefull:
> When i try to run DTSRUN command from command prompt it will say Unknown
> command. Which means it is the problem of installation.
> I run the Installation file again and fix the registry but the problem is
> still there.
> I run again the service pack 4 but not help full
> Thanks in advance......
> "Nik Marshall-Blank" wrote:
>> Does the job work when you run it manually?
>> Do you run it on your computer or the server when run manually.
>> Is it using any files that reside on the hard drive?
>> --
>> Nik Marshall-Blank MCSD/MCDBA
>> Linz, Austria
>> "Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
>> news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
>> > Hello All,
>> > I am having problem with my SQL Server 2000. I don't know
>> > this
>> > is best place to put this question but i don't have any other way. I
>> > have
>> > sql
>> > server with service pack 4 installed on it. I create a simple DTS
>> > package
>> > and
>> > then Try to schedule it which will automatically create a Job. When i
>> > try
>> > to
>> > run this job. It failed with the following error.
>> > "The system cannot find the file specified"
>> >
>> > Please any help .......................
>>|||Hi Faisal,
Do sql Agent is runing.
Is sql agent running under local system user account
Can u manually create a job.
HTH
from
Doller
Faisal Mirza wrote:
> Hi,
> Thanks for quick reply. I run it manually and it fail. With the same
> error. The dts is simple select statement. And i run it. it works fine.
> Another information which i think is usefull:
> When i try to run DTSRUN command from command prompt it will say Unknown
> command. Which means it is the problem of installation.
> I run the Installation file again and fix the registry but the problem is
> still there.
> I run again the service pack 4 but not help full
> Thanks in advance......
> "Nik Marshall-Blank" wrote:
> > Does the job work when you run it manually?
> > Do you run it on your computer or the server when run manually.
> > Is it using any files that reside on the hard drive?
> >
> > --
> > Nik Marshall-Blank MCSD/MCDBA
> > Linz, Austria
> >
> > "Faisal Mirza" <Faisal Mirza@.discussions.microsoft.com> wrote in message
> > news:C2CCB594-B819-4E2C-BED3-4514D54AD102@.microsoft.com...
> > > Hello All,
> > > I am having problem with my SQL Server 2000. I don't know
> > > this
> > > is best place to put this question but i don't have any other way. I have
> > > sql
> > > server with service pack 4 installed on it. I create a simple DTS package
> > > and
> > > then Try to schedule it which will automatically create a Job. When i try
> > > to
> > > run this job. It failed with the following error.
> > > "The system cannot find the file specified"
> > >
> > > Please any help .......................
> >
> >
> >

Saturday, February 25, 2012

Problem creating a job step to execute a SSIS package

Hello all,

I am having a problem creating a job step that will run a SSIS package. I go to add a job step (or edit an existing one), but when I select 'SQL Server Integration Services Package' as the type, an error box pops up with the following message:

The specified module could not be found. (Exception from HRESULT: 0x8007007E) (SqlManagerUI)

After I hit OK, it goes back to the 'New Job Step' window and makes me select a different step type.

I am running on a Win2000 Advanced Server with SP4, a default instance of SQL2000 with SP4, and a named instance of SQL2005.

Does anyone know what is wrong or of a workaround?

Thanks in advance for any and all help/comments.

Jarret

You should probably post to the agent forum since this is an agent problem not an SSIS problem.

Thanks,
Matt

Problem creating a job step to execute a SSIS package

Hello all,

I am having a problem creating a job step that will run a SSIS package. I go to add a job step (or edit an existing one), but when I select 'SQL Server Integration Services Package' as the type, an error box pops up with the following message:

The specified module could not be found. (Exception from HRESULT: 0x8007007E) (SqlManagerUI)

After I hit OK, it goes back to the 'New Job Step' window and makes me select a different step type.

I am running on a Win2000 Advanced Server with SP4, a default instance of SQL2000 with SP4, and a named instance of SQL2005.

Does anyone know what is wrong or of a workaround?

Thanks in advance for any and all help/comments.

Jarret

Whatever the problem was, restarting the server fixed it. I hadn't restarted the server since I installed SQL2005, because the install didn't require a reboot. I had a chance to do so over the weekend and when I checked on this problem, it was gone.

All is good now.

Thanks!

Jarret