본문 바로가기

Engineering/DB

MSSQL 2005 관리자 강좌_3일차

728x90

backup database test

to disk = 'c:\temp\test_20101125.bak'
with stats=5
 , noinit

restore headeronly
from disk = 'c:\temp\test_20101125.bak'

restore filelistonly
from disk = 'c:\temp\test_20101125.bak'

restore labelonly
from disk = 'c:\temp\test_20101125.bak'

restore verifyonly
from disk = 'c:\temp\test_20101125.bak'


use test
go

create table tbl (col int)
insert into tbl values (1)
select * from tbl

backup database test
to disk = 'c:\temp\test1.bak'

insert int tbl values (2)

backup log test
to disk = 'c:\temp\test2.trn'

sp_readerrorlog 0
-----------------------------------------------
---- 1. restore full back
---- 2. restore diff back
---- 3. all restore tran back
backup log test
to disk = 'c:\temp\test3.trn'
with no_truncate
---------------------------------------------

restore database test
from disk = 'c:\temp\test1.bak'
with norecovery

restore log test
from disk = 'c:\temp\test2.trn'
with recovery

-- norecovery 처음
-- last : recovery option 마지막


* 스크립트 다운로드 사이트 :

http://blog.daum.net/sqlmania