SQLSERVER 压缩服务器端备份文件
一、在SQL2000当中 ? use master backup database zy to disk='C:/db.bak' with noinit? --备份 use master exec xp_makecab 'c:/db.cab',mszip,1,'c:/db.bak'???? --mszip 压缩方式 二、在SQL2005当中 首先在SQLSERVER 外围应用配置器中启用xp_cmdshell. use master exec xp_cmdshell "makecab c:/db.bak? d:/db.cab"? --调用系统命令 makecab 三、复制文件 ? exec xp_cmdshell "copy d:/db.cab f:/db.cab" ----------------------------原形-------------------------------------- 用 ? xp_cmdshell ? 调用system32下的makecab.exe可以压缩文件 使用方法:命令行下输入命令 MAKECAB ? [/V[n]] ? [/D ? var=value ? ...] ? [/L ? dir] ? source ? [destination] MAKECAB ? [/V[n]] ? [/D ? var=value ? ...] ? /F ? directive_file ? [...] ? ? source ? ? ? ? ? ? ? ? ? File ? to ? compress. ? ? destination ? ? ? ? File ? name ? to ? give ? compressed ? file. ? ? If ? omitted,? the ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? last ? character ? of ? the ? source ? file ? name ? is ? replaced ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? with ? an ? underscore ? (_) ? and ? used ? as ? the ? destination. ? ? /F ? directives ? ? A ? file ? with ? MakeCAB ? directives ? (may ? be ? repeated). ? ? /D ? var=value ? ? ? Defines ? variable ? with ? specified ? value. ? ? /L ? dir ? ? ? ? ? ? ? ? ? Location ? to ? place ? destination ? (default ? is ? current ? directory). ? ? /V[n] ? ? ? ? ? ? ? ? ? ? Verbosity ? level ? (1..3). (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |