Aklımda Kalası Kelimeler

* давайте работать вместе
* Zarf ve Mazruf, Zerafet(xHoyratlık) ile aynı kökten(za-ra-fe) gelir
* Bedesten
* Suç subuta ermiştir - Suç sabit olmuştur
COMPACT etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
COMPACT etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

25 Mayıs 2010 Salı

MSSL de yedekleri otomatik sıkıştır

In SQL Server 2008 Enterprise and later only, used by the BACKUP Transact-SQL statement to select the backup compression setting if a user does not specify WITH COMPRESSION or WITH NO_COMPRESSION.

Ref: technet.microsoft.com

USE master;
GO
EXEC sp_configure ‘backup compression default’, '1';
RECONFIGURE WITH OVERRIDE;


Restrictions

The following restrictions apply to compressed backups:
* Compressed and uncompressed backups cannot co-exist in a media set.
* Previous versions of SQL Server cannot read compressed backups.
* NTbackups cannot share a tape with compressed SQL Server backups.

SQL 2005 için benim çözümüm


Harici bir batch çalıştırmak için xp_cmdshell çalışıtırılabilir olmalı.

EXEC master..xp_CMDShell 'ISQL -L'

Eğer yukarıdaki çalıştırılmak istendiğinde

Msg 15281, Level 16, State 1, Procedure xp_cmdshell, Line 1
SQL Server blocked access to procedure 'sys.xp_cmdshell' of component 'xp_cmdshell' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'xp_cmdshell' by using sp_configure. For more information about enabling 'xp_cmdshell', see "Surface Area Configuration" in SQL Server Books Online.

hatası alınıyorsa, xp_cmdShell önce aktif edilmeli. Bu kısmı burada buldum.

EXEC sp_configure 'show advanced options', 1
RECONFIGURE
GO

-- xp_cmdshell özelliğini aktif edelim
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE
GO


Artık EXEC master..xp_CMDShell 'ISQL -L' çalıştırıldığında sonuç aşapıdaki gibi olacaktır:


Şimdi batch dosyamızda oluşturulan bak dosyamızı sıkıştırabiliriz. Çeşitli konsol sıkıştırma komutları ile bunu yapabiliriz ama COMPACT komutu windows 2000 ile gelmiş fena sıkıştırmayan bir komut. 10.639 Kb lik dosyayı 4.1 MB a sıkıştırdı (winrar 1.2 kadar sıkıştırmıştı da neyse)


COMPACT /C C:\Projeler\db_backup\DenemeDb.bak
pause


Şimdi bu batch dosyayı çağırma işine bakalım: