_ | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁
FrontPage › 襦蠏誤殊蟆曙

Contents

1 2005 伎
2 2000
3


1 2005 伎 #

use master
go

create database test
go

/*

net stop mssqlserver
del C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\test_log.LDF
net start mssqlserver

*/

select 
	name
,	status 
from master.sys.sysdatabases
where name = 'test'

/*
--1073741824 = cleanly shutdown

name  status
----- -----------
test  1073807360
*/ 

alter database test set emergency
alter database test rebuild log on (name=test_log, filename='c:\test_log.ldf')

exec sp_dboption 'test', 'single user', 'true' 
DBCC CHECKDB ('test', REPAIR_ALLOW_DATA_LOSS)
exec sp_dboption 'test', 'single user', 'false' 

--襦蠏誤殊 れ 殊!!
--dir c:\test_log.ldf

alter database ods set multi_user

* 襷 覓語螳 DB襯 覿襴る, 螳 企 DB襯 燕 SQL Server 觜るゼ 譬襭 覓語 DB 一危 殊 覦蠖豺螳 讌覃 .

2 2000 #

--Suspect!! 
  
USE master
GO 
EXEC sp_configure 'allow updates', 1
RECONFIGURE WITH OVERRIDE
GO 
UPDATE master..sysdatabases SET status = 32768 
WHERE name = 'act'
GO 
UPDATE master..sysdatabases SET status = 32768 
WHERE name = 'etc'
GO 
UPDATE master..sysdatabases SET status = 32768 
WHERE name = 'mat'
GO 
UPDATE master..sysdatabases SET status = 32768 
WHERE name = 'pay'
GO 
UPDATE master..sysdatabases SET status = 32768 
WHERE name = 'sal'
GO 
USE master
GO
DBCC REBUILD_LOG('act','E:\PKFC\act\act_log.LDF')
GO 
DBCC REBUILD_LOG('etc','E:\PKFC\etc\etc_log.LDF')
GO 
DBCC REBUILD_LOG('mat','E:\PKFC\mat\mat_log.LDF')
GO 
DBCC REBUILD_LOG('pay','E:\PKFC\pay\pay_log.LDF')
GO 
DBCC REBUILD_LOG('sal','E:\PKFC\sal\sal_log.LDF')
GO 
exec sp_resetstatus 'act'
GO 
exec sp_resetstatus 'etc'
GO 
exec sp_resetstatus 'mat'
GO 
exec sp_resetstatus 'pay'
GO 
exec sp_resetstatus 'sal'
GO 
EXEC sp_configure 'allow updates', 0
RECONFIGURE WITH OVERRIDE
GO 
  
DBCC CHECKDB('act')
GO
DBCC CHECKDB('etc')
GO
DBCC CHECKDB('mat')
GO
DBCC CHECKDB('pay')
GO
DBCC CHECKDB('sal')
GO 

3 #

  • Microsoft SQL Server 2000
  • Microsoft SQL Server 2005
蠍 蠍郁鍵..
企: : るジ讓曙 襦螻豺 企Ν 譯殊語. 襦螻豺
EditText : Print : Mobile : FindPage : DeletePage : LikePages : Powered by MoniWiki : Last modified 2018-04-13 23:12:53

願 覦襦 螳企. 螻 襦 企螻 襷 蠍 襴 螳 螳 磯 10 蟇碁Π. (A. 豺企)