December 13, 2007 at 11:10 pm
Hi,
I need to zip couple of Db's for the archive process.The server is not having winzip installed,it i shaving the defacult microsoft compressed zip option,using that it is not
possible to zip files more than 2 Gb,is there any other method,I have installed the
winzip evaluation version,
and written the script but it shows 'winzip' is not recognized as an internal or external command,
this is the script
declare @db_name varchar(256),@txt varchar(1024)
DECLARE DB_archive CURSOR FOR
SELECT db_name from DB_List1203
OPEN DB_archive
FETCH NEXT FROM DB_archive INTO @db_name
IF @@FETCH_STATUS <> 0
PRINT 'All DBS Zipped'
WHILE @@FETCH_STATUS = 0
BEGIN
set @txt = 'winzip -a V:\Data_1\'+@db_name +'.zip V:\Data_1\'+@db_name+'.mdf'
Exec master..xp_cmdshell @txt
FETCH NEXT FROM DB_archive INTO @db_name
END
CLOSE DB_archive
DEALLOCATE DB_archive
Please let me know some idea to resolve this,winzip shows -version like this WinZip 9.0 SR-1
or any other method to zip this,using compressed zip what commands wil use
Regards,
Shine
December 14, 2007 at 1:13 am
Add the full path in your @txt parameter like this:
set @txt = 'C:\Program Files\Winzip\winzip.exe -a V:\Data_1\'+@db_name +'.zip V:\Data_1\'+@db_name+'.mdf'
Exec master..xp_cmdshell @txt
[font="Verdana"]Markus Bohse[/font]
December 14, 2007 at 5:21 am
I have used MICROSOFT COMPRESS OPTION to compress a 3 GB file it seems to be working fine.
Murali
December 14, 2007 at 5:47 am
C'mon folks... WinZip Pro costs what, 60$??? Don't screw around with your archive data... do it right. You probably spend more than $60 a month buying coffee, softdrinks, and/or snacks.
--Jeff Moden
Change is inevitable... Change for the better is not.
December 14, 2007 at 5:52 am
sometimes post amaze me! rar is pretty good and costs about the same as winzip and works cmd line well. I hope by microsoft compress you don't mean ntfs compressed folders as those are not certified with sql server.
I'd actually suggest buying litespeed or redgate's tool, both of which produce "proper" compressed backups and not mess with zip tools, use something thta works with sql server.
[font="Comic Sans MS"]The GrumpyOldDBA[/font]
www.grumpyolddba.co.uk
http://sqlblogcasts.com/blogs/grumpyolddba/
December 14, 2007 at 8:52 am
HEY,
HERE A PROC THAT i USED FOR COMPRESSING NIGHTLY DATABASE FILE(S) .BAK HOPE IT WILL BE OF HELP TO YOU. NOTE THIS USES COOMAND LINE VERSION OF WINZIP. SO YOU MUST A COPY OF IT INSTALLED. YOU CAN ALSO USE GZIP TO COMPRESS YOUR .BAK FILES. THE GOOD THING ABOUT GZIP IS THAT IT IS FREEWHARE SOFTWARE.
.... IF YOU NEED THE COMPLETE PROC LET ME ME SO i WILL POST IT
Declare @TobeCompressedpathSource sysname -- holds bak files to be zipped eg d:\maint\daillybackup\*.bak---
Declare @CompressedBakFileDest sysname -- holds zipped files eg d:\maint\daillybackup.zip---
Declare @sqlname sysname
Declare @now1 sysname
Set @now1 = (Select convert(varchar,getdate(),112))
Set @sqlname = (Select @@servername)
Declare @path sysname
Declare @Ext sysname
Set @Ext = '.zip'
Set @path = 'D:\maint\Backup'
Set @CompressedBakFileDest = @path +'\'+@sqlname + @now1+ @Ext
--Set @CompressedBakFileDest = @path +'\'+@sqlname + @Ext
--Set @CompressedBakFileDest = 'D:\maint\Backup\Db008bakfiles.zip' -- all bak files will be zippup here---
Set @TobeCompressedpathSource ='D:\maint\Backup\*.bak' -- location for bak file E:\backup\Unzipped\msql --
Declare @wpro sysname
Set @wpro = 'C:\WINDOWS\system32\wzzip.Exe'
Declare @opt sysname
Set @opt = '-rp'
Declare @CmdwinzipM sysname
--Set @CmdwinzipM = @wpro + + @opt +CHAR(9)+ @CompressedBakFileDest + CHAR(9)+ @TobeCompressedpathSource
Set @CmdwinzipM = @wpro +CHAR(9)+ @opt +CHAR(9)+ @CompressedBakFileDest + CHAR(9)+ @TobeCompressedpathSource
Exec master..xp_cmdshell @CmdwinzipM, no_output
--print @CmdwinzipM
...
December 14, 2007 at 11:27 am
You may also want to consider 7-zip, which has a command line option:
However, if this is critical data, you ought to consider using a commercial product with a support option.
December 14, 2007 at 11:57 am
Jeff Moden (12/14/2007)
C'mon folks... WinZip Pro costs what, 60$??? Don't screw around with your archive data... do it right. You probably spend more than $60 a month buying coffee, softdrinks, and/or snacks.
Pro version is $49.95, with the added command-line support options.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
December 14, 2007 at 12:41 pm
oh...and buy the 64-bit edition to get past the 65,536 files or 4GB/file limit.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply