Showing posts with label backup. Show all posts
Showing posts with label backup. Show all posts

Friday, March 30, 2012

JOBS

Hi All,
I am currently running a job that backs up a database using
the following code
BACKUP DATABASE [Leads] TO DISK = N'\\mymachine\d$\backup\leads.bak' WITH INIT , NOUNLOAD ,
NAME = N'Leads backup2', SKIP , STATS = 10, noFORMAT
this most of the time works fine but every now and again it
complete's fine but keeps the database locked open, is
there any way to fix this'
Thanks PhilWhat exactly do you mean by "Locked Open"?
--
Andrew J. Kelly SQL MVP
"Phil" <harlequintp@.blazemail.com> wrote in message
news:051801c3fabf$38fedc30$a101280a@.phx.gbl...
> Hi All,
> I am currently running a job that backs up a database using
> the following code
> BACKUP DATABASE [Leads] TO DISK => N'\\mymachine\d$\backup\leads.bak' WITH INIT , NOUNLOAD ,
> NAME = N'Leads backup2', SKIP , STATS = 10, noFORMAT
> this most of the time works fine but every now and again it
> complete's fine but keeps the database locked open, is
> there any way to fix this'
> Thanks Phil|||Sorry I should of been a little clearer, what I mean is
although the job says that it has completed, if you look
at the locks section in the SQL Enterprise Window, you
can still see a lock on the database showing the code
featured below.
Thanks again for your help!
Phil
>--Original Message--
>What exactly do you mean by "Locked Open"?
>--
>Andrew J. Kelly SQL MVP
>
>"Phil" <harlequintp@.blazemail.com> wrote in message
>news:051801c3fabf$38fedc30$a101280a@.phx.gbl...
>> Hi All,
>> I am currently running a job that backs up a database
using
>> the following code
>> BACKUP DATABASE [Leads] TO DISK =>> N'\\mymachine\d$\backup\leads.bak' WITH INIT ,
NOUNLOAD ,
>> NAME = N'Leads backup2', SKIP , STATS = 10,
noFORMAT
>> this most of the time works fine but every now and
again it
>> complete's fine but keeps the database locked open, is
>> there any way to fix this'
>> Thanks Phil
>
>.
>|||You have to be even clear than that<g>. What type of lock does it have?
Are these locks causing problems? It is normal for any connection to a db
to have at least a shared lock on the db. You also have to refresh EM in
order for most of the windows to show up to date information.
--
Andrew J. Kelly SQL MVP
<anonymous@.discussions.microsoft.com> wrote in message
news:0bd801c3fb1f$b4c51a40$a401280a@.phx.gbl...
> Sorry I should of been a little clearer, what I mean is
> although the job says that it has completed, if you look
> at the locks section in the SQL Enterprise Window, you
> can still see a lock on the database showing the code
> featured below.
> Thanks again for your help!
> Phil
> >--Original Message--
> >What exactly do you mean by "Locked Open"?
> >
> >--
> >Andrew J. Kelly SQL MVP
> >
> >
> >"Phil" <harlequintp@.blazemail.com> wrote in message
> >news:051801c3fabf$38fedc30$a101280a@.phx.gbl...
> >> Hi All,
> >>
> >> I am currently running a job that backs up a database
> using
> >> the following code
> >>
> >> BACKUP DATABASE [Leads] TO DISK => >> N'\\mymachine\d$\backup\leads.bak' WITH INIT ,
> NOUNLOAD ,
> >> NAME = N'Leads backup2', SKIP , STATS = 10,
> noFORMAT
> >>
> >> this most of the time works fine but every now and
> again it
> >> complete's fine but keeps the database locked open, is
> >> there any way to fix this'
> >>
> >> Thanks Phil
> >
> >
> >.
> >sql

job to run a remote process

I have a question regard the scheduling of a database job. I want to run a job that executes the following steps:

1) backup an entire database from DB server A

2) restore the database on DB Sever B

3) run a non database process on Server C (with xp_cmdshell)

Step 1 and 2 are easy enough but how do I start a process on an remote machine (Step 3)?

In my case the process in step 3 is will execute a Cognos DecisionStream job (rundsjob.exe)

My environment is

SQL Server 2000.

Windows Server 2003

Paul

If you are trying to do something like run a batch file remotely, you may want to look at WMIC.

Prior to Windows 2003, you'd use RCMD. This link might help you get started:

http://www.microsoft.com/technet/prodtechnol/windows2000serv/maintain/featusability/wmic.mspx

-Sue

job to delete the old baks

How do I write a job to delete the old backup files. I do not want to use
Maintenance plan. I would like to write a sql job to perform this activity.
Is there any procedure for this
ThanksHi,
Have a look into the old post:-
http://groups.google.co.in/group/microsoft.public.sqlserver.server/browse_thread/thread/49bf865107573571/93d87002b75a5a0f?q=sql+server+script+to+delete+old+backup+files&rnum=6&hl=en#93d87002b75a5a0f
Thanks
Hari
SQL Server MVP
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:256D7D14-D04F-4195-A065-CA920A1F9AC6@.microsoft.com...
> How do I write a job to delete the old backup files. I do not want to use
> Maintenance plan. I would like to write a sql job to perform this
> activity.
> Is there any procedure for this
> Thanks

job to delete the old baks

How do I write a job to delete the old backup files. I do not want to use
Maintenance plan. I would like to write a sql job to perform this activity.
Is there any procedure for this
ThanksHi,
Have a look into the old post:-
http://groups.google.co.in/group/mi...3d87002b75a5a0f
Thanks
Hari
SQL Server MVP
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:256D7D14-D04F-4195-A065-CA920A1F9AC6@.microsoft.com...
> How do I write a job to delete the old backup files. I do not want to use
> Maintenance plan. I would like to write a sql job to perform this
> activity.
> Is there any procedure for this
> Thanks

job to delete the old baks

How do I write a job to delete the old backup files. I do not want to use
Maintenance plan. I would like to write a sql job to perform this activity.
Is there any procedure for this
Thanks
Hi,
Have a look into the old post:-
http://groups.google.co.in/group/mic...d87002b75a5a0f
Thanks
Hari
SQL Server MVP
"Pari" <Pari@.discussions.microsoft.com> wrote in message
news:256D7D14-D04F-4195-A065-CA920A1F9AC6@.microsoft.com...
> How do I write a job to delete the old backup files. I do not want to use
> Maintenance plan. I would like to write a sql job to perform this
> activity.
> Is there any procedure for this
> Thanks

Job to Backup Log when Full

We have several servers with dozens of databases on each one. We have
elected to group our maintenance jobs so that all database backups are
consolidated into 4 separate jobs (alphabetically). We would like to backup
a log using our standard practices if it gets full. We don't want to call
the 'consolidated' job because if the db is the last alphabetically, it will
have to go through all of the preceeding dbs before it gets to that log. By
that time, I could have gotten up out of bed and backed up the log myself
We would like to be able to read the database name that triggered the alert
and have a job that backs up that log only. Where would I get that database
name? The alert has it, does it store it in a system table in msdb?
Thanks!
There is a group of Alert tokens that you can use...
For instance, you could create a job that has one step
Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
When the job is called from an Alert, the token will be replaced (even in
the filename string... and the appropriate database log will be backed up...
But the job can not be run< except from an alert> , because that is the only
time the tokens will be replaced..
For a complete list of Alert tokens, go to Gert Drapers web site
http://www.sqldev.net/sqlagent/SQLAg...ns.htm#Example using TSQL
step
"Michelle" <michelle@.nospam.com> wrote in message
news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> We have several servers with dozens of databases on each one. We have
> elected to group our maintenance jobs so that all database backups are
> consolidated into 4 separate jobs (alphabetically). We would like to
backup
> a log using our standard practices if it gets full. We don't want to call
> the 'consolidated' job because if the db is the last alphabetically, it
will
> have to go through all of the preceeding dbs before it gets to that log.
By
> that time, I could have gotten up out of bed and backed up the log myself

> We would like to be able to read the database name that triggered the
alert
> and have a job that backs up that log only. Where would I get that
database
> name? The alert has it, does it store it in a system table in msdb?
> Thanks!
>
|||This is awesome. I set it up to test and am quite eager to deploy it to
production. Thank you very much.
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:eSpn43UIEHA.2744@.TK2MSFTNGP10.phx.gbl...
> There is a group of Alert tokens that you can use...
> For instance, you could create a job that has one step
> Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
> When the job is called from an Alert, the token will be replaced (even in
> the filename string... and the appropriate database log will be backed
up...
> But the job can not be run< except from an alert> , because that is the
only[color=darkblue]
> time the tokens will be replaced..
> For a complete list of Alert tokens, go to Gert Drapers web site
> http://www.sqldev.net/sqlagent/SQLAg...ns.htm#Example using TSQL
> step
>
> "Michelle" <michelle@.nospam.com> wrote in message
> news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> backup
call[color=darkblue]
> will
> By
myself
>
> alert
> database
>

Job to Backup Log when Full

We have several servers with dozens of databases on each one. We have
elected to group our maintenance jobs so that all database backups are
consolidated into 4 separate jobs (alphabetically). We would like to backup
a log using our standard practices if it gets full. We don't want to call
the 'consolidated' job because if the db is the last alphabetically, it will
have to go through all of the preceeding dbs before it gets to that log. By
that time, I could have gotten up out of bed and backed up the log myself
We would like to be able to read the database name that triggered the alert
and have a job that backs up that log only. Where would I get that database
name? The alert has it, does it store it in a system table in msdb?
Thanks!There is a group of Alert tokens that you can use...
For instance, you could create a job that has one step
Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
When the job is called from an Alert, the token will be replaced (even in
the filename string... and the appropriate database log will be backed up...
But the job can not be run< except from an alert> , because that is the only
time the tokens will be replaced..
For a complete list of Alert tokens, go to Gert Drapers web site
http://www.sqldev.net/sqlagent/SQLA...ens.htm#Example using TSQL
step
"Michelle" <michelle@.nospam.com> wrote in message
news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> We have several servers with dozens of databases on each one. We have
> elected to group our maintenance jobs so that all database backups are
> consolidated into 4 separate jobs (alphabetically). We would like to
backup
> a log using our standard practices if it gets full. We don't want to call
> the 'consolidated' job because if the db is the last alphabetically, it
will
> have to go through all of the preceeding dbs before it gets to that log.
By
> that time, I could have gotten up out of bed and backed up the log myself

> We would like to be able to read the database name that triggered the
alert
> and have a job that backs up that log only. Where would I get that
database
> name? The alert has it, does it store it in a system table in msdb?
> Thanks!
>|||This is awesome. I set it up to test and am quite eager to deploy it to
production. Thank you very much.
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:eSpn43UIEHA.2744@.TK2MSFTNGP10.phx.gbl...
> There is a group of Alert tokens that you can use...
> For instance, you could create a job that has one step
> Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
> When the job is called from an Alert, the token will be replaced (even in
> the filename string... and the appropriate database log will be backed
up...
> But the job can not be run< except from an alert> , because that is the
only
> time the tokens will be replaced..
> For a complete list of Alert tokens, go to Gert Drapers web site
> http://www.sqldev.net/sqlagent/SQLA...ens.htm#Example using TSQL
> step
>
> "Michelle" <michelle@.nospam.com> wrote in message
> news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> backup
call
> will
> By
myself
>
> alert
> database
>

Job to Backup Log when Full

We have several servers with dozens of databases on each one. We have
elected to group our maintenance jobs so that all database backups are
consolidated into 4 separate jobs (alphabetically). We would like to backup
a log using our standard practices if it gets full. We don't want to call
the 'consolidated' job because if the db is the last alphabetically, it will
have to go through all of the preceeding dbs before it gets to that log. By
that time, I could have gotten up out of bed and backed up the log myself :)
We would like to be able to read the database name that triggered the alert
and have a job that backs up that log only. Where would I get that database
name? The alert has it, does it store it in a system table in msdb?
Thanks!There is a group of Alert tokens that you can use...
For instance, you could create a job that has one step
Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
When the job is called from an Alert, the token will be replaced (even in
the filename string... and the appropriate database log will be backed up...
But the job can not be run< except from an alert> , because that is the only
time the tokens will be replaced..
For a complete list of Alert tokens, go to Gert Drapers web site
http://www.sqldev.net/sqlagent/SQLAgentStepTokens.htm#Example using TSQL
step
"Michelle" <michelle@.nospam.com> wrote in message
news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> We have several servers with dozens of databases on each one. We have
> elected to group our maintenance jobs so that all database backups are
> consolidated into 4 separate jobs (alphabetically). We would like to
backup
> a log using our standard practices if it gets full. We don't want to call
> the 'consolidated' job because if the db is the last alphabetically, it
will
> have to go through all of the preceeding dbs before it gets to that log.
By
> that time, I could have gotten up out of bed and backed up the log myself
:)
> We would like to be able to read the database name that triggered the
alert
> and have a job that backs up that log only. Where would I get that
database
> name? The alert has it, does it store it in a system table in msdb?
> Thanks!
>|||This is awesome. I set it up to test and am quite eager to deploy it to
production. Thank you very much.
"Wayne Snyder" <wsnyder@.computeredservices.com> wrote in message
news:eSpn43UIEHA.2744@.TK2MSFTNGP10.phx.gbl...
> There is a group of Alert tokens that you can use...
> For instance, you could create a job that has one step
> Backup log [A-DBN] to disk = 'c:\[A-DBN].logbak'
> When the job is called from an Alert, the token will be replaced (even in
> the filename string... and the appropriate database log will be backed
up...
> But the job can not be run< except from an alert> , because that is the
only
> time the tokens will be replaced..
> For a complete list of Alert tokens, go to Gert Drapers web site
> http://www.sqldev.net/sqlagent/SQLAgentStepTokens.htm#Example using TSQL
> step
>
> "Michelle" <michelle@.nospam.com> wrote in message
> news:eDmu1PNIEHA.3664@.TK2MSFTNGP11.phx.gbl...
> > We have several servers with dozens of databases on each one. We have
> > elected to group our maintenance jobs so that all database backups are
> > consolidated into 4 separate jobs (alphabetically). We would like to
> backup
> > a log using our standard practices if it gets full. We don't want to
call
> > the 'consolidated' job because if the db is the last alphabetically, it
> will
> > have to go through all of the preceeding dbs before it gets to that log.
> By
> > that time, I could have gotten up out of bed and backed up the log
myself
> :)
> > We would like to be able to read the database name that triggered the
> alert
> > and have a job that backs up that log only. Where would I get that
> database
> > name? The alert has it, does it store it in a system table in msdb?
> >
> > Thanks!
> >
> >
>

Wednesday, March 28, 2012

Job Step Set up

I am creating a job within Enterprise Manager on SQL 2K to backup a database called Messaging. In creating the step, on the General tab there are four fields: Step name, Type, Database, Command.
My Command is:
BACKUP DATABASE Messaging TO Messaging20050114 WITH NOINIT , NOUNLOAD , NAME = N'Messaging Full Backup', NOSKIP , STATS = 10, NOFORMAT
In relation to the above command, do I select Messaging from the database drop down list?
In relation to the above command, if Master is selected from the database drop down list, what is backed up, Master or Messaging?
Message posted via http://www.sqlmonster.com
You can select messaging if you want but you do not have to. This listbox
just tells the SQL Server job agent which database to execute the T-SQL
within. Since you are telling SQL Server to backup the messaging database
("BACKUP DATABASE Messaging") you do not have to select the database.
Either way the messaging database will be backed up.
Personally I would leave the database listbox set to master.
Keith
"Robert Richards via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:0feb5d1e2fea4bc386ad965ac4d66991@.SQLMonster.c om...
> I am creating a job within Enterprise Manager on SQL 2K to backup a
database called Messaging. In creating the step, on the General tab there
are four fields: Step name, Type, Database, Command.
> My Command is:
> BACKUP DATABASE Messaging TO Messaging20050114 WITH NOINIT , NOUNLOAD ,
NAME = N'Messaging Full Backup', NOSKIP , STATS = 10, NOFORMAT
> In relation to the above command, do I select Messaging from the database
drop down list?
> In relation to the above command, if Master is selected from the database
drop down list, what is backed up, Master or Messaging?
> --
> Message posted via http://www.sqlmonster.com

Job Step Set up

I am creating a job within Enterprise Manager on SQL 2K to backup a database
called Messaging. In creating the step, on the General tab there are four f
ields: Step name, Type, Database, Command.
My Command is:
BACKUP DATABASE Messaging TO Messaging20050114 WITH NOINIT , NOUNLOAD , NAME
= N'Messaging Full Backup', NOSKIP , STATS = 10, NOFORMAT
In relation to the above command, do I select Messaging from the database dr
op down list?
In relation to the above command, if Master is selected from the database dr
op down list, what is backed up, Master or Messaging?
Message posted via http://www.droptable.comYou can select messaging if you want but you do not have to. This listbox
just tells the SQL Server job agent which database to execute the T-SQL
within. Since you are telling SQL Server to backup the messaging database
("BACKUP DATABASE Messaging") you do not have to select the database.
Either way the messaging database will be backed up.
Personally I would leave the database listbox set to master.
Keith
"Robert Richards via droptable.com" <forum@.droptable.com> wrote in message
news:0feb5d1e2fea4bc386ad965ac4d66991@.SQ
droptable.com...
> I am creating a job within Enterprise Manager on SQL 2K to backup a
database called Messaging. In creating the step, on the General tab there
are four fields: Step name, Type, Database, Command.
> My Command is:
> BACKUP DATABASE Messaging TO Messaging20050114 WITH NOINIT , NOUNLOAD ,
NAME = N'Messaging Full Backup', NOSKIP , STATS = 10, NOFORMAT
> In relation to the above command, do I select Messaging from the database
drop down list?
> In relation to the above command, if Master is selected from the database
drop down list, what is backed up, Master or Messaging?
> --
> Message posted via http://www.droptable.comsql

Job Step Set up

I am creating a job within Enterprise Manager on SQL 2K to backup a database called Messaging. In creating the step, on the General tab there are four fields: Step name, Type, Database, Command.
My Command is:
BACKUP DATABASE Messaging TO Messaging20050114 WITH NOINIT , NOUNLOAD , NAME = N'Messaging Full Backup', NOSKIP , STATS = 10, NOFORMAT
In relation to the above command, do I select Messaging from the database drop down list?
In relation to the above command, if Master is selected from the database drop down list, what is backed up, Master or Messaging?
--
Message posted via http://www.sqlmonster.comYou can select messaging if you want but you do not have to. This listbox
just tells the SQL Server job agent which database to execute the T-SQL
within. Since you are telling SQL Server to backup the messaging database
("BACKUP DATABASE Messaging") you do not have to select the database.
Either way the messaging database will be backed up.
Personally I would leave the database listbox set to master.
--
Keith
"Robert Richards via SQLMonster.com" <forum@.SQLMonster.com> wrote in message
news:0feb5d1e2fea4bc386ad965ac4d66991@.SQLMonster.com...
> I am creating a job within Enterprise Manager on SQL 2K to backup a
database called Messaging. In creating the step, on the General tab there
are four fields: Step name, Type, Database, Command.
> My Command is:
> BACKUP DATABASE Messaging TO Messaging20050114 WITH NOINIT , NOUNLOAD ,
NAME = N'Messaging Full Backup', NOSKIP , STATS = 10, NOFORMAT
> In relation to the above command, do I select Messaging from the database
drop down list?
> In relation to the above command, if Master is selected from the database
drop down list, what is backed up, Master or Messaging?
> --
> Message posted via http://www.sqlmonster.com

Friday, March 23, 2012

Job reports failure, but bak file created

The view history of a job created from a maintenance plan reports that it
failed, and the log says that it failed in the backup operation because
"A nonrecoverable I/O error occurred on file
"\\\\BIGPETE\\E\\data\\Backups\\Daily\\MCR_SFPMS\\MCR_SFPMS_backup_200707110001.bak:" 64(The specified network name is no longer available.).
And yet MCR_SFPMS_backup_200707110001.bak does exist, and moreover, it was a
valid backup, as I just confirmed by restoring it to a test database. So why
the error?
Also, this does not happen consistently. The reporting of this apparent
non-error has occured twice out of the last five runs.Does the backup process include a Verify? IF so the error is most likely
occurring on the verify process which is done after the backup is complete.
Backup & Verify is an intensive operation and if you are backing up across
the network there is plenty of time for the network to drop packets etc.
Sounds like you have an unstable network or networks equipment.
--
Andrew J. Kelly SQL MVP
"Bev Kaufman" <BevKaufman@.discussions.microsoft.com> wrote in message
news:AF302871-2972-420D-A932-408F42EA1EA9@.microsoft.com...
> The view history of a job created from a maintenance plan reports that it
> failed, and the log says that it failed in the backup operation because
> "A nonrecoverable I/O error occurred on file
> "\\\\BIGPETE\\E\\data\\Backups\\Daily\\MCR_SFPMS\\MCR_SFPMS_backup_200707110001.bak:"
> 64(The specified network name is no longer available.).
> And yet MCR_SFPMS_backup_200707110001.bak does exist, and moreover, it was
> a
> valid backup, as I just confirmed by restoring it to a test database. So
> why
> the error?
> Also, this does not happen consistently. The reporting of this apparent
> non-error has occured twice out of the last five runs.|||On Jul 11, 9:16 am, Bev Kaufman <BevKauf...@.discussions.microsoft.com>
wrote:
> The view history of a job created from a maintenance plan reports that it
> failed, and the log says that it failed in the backup operation because
> "A nonrecoverable I/O error occurred on file
> "\\\\BIGPETE\\E\\data\\Backups\\Daily\\MCR_SFPMS\\MCR_SFPMS_backup_200707=11=AD0001.bak:" 64(The specified network name is no longer available.).
> And yet MCR_SFPMS_backup_200707110001.bak does exist, and moreover, it wa=s a
> valid backup, as I just confirmed by restoring it to a test database. So= why
> the error?
> Also, this does not happen consistently. The reporting of this apparent
> non-error has occured twice out of the last five runs.
Are you utilizing a third party backup tool? We use RedGate in our
SQL Server 2000 (SP3a - don't ask) environment and have encountered
this on a daily basis. When we used normal backup procedures, no
errors were reported. I have the same issue though, but figured it
might be resolved with a newer service pack. The only thing I can
think of is possibly disk contention of you are utilizing a SAN
environment, but not sure.
Maybe if we put our heads together, we can figure it out. I haven't
put a whole lot of effort into it once I realized that the backups are
working properly (as verified by the restores). I know, terrible, but
sometimes other fires are hotter :)

Job problem

Hello,
I have a job where in one of the steps I'm coping a
database backup file from one server to the other using
an operating system command xcopy. The command I'm using
is below, but the job keeps failing on this step. The
error I get is "The job failed. The Job was invoked by
User TST-SQL\VDURAN. The last step to run was step 3
(copyfile).".
The command works fine if I execute from the actual
command prompt of the source server. My destination
server directory is shared and I have set my permssions
to full control for everyone. Please help.
xcopy d:\backups\TestBackup\OrdersDB.bak
\\duran\DBBackups\
TIA,
VicWhat is the exact error for step 3 ? Is this using a CmdExec job step ?
If you look at the step history you should see the exit code for the step
and the error.
If the file exists you will want to use the /Y switch for xcopy to allow
overwring of the file although this would generally hang the step if this
was the issue. How about just using copy /Y does this work ?
I take it that the SQLService account is running under a domain account ?
--
HTH
Jasper Smith (SQL Server MVP)
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Vic" <vduran@.specpro-inc.com> wrote in message
news:009c01c3d535$d23fb7c0$a101280a@.phx.gbl...
> Hello,
> I have a job where in one of the steps I'm coping a
> database backup file from one server to the other using
> an operating system command xcopy. The command I'm using
> is below, but the job keeps failing on this step. The
> error I get is "The job failed. The Job was invoked by
> User TST-SQL\VDURAN. The last step to run was step 3
> (copyfile).".
> The command works fine if I execute from the actual
> command prompt of the source server. My destination
> server directory is shared and I have set my permssions
> to full control for everyone. Please help.
> xcopy d:\backups\TestBackup\OrdersDB.bak
> \\duran\DBBackups\
>
> TIA,
> Vic|||Is it possible that you need to supply the actual path of
the xcopy command? Also, you may want to create the job
step to execute a command (.cmd) file rather than the
command itself. This would allow you to do some type of
eror code processing. It's been a long time since I've
done that in DOS batch files, but it should be doable.
Most likely you either have a path problem or a
permissions problem though.
I know this is a rather vague response, but hopefully it
will lead to something.
Matthew Bando
BandoM@.CSCTGI(remove).com
>--Original Message--
>Hello,
> I have a job where in one of the steps I'm coping a
>database backup file from one server to the other using
>an operating system command xcopy. The command I'm
using
>is below, but the job keeps failing on this step. The
>error I get is "The job failed. The Job was invoked by
>User TST-SQL\VDURAN. The last step to run was step 3
>(copyfile).".
> The command works fine if I execute from the actual
>command prompt of the source server. My destination
>server directory is shared and I have set my permssions
>to full control for everyone. Please help.
>xcopy d:\backups\TestBackup\OrdersDB.bak
>\\duran\DBBackups\
>
>TIA,
>Vic
>.
>|||Hello there.
I got kind of a similar issue with few jobs. To pin point
to the culprit, I set the DTS package to log the whole
process.
I found out which steps in my DTS package were failing and
not the generic SQL message from the job history, which
never says exactly what happened.
I have quite a few stpes in each job that uses windows
tasks. Two of those needs some time to be completed.
The first one, unzips a daily file to be run by other
steps to copy or update some tables.
The second step, copies the unzipped files to a different
server.
I applied two solutions for those command steps.
1. For the unzip command, I added an activeX step, which
loops while the file is being used by the DTS. Problem
solved here.
2. For the copy unzipped files to a different server (I
had to copy instead of moving files due to some internal
applications), I did take the step off the DTS and
schedule it to run a few minutes after the main job is
completed. Problem solved! for good.
Set the DTS log first to see exactly where your DTS is
failing, I bet is the move step (same thing happened to
me) I hope this helps. Good luck
>--Original Message--
>Hello,
> I have a job where in one of the steps I'm coping a
>database backup file from one server to the other using
>an operating system command xcopy. The command I'm using
>is below, but the job keeps failing on this step. The
>error I get is "The job failed. The Job was invoked by
>User TST-SQL\VDURAN. The last step to run was step 3
>(copyfile).".
> The command works fine if I execute from the actual
>command prompt of the source server. My destination
>server directory is shared and I have set my permssions
>to full control for everyone. Please help.
>xcopy d:\backups\TestBackup\OrdersDB.bak
>\\duran\DBBackups\
>
>TIA,
>Vic
>.
>

Monday, March 19, 2012

Job failure cannot easily be traced

sql server ver 8... Microsoft Windows 2000
A copy of a database is made using sp_attach sp_detach and the
transaction log backup scheduled for that hour fails ...makes sense !!
There has been subsequent failures at the same time at the application
log but not at the database view history.
No idea what is going on here .....
Your ideas will be more than appreciated
Vince"Vincento Harris" <wumutek@.yahoo.com> wrote in message
news:2fa13ee7.0307110428.6b0d66a@.posting.google.com...
> sql server ver 8... Microsoft Windows 2000
> A copy of a database is made using sp_attach sp_detach and the
> transaction log backup scheduled for that hour fails ...makes sense !!
> There has been subsequent failures at the same time at the application
> log but not at the database view history.
> No idea what is going on here .....
>
> Your ideas will be more than appreciated
If you are detaching, copying and re-attaching the database, the source
database will be unavailable during that time. Possibly contributing to your
job failures.
A far better technique would involve running BACKUP and RESTORE, in that way
the source db does not have to be made unavailable.
Steve

Friday, March 9, 2012

job failed to start - access denied

Hi,
the SQL Server Agent job that runs a backup to a network
drive wont start.The syntax is as follows :
BACKUP DATABASE Mydb
TO
DISK='\\ServerName\BACKUP\MyDB.BAK'
WITH INIT
In the error log and in the event viewer I can see the
following error message :operating system error 5 ( access
is denied). I can not figure it out why I can not run this
job since the SQL Server Agent startup account use the
domain user account that has sufficient permissions across
the domain and the job itself is owned by the same account.
Is there something else that I should pay attention to ?
Any view is apreciatedThe backup command runs under the security context of the SQL Server service
account. Ensure that account has the needed permissions.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Mirko" <anonymous@.discussions.microsoft.com> wrote in message
news:023c01c3b978$a2a45a80$a001280a@.phx.gbl...
> Hi,
> the SQL Server Agent job that runs a backup to a network
> drive wont start.The syntax is as follows :
> BACKUP DATABASE Mydb
> TO
> DISK='\\ServerName\BACKUP\MyDB.BAK'
> WITH INIT
> In the error log and in the event viewer I can see the
> following error message :operating system error 5 ( access
> is denied). I can not figure it out why I can not run this
> job since the SQL Server Agent startup account use the
> domain user account that has sufficient permissions across
> the domain and the job itself is owned by the same account.
> Is there something else that I should pay attention to ?
> Any view is apreciated
>