14. October 2009 11:49
By
Flame
In
DB
Для уменьшения размера transaction log в MS SQL Server можно воспользоваться следующими командами:
USE testDB
--Узнаем названия файлов
SELECT file_id, name
FROM sys.database_files;
ALTER DATABASE testDB
SET RECOVERY SIMPLE;
--Урезаем размер до 100 Mb
DBCC SHRINKFILE(testDB_log, 100)
ALTER DATABASE testDB
SET RECOVERY FULL;
P.S. Для того что бы оценить сколько используется реально места для transaction log выполняем следующие действия в Management Studio <правый крыс> на базу -> Reports -> Standart Reports -> Disk Usage = диаграмма использования дискового пространства.
Currently rated 4.0 by 1 people
- Currently 4/5 Stars.
- 1
- 2
- 3
- 4
- 5
Tags: ms sql
7. October 2009 17:35
By
Flame
In
Windows Mobile
В Windows Mobile, для того чтобы выяснить как называется съемный диск в системе можно воспользоваться следующим методом:
private string GetStorageCard()
{
//initialize the path as an empty string
string firstCard = "";
System.IO.DirectoryInfo di = new System.IO.DirectoryInfo("\\");
System.IO.FileSystemInfo[] fsi = di.GetFileSystemInfos();
//iterate through them
for (int x = 0; x < fsi.Length; x++)
{
//check to see if this is a temporary storage card (e.g. SD card)
if ((fsi[x].Attributes & System.IO.FileAttributes.Temporary) == System.IO.FileAttributes.Temporary)
{
//if so, return the path
firstCard = fsi[x].FullName;
}
}
return firstCard;
}
P.S.
Не забываем подключать using System.IO;