Post Pacific

Post Pacific (https://postpacific.loc-online.com/index.php)
-   Темы без сохранившегося раздела (https://postpacific.loc-online.com/forumdisplay.php?f=10001)
-   -   lin2world_Log.LDF (https://postpacific.loc-online.com/showthread.php?t=1484)

dosmac 17.08.2005 06:19

lin2world_Log.LDF
 
The file lin2world_Log.LDF (Lin2world transaction file) grows to 30+ GB in size, is there any way to disable/limit this file? because in the SQL i have tried setting a limit, and it automatically raises the limit of the file.

darkagent 17.08.2005 06:27

this is an sql-transaction log, and you can limit it (db properties -> transaction log-> limit to..) but you can't delete it or shrink. then this file grow up to a limit - it raises many errors in sql (like nonwriteable data). When i meet this problem, i tried to limit this file.. and as result - lin2world became read only.. =(
only way that i see - clearing garbage data and adding more free space...
but you can try to delete this file then MSSQL is stopped. make backup before =)

hr 17.08.2005 07:17

Code:

Backup log lin2world with truncate_only
Go

Use lin2world
DBCC Shrinkfile (lin2world_log, 1)
Go

Wonderful things around you....

HF 17.08.2005 07:35

Or

Code:

DBCC SHRINKDATABASE([lin2world],2)
BACKUP LOG [lin2world] WITH TRUNCATE_ONLY
DBCC SHRINKDATABASE([lin2world],2)

cycle script

dosmac 17.08.2005 09:27

How do i run these scripts? I'm a n00b with sql :(

djvogans 17.08.2005 09:47

Here u go :

1.- Stop your SQL Server Service Manager and manually delete the lin2world_log.LDF file

2.- Restart The SQL Server Service Manager, you can see the database in "suspictious mode" or something like that

3.- Open query analyzer

4.- Now we are going to change that "suspictious mode" to emergency mode, use that code:
Code:
--------------------------------
USE master
go
sp_configure 'allow updates',1
go
reconfigure with override
go
update sysdatabases set
status=-32768 where dbid=DB_ID('Lin2World')
go
sp_configure 'allow updates',0
go
reconfigure with override
go
------------------------------------------

5.- Now we are going to rebuild the transaction log file:
Code:
-------------------------------------------------
USE master
go
dbcc rebuild_log('Lin2World',C:\Program Files\Microsoft SQL Server\MSSQL\Data\lin2world_log.ldf')
go
dbcc checkdb('Lin2World')
----------------------------------------------------

If you have the database files in another directory, just change C:\Program Files\Microsoft SQL Server\MSSQL\Data\lin2world_log.ldf' for yours.

6.- Now your Lin2World database only allows access to DBO, to enable multiple logins use that code:
Code:
------------------------------------------------------
alter database Lin2World
set multi_user
------------------------------------------------------


All times are GMT. The time now is 15:40.