블로그 이미지
bedbmsguru

Notice

Recent Post

Recent Comment

Recent Trackback

Archive

calendar

1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
  • total
  • today
  • yesterday
2014. 1. 22. 11:46 Windows SERVER

2008 부터는 DISM을 이용하여 버전 업그레이드가 가능하다.


//업그레이드 가능한 리스트 보기

dism /online /get-targeteditions   


//업그레이드 적용

Dism /online /Set-Edition:ServerEnterprise /ProductKey:xxxxx-xxxxx-xxxxx-xxxxx-xxxxx



//진행화면 (종료후에 리부팅이 필요함)

Deployment Image Servicing and Management tool 

Version: 6.1.7600.16385 

Image Version: 6.1.7600.16385

Starting to update components... 

Starting to install product key... 

Finished installing product key.

Removing package Microsoft-Windows-ServerStandardEdition~31bf3856ad364e35~amd64~~6.1.7601.17514

[==========================100.0%==========================]

Finished updating components. 

Starting to apply edition-specific settings... 

Restart Windows to complete this operation.

Do you want to restart the computer now (Y/N)?

'Windows SERVER' 카테고리의 다른 글

ROBOCOPY사용법  (0) 2018.10.26
posted by bedbmsguru
2013. 11. 11. 10:41 공부용 링크

--IP로 접속제한 하기

http://www.sqlservercentral.com/articles/Security/66151/

'공부용 링크' 카테고리의 다른 글

One DMV a Day series  (0) 2022.02.18
posted by bedbmsguru
2013. 10. 23. 18:02 SQL SERVER

장애로 비정상 종료된 DB를 로그없이 다른 SQL서버 Instance 에서 복원하는 방법





(1) SQL SERVER 2005 이상


1. 복원하고자 하는 database와 같은 이름을 가진 Database를 새로 생성



2. SQL서버를 중지한 다음 복원하려고 하는 MDF파일을 새로만들었던 MDF파일에 덮어쓴다.

그리고 LDF파일은 삭제한다.


3.해당 database를 emergency mode로 변경한다.

alter database ABC set emergency

alter database ABC set single_user -- 먼저 싱글유저 모드로 변경해야함


4. 새로운 로그파일을 생성한다.

alter database ABC rebuild log on

(Name=ABC_log,filename='C:\SQLDAT\ABC_log.ldf')


5. database를 online으로 변경

alter database ABC set online


6. DB를 체크 복구가능한 데이터 복구

DBCC CHECKDB('abc', REPAIR_REBUILD) WITH ALL_ERRORMSGS, NO_INFOMSGS


7.DB체크 결과를 토대로 테이블 복구


--데이터 손실없이 복구 가능한 테이블 복구

dbcc checktable('temp_aaa')


--복구불가능한 데이터는 버리고 테이블 복구

dbcc checktable('temp_aaa', REPAIR_ALLOW_DATA_LOSS) WITH ALL_ERRORMSGS, NO_INFOMSGS


alter database ABC set MULTI_user




(2) SQL SERVER 2000



1. 복원하고자 하는 database와 같은 이름을 가진 Database를 새로 생성

주의:MDF의 이름과 LDF의 이름은 복원하고자하는 DB의 이름과 같아야 한다.


2. SQL서버를 중지한 다음 복원하려고 하는 MDF파일을 새로만들었던 MDF파일에 덮어쓴다.

그리고 LDF파일은 삭제한다.


3. SQL SERVER를 시작하면 해당 Database는 '주의대상' 상태로 표시됨


4. master DB를 업데이트 가능한 상태로 만들어준다.

USE MASTER

GO

sp_CONFIGURE 'allow updates', 1

RECONFIGURE WITH OVERRIDE

GO


5. database의 모드를 emergency mode로 변경한다.

--이 쿼리는 Database의 현재 상태를 볼수 있다 (나중에 다시 복구를 위해 status 값을 기억해 둬야함)

SELECT *

FROM sysdatabases

WHERE name = 'yourdatabasename'


—-status 값을 update

BEGIN TRAN

UPDATE sysdatabases

SET status = 32768

WHERE name = 'yourdatabasename'

COMMIT TRAN


6.SQL SERVER 재시작한다.


7.아래의 DBCC 커맨드를 실행한다. 이 명령은 새 로그파일을 생성하는 명령이다.

주의:LDF의 이름은 새 서버에서 삭제한 이름과 같아야 한다.

DBCC TRACEON (3604)

DBCC REBUILD_LOG(yourdatabasename,'c:\yourdatabasename_log.ldf')

GO


8.주의대상 으로 된 database 상태를 변경한다.

sp_RESETSTATUS yourdatabasename



9. Database mode를 5번에서 저장했던 값으로 변경한다.

BEGIN

UPDATE sysdatabases

SET status = (value retrieved IN first query OF STEP 5)

WHERE name = 'yourdatabasename‘

COMMIT TRAN

GO



10.master DB를 업데이트 불가능하도록 다시 수정한다.

USE MASTER

GO

sp_CONFIGURE 'allow updates',0

RECONFIGURE WITH OVERRIDE

GO



8, 9, 10 단계를 진행하다 database가 사용중이라고 나올 경우 

sp_DBOPTION 'yourdatabasename', 'single user','true'  실행할 것

작업이 완료되면 

sp_DBOPTION 'yourdatabasename', 'single user','false' 실행




posted by bedbmsguru