Showing posts with label schedule. Show all posts
Showing posts with label schedule. Show all posts

Monday, February 20, 2012

master.dbo.xp_cmdshell is failing

Please help !
I run an ftp task which picks up a file from an ftp server through a package it runs fine - no errors.
If I schedule the same dts or if I run the following code in query analyser it fails
declare @.cmd varchar(2000)
declare @.ftpcommandfile varchar(2000)
--Get list of remote files
set @.ftpcommandfile = '-s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Collections\Dialer\Dialer_Files\GetDialerFile.txt'
set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
Exec master.dbo.xp_cmdshell @.cmd
I get the following message:
output ---
Error opening script file -s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Collections\Dialer\Dialer_Files\GetDialerFile.txt.
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
-b:async count Overrides the default async count of 3
-w:buffer size Overrides the default transfer buffer size of 65535.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.
NULLYes, the error is in the FTP command, the s parameter is included twice.
--
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Aman" <Aman@.discussions.microsoft.com> wrote in message
news:641A9145-D95F-4D9B-A037-603546DA9178@.microsoft.com...
> Please help !
> I run an ftp task which picks up a file from an ftp server through a
package it runs fine - no errors.
> If I schedule the same dts or if I run the following code in query
analyser it fails
> declare @.cmd varchar(2000)
> declare @.ftpcommandfile varchar(2000)
> --Get list of remote files
> set @.ftpcommandfile ='-s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Collections\Dialer\Dialer_
Files\GetDialerFile.txt'
> set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
> Exec master.dbo.xp_cmdshell @.cmd
> I get the following message:
>
---
> Error opening script
file -s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Collections\Dialer\Dia
ler_Files\GetDialerFile.txt.
> Transfers files to and from a computer running an FTP server service
> (sometimes called a daemon). Ftp can be used interactively.
> FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer]
[-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]
>
> -v Suppresses display of remote server responses.
> -n Suppresses auto-login upon initial connection.
> -i Turns off interactive prompting during multiple file
> transfers.
> -d Enables debugging.
> -g Disables filename globbing (see GLOB command).
> -s:filename Specifies a text file containing FTP commands; the
> commands will automatically run after FTP starts.
> -a Use any local interface when binding data connection.
> -A login as anonymous.
> -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
> -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
> -b:async count Overrides the default async count of 3
> -w:buffer size Overrides the default transfer buffer size of 65535.
> host Specifies the host name or IP address of the remote
> host to connect to.
> Notes:
> - mget and mput commands take y/n/q for yes/no/quit.
> - Use Control-C to abort commands.
> NULL
>

master.dbo.xp_cmdshell is failing

Please help !
I run an ftp task which picks up a file from an ftp server through a package it runs fine - no errors.
If I schedule the same dts or if I run the following code in query analyser it fails
declare @.cmd varchar(2000)
declare @.ftpcommandfile varchar(2000)
--Get list of remote files
set @.ftpcommandfile = '-s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Co llections\Dialer\Dialer_Files\GetDialerFile.txt'
set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
Exec master.dbo.xp_cmdshell @.cmd
I get the following message:
output ---
Error opening script file -s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Co llections\Dialer\Dialer_Files\GetDialerFile.txt.
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
-b:async count Overrides the default async count of 3
-w:buffer size Overrides the default transfer buffer size of 65535.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.
NULL
Add PRINT @.cmd before the xp_cmdshell to see what the caommand is, but I think you have -s: in there twice.
"Aman" wrote:

> Please help !
> I run an ftp task which picks up a file from an ftp server through a package it runs fine - no errors.
> If I schedule the same dts or if I run the following code in query analyser it fails
> declare @.cmd varchar(2000)
> declare @.ftpcommandfile varchar(2000)
> --Get list of remote files
> set @.ftpcommandfile = '-s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Co llections\Dialer\Dialer_Files\GetDialerFile.txt'
> set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
> Exec master.dbo.xp_cmdshell @.cmd
> I get the following message:
> output ---
> Error opening script file -s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Co llections\Dialer\Dialer_Files\GetDialerFile.txt.
> Transfers files to and from a computer running an FTP server service
> (sometimes called a daemon). Ftp can be used interactively.
> FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]
>
> -v Suppresses display of remote server responses.
> -n Suppresses auto-login upon initial connection.
> -i Turns off interactive prompting during multiple file
> transfers.
> -d Enables debugging.
> -g Disables filename globbing (see GLOB command).
> -s:filename Specifies a text file containing FTP commands; the
> commands will automatically run after FTP starts.
> -a Use any local interface when binding data connection.
> -A login as anonymous.
> -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
> -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
> -b:async count Overrides the default async count of 3
> -w:buffer size Overrides the default transfer buffer size of 65535.
> host Specifies the host name or IP address of the remote
> host to connect to.
> Notes:
> - mget and mput commands take y/n/q for yes/no/quit.
> - Use Control-C to abort commands.
> NULL
>
|||Yes, the error is in the FTP command, the s parameter is included twice.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Aman" <Aman@.discussions.microsoft.com> wrote in message
news:641A9145-D95F-4D9B-A037-603546DA9178@.microsoft.com...
> Please help !
> I run an ftp task which picks up a file from an ftp server through a
package it runs fine - no errors.
> If I schedule the same dts or if I run the following code in query
analyser it fails
> declare @.cmd varchar(2000)
> declare @.ftpcommandfile varchar(2000)
> --Get list of remote files
> set @.ftpcommandfile =
'-s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Co llections\Dialer\Dialer_
Files\GetDialerFile.txt'
> set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
> Exec master.dbo.xp_cmdshell @.cmd
> I get the following message:
>

> Error opening script
file -s:\\mathshr01\Marketing\Wr_mrktg_s\SHARED\WM_IM\Co llections\Dialer\Dia
ler_Files\GetDialerFile.txt.
> Transfers files to and from a computer running an FTP server service
> (sometimes called a daemon). Ftp can be used interactively.
> FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-A] [-x:sendbuffer]
[-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]
>
> -v Suppresses display of remote server responses.
> -n Suppresses auto-login upon initial connection.
> -i Turns off interactive prompting during multiple file
> transfers.
> -d Enables debugging.
> -g Disables filename globbing (see GLOB command).
> -s:filename Specifies a text file containing FTP commands; the
> commands will automatically run after FTP starts.
> -a Use any local interface when binding data connection.
> -A login as anonymous.
> -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
> -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
> -b:async count Overrides the default async count of 3
> -w:buffer size Overrides the default transfer buffer size of 65535.
> host Specifies the host name or IP address of the remote
> host to connect to.
> Notes:
> - mget and mput commands take y/n/q for yes/no/quit.
> - Use Control-C to abort commands.
> NULL
>

master.dbo.xp_cmdshell is failing

Please help !
I run an ftp task which picks up a file from an ftp server through a package
it runs fine - no errors.
If I schedule the same dts or if I run the following code in query analyser
it fails
declare @.cmd varchar(2000)
declare @.ftpcommandfile varchar(2000)
--Get list of remote files
set @.ftpcommandfile = '- s:\\mathshr01\Marketing\Wr_mrktg_s\SHARE
D\WM_IM\Col
lections\Dialer\Dialer_Files\GetDialerFi
le.txt'
set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
Exec master.dbo.xp_cmdshell @.cmd
I get the following message:
output
--
--
Error opening script file - s:\\mathshr01\Marketing\Wr_mrktg_s\SHARE
D\WM_IM\C
ollections\Dialer\Dialer_Files\GetDialer
File.txt.
Transfers files to and from a computer running an FTP server service
(sometimes called a daemon). Ftp can be used interactively.
FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a]
[-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers] [
-w:windowsize] [host]
-v Suppresses display of remote server responses.
-n Suppresses auto-login upon initial connection.
-i Turns off interactive prompting during multiple file
transfers.
-d Enables debugging.
-g Disables filename globbing (see GLOB command).
-s:filename Specifies a text file containing FTP commands; the
commands will automatically run after FTP starts.
-a Use any local interface when binding data connection.
-A login as anonymous.
-x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
-r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
-b:async count Overrides the default async count of 3
-w:buffer size Overrides the default transfer buffer size of 65535.
host Specifies the host name or IP address of the remote
host to connect to.
Notes:
- mget and mput commands take y/n/q for yes/no/quit.
- Use Control-C to abort commands.
NULLAdd PRINT @.cmd before the xp_cmdshell to see what the caommand is, but I th
ink you have -s: in there twice.
"Aman" wrote:

> Please help !
> I run an ftp task which picks up a file from an ftp server through a packa
ge it runs fine - no errors.
> If I schedule the same dts or if I run the following code in query analys
er it fails
> declare @.cmd varchar(2000)
> declare @.ftpcommandfile varchar(2000)
> --Get list of remote files
> set @.ftpcommandfile = '- s:\\mathshr01\Marketing\Wr_mrktg_s\SHARE
D\WM_IM\
Collections\Dialer\Dialer_Files\GetDiale
rFile.txt'
> set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
> Exec master.dbo.xp_cmdshell @.cmd
> I get the following message:
> output
--
--
> Error opening script file - s:\\mathshr01\Marketing\Wr_mrktg_s\SHARE
D\WM_IM
\Collections\Dialer\Dialer_Files\GetDial
erFile.txt.
> Transfers files to and from a computer running an FTP server service
> (sometimes called a daemon). Ftp can be used interactively.
> FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a
] [-A] [-x:sendbuffer] [-r:recvbuffer] [-b:asyncbuffers]
1;-w:windowsize] [host]
>
> -v Suppresses display of remote server responses.
> -n Suppresses auto-login upon initial connection.
> -i Turns off interactive prompting during multiple file
> transfers.
> -d Enables debugging.
> -g Disables filename globbing (see GLOB command).
> -s:filename Specifies a text file containing FTP commands; the
> commands will automatically run after FTP starts.
> -a Use any local interface when binding data connection.
> -A login as anonymous.
> -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
> -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
> -b:async count Overrides the default async count of 3
> -w:buffer size Overrides the default transfer buffer size of 65535.
> host Specifies the host name or IP address of the remote
> host to connect to.
> Notes:
> - mget and mput commands take y/n/q for yes/no/quit.
> - Use Control-C to abort commands.
> NULL
>|||Yes, the error is in the FTP command, the s parameter is included twice.
Wayne Snyder, MCDBA, SQL Server MVP
Mariner, Charlotte, NC
www.mariner-usa.com
(Please respond only to the newsgroups.)
I support the Professional Association of SQL Server (PASS) and it's
community of SQL Server professionals.
www.sqlpass.org
"Aman" <Aman@.discussions.microsoft.com> wrote in message
news:641A9145-D95F-4D9B-A037-603546DA9178@.microsoft.com...
> Please help !
> I run an ftp task which picks up a file from an ftp server through a
package it runs fine - no errors.
> If I schedule the same dts or if I run the following code in query
analyser it fails
> declare @.cmd varchar(2000)
> declare @.ftpcommandfile varchar(2000)
> --Get list of remote files
> set @.ftpcommandfile =
'- s:\\mathshr01\Marketing\Wr_mrktg_s\SHARE
D\WM_IM\Collections\Dialer\Dialer_
Files\GetDialerFile.txt'
> set @.cmd = 'ftp -i -s:' + @.ftpcommandfile
> Exec master.dbo.xp_cmdshell @.cmd
> I get the following message:
>
---
> Error opening script
file - s:\\mathshr01\Marketing\Wr_mrktg_s\SHARE
D\WM_IM\Collections\Dialer\Dia
ler_Files\GetDialerFile.txt.
> Transfers files to and from a computer running an FTP server service
> (sometimes called a daemon). Ftp can be used interactively.
> FTP [-v] [-d] [-i] [-n] [-g] [-s:filename] [-a] [-
A] [-x:sendbuffer]
[-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [host]
>
> -v Suppresses display of remote server responses.
> -n Suppresses auto-login upon initial connection.
> -i Turns off interactive prompting during multiple file
> transfers.
> -d Enables debugging.
> -g Disables filename globbing (see GLOB command).
> -s:filename Specifies a text file containing FTP commands; the
> commands will automatically run after FTP starts.
> -a Use any local interface when binding data connection.
> -A login as anonymous.
> -x:send sockbuf Overrides the default SO_SNDBUF size of 8192.
> -r:recv sockbuf Overrides the default SO_RCVBUF size of 8192.
> -b:async count Overrides the default async count of 3
> -w:buffer size Overrides the default transfer buffer size of 65535.
> host Specifies the host name or IP address of the remote
> host to connect to.
> Notes:
> - mget and mput commands take y/n/q for yes/no/quit.
> - Use Control-C to abort commands.
> NULL
>

Master Transaction Log backup fails

:eek:

Okay. I changed the times that the transaction logs are backed up, via the built in maintenance schedule. It was then that I started to get failures only on the Transaction log backup for the master. The error that I get from the history log is Backup can not be performed on this database. This sub task is ignored. If I look in the file that is saved to disk :

Starting maintenance plan 'DB Maintenance Plan1' on 09/11/2004 02:30:00
Backup can not be performed on database 'master'. This sub task is ignored.

[1] Database onyx: Transaction Log Backup...
Destination: [R:\BACKUP\onyx\onyx_tlog_200411090230.TRN]

** Execution Time: 0 hrs, 0 mins, 23 secs **

[2] Database onyx: Verifying Backup...

** Execution Time: 0 hrs, 0 mins, 8 secs **

Deleting old text reports... 1 file(s) deleted.

End of maintenance plan 'DB Maintenance Plan1' on 09/11/2004 02:30:31
SQLMAINT.EXE Process Exit Code: 1 (Failed)

I changed the backup back to its original time as this was the only change made. This has not resolved the problem. As I am new to SQL and still finding my feet All the other SQL maintenance plans that I changed are working fine.

Thanks

SteveCheck to make sure the database isnt in simple recovery mode. This would make transaction log backups fail. By default you cannot do a transaction log backup on the master database.
If you dont know how to check, do the following:
1. Right click the master database and click properties.
2. Click on the options tab.
3. Make sure recovery mode is set to full if you want to backup the transaction log.

-Mike|||The transaction log for the master database can not be backed up, or restored. You should do FULL backups of the master database, but transaction backups will not work.|||Actually, yes, you are correct. I dont know why I didnt remember this. Just do full backups instead of transaction log backups. The master database is usually very small so backups dont take a lot of disk space and full backups are much easier to restore.

-Mike|||No shame in that, Mike. I actually had a Microsoft technician tell me to put tempdb in Full Recovery mode, once. I don't know if he still works in the SQL Server group, anymore.|||;) Gents,

Thank youi for your help. I have looked into the issue and have submitted a few concerns to my management.

Many thanks