Showing posts with label xp_cmdshell. Show all posts
Showing posts with label xp_cmdshell. Show all posts

Wednesday, March 7, 2012

Copy Backup file

hi,
I have a problem copying 12 Gb database backup files (2) for network backup
copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup files
every day night. Sometimes, the files are not copied over the network. I have
full backup every day night and log backup every hour. Can any one suggest a
good solution for copying the backup files out of SAN, (cost effective
solution, without buying software. I dont have a differential backups right
now because of storage space. )
thanks
kris
"kpxus" <kpxus@.discussions.microsoft.com> wrote in message
news:8EA2A0EA-61CB-446D-906D-8C9D7BCD96B9@.microsoft.com...
> hi,
> I have a problem copying 12 Gb database backup files (2) for network
backup
> copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup
files
> every day night. Sometimes, the files are not copied over the network. I
have
> full backup every day night and log backup every hour. Can any one suggest
a
> good solution for copying the backup files out of SAN, (cost effective
> solution, without buying software. I dont have a differential backups
right
> now because of storage space. )
>
> thanks
> kris
>
Kris,
Several things come to mind. You could make smaller backups by creating
filegroups and doing filegroup backups on a rotational schedule. Check them
out in the BOL. Faster backups, smaller backups, quicker recovery and
fairly straightforward to use.
You could use the Windows scheduler to copy the files around.
There are shareware/freeware .NET Windows Service apps that can copy files
from just about any location to any other location and include encryption
etc.
Rick Sawtell
MCT, MCSD, MCDBA
|||Hi,
You could write a small DOS script (batch file) to copy files from one
location to other and schedule the batch file via windows schedular. For
example:
On the destination server create a batch like:
copy \\server_name\Share_Name\directory_or_filenames
destination_path(E:\sqlbackups\
Test this out. It will work properly.
hth
DeeJay Puar
"kpxus" wrote:

> hi,
> I have a problem copying 12 Gb database backup files (2) for network backup
> copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup files
> every day night. Sometimes, the files are not copied over the network. I have
> full backup every day night and log backup every hour. Can any one suggest a
> good solution for copying the backup files out of SAN, (cost effective
> solution, without buying software. I dont have a differential backups right
> now because of storage space. )
>
> thanks
> kris
>
|||Thanks
"DeeJay Puar" <DeeJayPuar@.discussions.microsoft.com> wrote in message
news:30CD919E-39BD-408F-9A9E-239FA9F62BA7@.microsoft.com...[vbcol=seagreen]
> Hi,
> You could write a small DOS script (batch file) to copy files from one
> location to other and schedule the batch file via windows schedular. For
> example:
> On the destination server create a batch like:
> copy \\server_name\Share_Name\directory_or_filenames
> destination_path(E:\sqlbackups\
> Test this out. It will work properly.
> hth
> DeeJay Puar
>
> "kpxus" wrote:
backup[vbcol=seagreen]
files[vbcol=seagreen]
have[vbcol=seagreen]
suggest a[vbcol=seagreen]
right[vbcol=seagreen]

Copy Backup file

hi,
I have a problem copying 12 Gb database backup files (2) for network backup
copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup files
every day night. Sometimes, the files are not copied over the network. I have
full backup every day night and log backup every hour. Can any one suggest a
good solution for copying the backup files out of SAN, (cost effective
solution, without buying software. I dont have a differential backups right
now because of storage space. )
thanks
kris"kpxus" <kpxus@.discussions.microsoft.com> wrote in message
news:8EA2A0EA-61CB-446D-906D-8C9D7BCD96B9@.microsoft.com...
> hi,
> I have a problem copying 12 Gb database backup files (2) for network
backup
> copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup
files
> every day night. Sometimes, the files are not copied over the network. I
have
> full backup every day night and log backup every hour. Can any one suggest
a
> good solution for copying the backup files out of SAN, (cost effective
> solution, without buying software. I dont have a differential backups
right
> now because of storage space. )
>
> thanks
> kris
>
Kris,
Several things come to mind. You could make smaller backups by creating
filegroups and doing filegroup backups on a rotational schedule. Check them
out in the BOL. Faster backups, smaller backups, quicker recovery and
fairly straightforward to use.
You could use the Windows scheduler to copy the files around.
There are shareware/freeware .NET Windows Service apps that can copy files
from just about any location to any other location and include encryption
etc.
Rick Sawtell
MCT, MCSD, MCDBA|||Hi,
You could write a small DOS script (batch file) to copy files from one
location to other and schedule the batch file via windows schedular. For
example:
On the destination server create a batch like:
copy \\server_name\Share_Name\directory_or_filenames
destination_path(E:\sqlbackups\
Test this out. It will work properly.
hth
DeeJay Puar
"kpxus" wrote:
> hi,
> I have a problem copying 12 Gb database backup files (2) for network backup
> copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup files
> every day night. Sometimes, the files are not copied over the network. I have
> full backup every day night and log backup every hour. Can any one suggest a
> good solution for copying the backup files out of SAN, (cost effective
> solution, without buying software. I dont have a differential backups right
> now because of storage space. )
>
> thanks
> kris
>|||Thanks
"DeeJay Puar" <DeeJayPuar@.discussions.microsoft.com> wrote in message
news:30CD919E-39BD-408F-9A9E-239FA9F62BA7@.microsoft.com...
> Hi,
> You could write a small DOS script (batch file) to copy files from one
> location to other and schedule the batch file via windows schedular. For
> example:
> On the destination server create a batch like:
> copy \\server_name\Share_Name\directory_or_filenames
> destination_path(E:\sqlbackups\
> Test this out. It will work properly.
> hth
> DeeJay Puar
>
> "kpxus" wrote:
> > hi,
> >
> > I have a problem copying 12 Gb database backup files (2) for network
backup
> > copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup
files
> > every day night. Sometimes, the files are not copied over the network. I
have
> > full backup every day night and log backup every hour. Can any one
suggest a
> > good solution for copying the backup files out of SAN, (cost effective
> > solution, without buying software. I dont have a differential backups
right
> > now because of storage space. )
> >
> >
> > thanks
> > kris
> >

Copy Backup file

hi,
I have a problem copying 12 Gb database backup files (2) for network backup
copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup files
every day night. Sometimes, the files are not copied over the network. I hav
e
full backup every day night and log backup every hour. Can any one suggest a
good solution for copying the backup files out of SAN, (cost effective
solution, without buying software. I dont have a differential backups right
now because of storage space. )
thanks
kris"kpxus" <kpxus@.discussions.microsoft.com> wrote in message
news:8EA2A0EA-61CB-446D-906D-8C9D7BCD96B9@.microsoft.com...
> hi,
> I have a problem copying 12 Gb database backup files (2) for network
backup
> copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup
files
> every day night. Sometimes, the files are not copied over the network. I
have
> full backup every day night and log backup every hour. Can any one suggest
a
> good solution for copying the backup files out of SAN, (cost effective
> solution, without buying software. I dont have a differential backups
right
> now because of storage space. )
>
> thanks
> kris
>
Kris,
Several things come to mind. You could make smaller backups by creating
filegroups and doing filegroup backups on a rotational schedule. Check them
out in the BOL. Faster backups, smaller backups, quicker recovery and
fairly straightforward to use.
You could use the Windows scheduler to copy the files around.
There are shareware/freeware .NET Windows Service apps that can copy files
from just about any location to any other location and include encryption
etc.
Rick Sawtell
MCT, MCSD, MCDBA|||Hi,
You could write a small DOS script (batch file) to copy files from one
location to other and schedule the batch file via windows schedular. For
example:
On the destination server create a batch like:
copy \\server_name\Share_Name\directory_or_fi
lenames
destination_path(E:\sqlbackups\
Test this out. It will work properly.
hth
DeeJay Puar
"kpxus" wrote:

> hi,
> I have a problem copying 12 Gb database backup files (2) for network back
up
> copy from the SAN. I used xp_cmdshell ' copy ...' to copy the backup file
s
> every day night. Sometimes, the files are not copied over the network. I h
ave
> full backup every day night and log backup every hour. Can any one suggest
a
> good solution for copying the backup files out of SAN, (cost effective
> solution, without buying software. I dont have a differential backups rig
ht
> now because of storage space. )
>
> thanks
> kris
>|||Thanks
"DeeJay Puar" <DeeJayPuar@.discussions.microsoft.com> wrote in message
news:30CD919E-39BD-408F-9A9E-239FA9F62BA7@.microsoft.com...[vbcol=seagreen]
> Hi,
> You could write a small DOS script (batch file) to copy files from one
> location to other and schedule the batch file via windows schedular. For
> example:
> On the destination server create a batch like:
> copy \\server_name\Share_Name\directory_or_fi
lenames
> destination_path(E:\sqlbackups\
> Test this out. It will work properly.
> hth
> DeeJay Puar
>
> "kpxus" wrote:
>
backup[vbcol=seagreen]
files[vbcol=seagreen]
have[vbcol=seagreen]
suggest a[vbcol=seagreen]
right[vbcol=seagreen]

Saturday, February 25, 2012

copy a file with xp_cmdshell

hi friends,
how to move a file from client to server through xp_cmdshell
please provide the script
thanks
reddy
What exactly is it that you have a problem with? Just use cp_cmdshell and execute the desired copy
command, where you specify the paths to the files using UNC naming, like:
EXEC master..xp_cmdshell 'COPY \\machine1\sharename\filename.txt \\machine2\sharename\filename.txt'
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:7D3AFFFE-C388-4B3A-929A-211B5DD5A419@.microsoft.com...
> hi friends,
> how to move a file from client to server through xp_cmdshell
> please provide the script
> thanks
> reddy
|||hi tibor,
i used the same command.
the error is Logon failure: unknown user name or bad password.
please help
thanks
reddy
|||hi tibor,
i used the same command.
the error is Logon failure: unknown user name or bad password.
please help
thanks
reddy
|||If copying to/from a remote drive, check that your SQL Server service is
started using a domain user account, not the Local System account, and
ensure that the right permissions are granted to this domain user to access
that remote drive.
You can check this by running the dir command from within xp_cmdshell e.g.
xp_cmdshell 'dir \\network share name'
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:14F3F85F-691A-4CD4-BA21-352F2176104A@.microsoft.com...
> hi tibor,
> i used the same command.
> the error is Logon failure: unknown user name or bad password.
> please help
> thanks
> reddy
>
|||If copying to/from a remote drive, check that your SQL Server service is
started using a domain user account, not the Local System account, and
ensure that the right permissions are granted to this domain user to access
that remote drive.
You can check this by running the dir command from within xp_cmdshell e.g.
xp_cmdshell 'dir \\network share name'
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:14F3F85F-691A-4CD4-BA21-352F2176104A@.microsoft.com...
> hi tibor,
> i used the same command.
> the error is Logon failure: unknown user name or bad password.
> please help
> thanks
> reddy
>
|||hi friends,
i tried all your suggestions.but not working for me.
i am getting the follwing errors
if i use copy
EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
Invalid drive specification
if i use xcopy
EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
Logon failure: unknown user name or bad password.
plase suggest if any otherways are there to copy the files
thanks®ards
reddy
|||hi friends,
i tried all your suggestions.but not working for me.
i am getting the follwing errors
if i use copy
EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
Invalid drive specification
if i use xcopy
EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
Logon failure: unknown user name or bad password.
plase suggest if any otherways are there to copy the files
thanks®ards
reddy
|||Check your SQL Server service account (go to Administrative Tools /
Services). Is it started using the Local System account? If it is, use a
domain user account instead.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:1F112BD9-1970-4144-B6B0-994881CF46C9@.microsoft.com...
> hi friends,
> i tried all your suggestions.but not working for me.
> i am getting the follwing errors
> if i use copy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Invalid drive specification
> if i use xcopy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Logon failure: unknown user name or bad password.
> plase suggest if any otherways are there to copy the files
> thanks®ards
> reddy
>
|||Check your SQL Server service account (go to Administrative Tools /
Services). Is it started using the Local System account? If it is, use a
domain user account instead.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:1F112BD9-1970-4144-B6B0-994881CF46C9@.microsoft.com...
> hi friends,
> i tried all your suggestions.but not working for me.
> i am getting the follwing errors
> if i use copy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Invalid drive specification
> if i use xcopy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Logon failure: unknown user name or bad password.
> plase suggest if any otherways are there to copy the files
> thanks®ards
> reddy
>

copy a file with xp_cmdshell

hi friends,
how to move a file from client to server through xp_cmdshell
please provide the script
thanks
reddyWhat exactly is it that you have a problem with? Just use cp_cmdshell and ex
ecute the desired copy
command, where you specify the paths to the files using UNC naming, like:
EXEC master..xp_cmdshell 'COPY \\machine1\sharename\filename.txt \\machine2\
sharename\filename.txt'
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:7D3AFFFE-C388-4B3A-929A-211B5DD5A419@.microsoft.com...
> hi friends,
> how to move a file from client to server through xp_cmdshell
> please provide the script
> thanks
> reddy|||hi tibor,
i used the same command.
the error is Logon failure: unknown user name or bad password.
please help
thanks
reddy|||If copying to/from a remote drive, check that your SQL Server service is
started using a domain user account, not the Local System account, and
ensure that the right permissions are granted to this domain user to access
that remote drive.
You can check this by running the dir command from within xp_cmdshell e.g.
xp_cmdshell 'dir \\network share name'
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:14F3F85F-691A-4CD4-BA21-352F2176104A@.microsoft.com...
> hi tibor,
> i used the same command.
> the error is Logon failure: unknown user name or bad password.
> please help
> thanks
> reddy
>|||hi friends,
i tried all your suggestions.but not working for me.
i am getting the follwing errors
if i use copy
EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
Invalid drive specification
if i use xcopy
EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
Logon failure: unknown user name or bad password.
plase suggest if any otherways are there to copy the files
thanks®ards
reddy|||Check your SQL Server service account (go to Administrative Tools /
Services). Is it started using the Local System account? If it is, use a
domain user account instead.
Peter Yeoh
http://www.yohz.com
Need smaller SQL2K backups? Try MiniSQLBackup
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:1F112BD9-1970-4144-B6B0-994881CF46C9@.microsoft.com...
> hi friends,
> i tried all your suggestions.but not working for me.
> i am getting the follwing errors
> if i use copy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Invalid drive specification
> if i use xcopy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Logon failure: unknown user name or bad password.
> plase suggest if any otherways are there to copy the files
> thanks®ards
> reddy
>|||If this is a cut-n-paste of the actual code then it looks like you are
missing a ":" colon after the d in d\upd.txt
Should that read d:\upd.txt ' If not then it is a relative path are you
really sure it is there? I assume it is missing the colon based on the
error you received "Invalid drive specification"
"reddy" <reddy@.discussions.microsoft.com> wrote in message
news:1F112BD9-1970-4144-B6B0-994881CF46C9@.microsoft.com...
> hi friends,
> i tried all your suggestions.but not working for me.
> i am getting the follwing errors
> if i use copy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Invalid drive specification
> if i use xcopy
> EXEC master..xp_cmdshell 'xcopy \\e-060\c\updates.txt d\upd.txt'
> Logon failure: unknown user name or bad password.
> plase suggest if any otherways are there to copy the files
> thanks®ards
> reddy
>