'Photograph by .. > 일상' 카테고리의 다른 글
Gitzo 1541T + 1781QR (0) | 2010.09.09 |
---|---|
인셉션 결말은(?) - 타임스퀘어 (0) | 2010.08.15 |
P&I 2010 모델... (0) | 2010.08.15 |
시간아 먼저가라 ... - 헤이리 (0) | 2010.08.15 |
파주 헤이리 (0) | 2010.08.09 |
Gitzo 1541T + 1781QR (0) | 2010.09.09 |
---|---|
인셉션 결말은(?) - 타임스퀘어 (0) | 2010.08.15 |
P&I 2010 모델... (0) | 2010.08.15 |
시간아 먼저가라 ... - 헤이리 (0) | 2010.08.15 |
파주 헤이리 (0) | 2010.08.09 |
인셉션 결말은(?) - 타임스퀘어 (0) | 2010.08.15 |
---|---|
양재 시민의숲 (1) | 2010.08.15 |
시간아 먼저가라 ... - 헤이리 (0) | 2010.08.15 |
파주 헤이리 (0) | 2010.08.09 |
파주 헤이리 (휴식) (1) | 2010.08.09 |
양재 시민의숲 (1) | 2010.08.15 |
---|---|
P&I 2010 모델... (0) | 2010.08.15 |
파주 헤이리 (0) | 2010.08.09 |
파주 헤이리 (휴식) (1) | 2010.08.09 |
비오는날 (0) | 2010.08.09 |
/*
Delete Del Table
*/
declare @tblName varchar(300)
declare curTblName
cursor fast_forward
for
select TABLE_NAME
from srvDB.INFORMATION_SCHEMA.tables where TABLE_NAME like '%삭제%'
open curTblName
fetch next from curTblName
into @tblName
while @@FETCH_STATUS
= 0
begin
exec ('drop table ' + @tblName)
fetch next from curTblName
into
@tblName
end
close curTblName
deallocate curTblName
/*
Delete SP
*/
declare @prcName
varchar(300)
declare curPrcName
cursor fast_forward
for
select ROUTINE_NAME
from
srvDB.INFORMATION_SCHEMA.ROUTINES
where ROUTINE_NAME like '%삭제%'
open curPrcName
fetch next from curPrcName
into @prcName
while @@FETCH_STATUS
= 0
begin
exec ('drop proc ' + @prcName)
fetch next from curPrcName
into
@prcName
end
close curPrcName
deallocate curPrcName
Understanding How Restore and Recovery of Backups Work in SQL Server 2005 (0) | 2010.08.19 |
---|---|
sp_readerrorlog (xp_readerrorlog) (0) | 2010.08.17 |
버전 호환성 Upgrade 작업 후 해야할 작업 (0) | 2010.08.12 |
SP_Helpindex2 (0) | 2010.08.11 |
DB 파일 사용상태 쿼리 (0) | 2010.08.06 |
SQL Server 데이터베이스 엔진을 SQL Server 2008로 업그레이드할 수 있습니다. 지원되는 업그레이드 경로에 대한 자세한
내용은
SQL Server 설치 프로그램은 최소한의 사용자의 개입만으로 이전 버전의 SQL Server를 업그레이드할 수 있습니다. 업그레이드 프로세스를 사전에 제대로 준비하고 잘 이해하면 문제 발생을 방지할 수 있고 문제가 발생하더라도 보다 쉽게 해결할 수 있습니다.
이 항목에서는 업그레이드 프로세스를 준비하고 이해하는 데 필요한 다음과 같은 정보를 제공합니다.
데이터베이스 엔진을 업그레이드하기 전에
중요: |
---|
한 버전의 SQL Server에서 다른 버전으로 업그레이드하기 전에 현재 사용 중인 기능이 업그레이드할 버전에서 지원되는지 확인하십시오. |
이전 SQL Server 버전에서의 업그레이드는 SQL Server 설치 프로그램에서 지원됩니다. 이전 SQL Server 버전에서 데이터베이스를 마이그레이션할 수도 있습니다. 한 SQL Server 인스턴스에서 같은 컴퓨터에 있는 다른 인스턴스로, 또는 다른 컴퓨터에 있는 SQL Server 인스턴스에서 마이그레이션할 수 있습니다. 마이그레이션 옵션에는 데이터베이스 복사 마법사, 백업 및 복원 기능, SQL Server 2005 Integration Services 가져오기 및 내보내기 마법사, 대량 내보내기/대량 가져오기 방법의 사용이 포함됩니다.
데이터베이스 엔진을 업그레이드하기 전에 다음을 수행해야 합니다.
SQL Server를 업그레이드하기 전에 다음 사항을 검토하고 변경합니다.
버전 업그레이드로 SQL Server 2000 또는 SQL Server 2005 설치를 덮어쓸 수 있습니다. SQL Server 설치 프로그램을 실행할 때 이전 버전의 SQL Server가 검색되면 이전의 모든 SQL Server 프로그램 파일이 업그레이드되고 이전 SQL Server 인스턴스에 저장된 모든 데이터는 그대로 보존됩니다. 또한 이전 버전의 SQL Server 온라인 설명서도 변경되지 않고 컴퓨터에 남아 있습니다.
주의: |
---|
SQL Server를 업그레이드하면 이전 SQL Server 인스턴스를 덮어쓰게 되므로 이러한 인스턴스는 시스템에 더 이상 존재하지 않게 됩니다. 따라서 업그레이드 전에 이전 SQL Server 인스턴스와 연결된 SQL Server 데이터베이스 및 기타 개체를 백업하십시오. |
SQL Server 설치 마법사를 사용하여 데이터베이스 엔진을 업그레이드할 수 있습니다.
주의: |
---|
컴퓨터에 SQL Server 2000 관리 도구와 SQL Server 2008 기본 인스턴스가 설치되어 있으면 SQL Server 설치 프로그램을 통해 SQL Server 2000 기본 인스턴스를 설치할 수 있습니다. 그러나 이렇게 하면 설치된 SQL Server 2008 인스턴스를 사용할 수 없게 됩니다. 따라서 SQL Server 2000 관리 도구와 SQL Server 2008 기본 인스턴스가 컴퓨터에 이미 있는 경우에는 SQL Server 기본 인스턴스를 설치하지 마십시오. |
업그레이드 후에는 tempdb, model, msdb 및 Resource 데이터베이스의 호환성 수준이 100으로 설정됩니다. master 시스템 데이터베이스는 업그레이드 이전의 호환성 수준이 80 미만이 아니었다면 이전 호환성 수준으로 유지됩니다. master의 호환성 수준이 업그레이드 이전에 80 미만이었다면 업그레이드 후에는 80으로 설정됩니다.
사용자 데이터베이스의 호환성 수준이 업그레이드 이전에 80 또는 90이었다면 업그레이드 후에도 동일하게 유지됩니다. 업그레이드 이전에 호환성 수준이 70 이하였다면 업그레이드된 데이터베이스에서는 SQL Server 2008에서 지원되는 가장 낮은 호환성 수준인 80으로 설정됩니다.
참고: |
---|
새 사용자 데이터베이스는 model 데이터베이스의 호환성 수준을 상속합니다. |
SQL Server의 백업 및 복원 기능이나 분리 및 연결 기능을 사용하여 사용자 데이터베이스를 SQL Server 인스턴스로 이동할 수 있습니다.
중요: |
---|
원본 서버와 대상 서버에서 이름이 같은 데이터베이스는 이동하거나 복사할 수 없습니다. 이 경우 "이미 존재하는 것"으로 인식됩니다. |
자세한 내용은
데이터베이스 엔진을 업그레이드한 후에 다음 태스크를 완료하십시오.
업그레이드 전에 전체 텍스트 카탈로그가 설정 또는 해제된 것으로 표시된 데이터베이스는 업그레이드 후에도 해당 상태가 유지됩니다. 전체 텍스트 카탈로그가 설정된 데이터베이스의 경우 업그레이드 후에 전체 텍스트 카탈로그가 자동으로 다시 작성되고 채워집니다. 이 작업에는 시간과 리소스가 많이 소요됩니다. 전체 텍스트 인덱싱 작업을 일시적으로 중지하려면 다음 문을 실행합니다.
코드 복사 | |
---|---|
EXEC sp_fulltext_service 'pause_indexing', 1 |
전체 텍스트 인덱스 채우기를 재개하려면 다음 문을 실행합니다.
코드 복사 | |
---|---|
EXEC sp_fulltext_service 'pause_indexing', 0 |
sp_readerrorlog (xp_readerrorlog) (0) | 2010.08.17 |
---|---|
특정이름의 테이블/SP 등등 삭제 (0) | 2010.08.13 |
SP_Helpindex2 (0) | 2010.08.11 |
DB 파일 사용상태 쿼리 (0) | 2010.08.06 |
MSSQL 2008 설치 Video (Microsoft) (0) | 2010.07.23 |
/*============================================================================
File: sp_helpindex2.sql
Summary: So, what are the included columns?!
This
is a MODIFIED sp_helpindex script that includes INCLUDEd
columns
AND filtered index columns.
Date: April 2008
SQL Server *2008*
Version: 10.00.1300.13 (SQL Server 2008 CTP6)
------------------------------------------------------------------------------
Written by
Kimberly L. Tripp, SYSolutions, Inc.
For more scripts
and sample code, check out
http://www.SQLskills.com
This script is
intended only as a supplement to demos and lectures
given by
SQLskills instructors.
THIS CODE AND
INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER
EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR
PURPOSE.
============================================================================*/
USE master
go
create procedure
sp_helpindex2
@objname nvarchar(776) -- the table to check for indexes
as
-- Updated in April 2008 by Kimberly L. Tripp,
SQLskills.com
-- to add included columns AND filter_definition to the
output.
-- See Kimberly's blog for updates and/or additional
information
-- http://www.SQLskills.com/blogs/Kimberly
--
PRELIM
set
nocount on
declare
@objid int, -- the object id of the table
@indid
smallint, -- the index id of
an index
@groupid
int, -- the filegroup id of an index
@indname
sysname,
@groupname
sysname,
@status
int,
@keys
nvarchar(2126), --Length (16*max_identifierLength)+(15*2)+(16*3)
@inc_columns nvarchar(max),
@inc_Count smallint,
@loop_inc_Count smallint,
@dbname sysname,
@ignore_dup_key bit,
@is_unique bit,
@is_hypothetical bit,
@is_primary_key bit,
@is_unique_key
bit,
@auto_created bit,
@no_recompute bit,
@filter_definition nvarchar(max)
--
Check to see that the object names are local to the current database.
select
@dbname = parsename(@objname,3)
if
@dbname is null
select @dbname = db_name()
else
if @dbname <>
db_name()
begin
raiserror(15250,-1,-1)
return (1)
end
--
Check to see the the table exists and initialize @objid.
select
@objid = object_id(@objname)
if
@objid is NULL
begin
raiserror(15009,-1,-1,@objname,@dbname)
return (1)
end
--
OPEN CURSOR OVER INDEXES (skip stats: bug shiloh_51196)
declare
ms_crs_ind cursor local
static for
select i.index_id, i.data_space_id, i.name,
i.ignore_dup_key, i.is_unique, i.is_hypothetical, i.is_primary_key, i.is_unique_constraint,
s.auto_created, s.no_recompute, i.filter_definition
from sys.indexes i join sys.stats s
on i.object_id = s.object_id and i.index_id = s.stats_id
where i.object_id = @objid
open
ms_crs_ind
fetch
ms_crs_ind into @indid,
@groupid, @indname,
@ignore_dup_key, @is_unique, @is_hypothetical,
@is_primary_key, @is_unique_key,
@auto_created, @no_recompute, @filter_definition
--
IF NO INDEX, QUIT
if
@@fetch_status <
0
begin
deallocate ms_crs_ind
raiserror(15472,-1,-1,@objname) -- Object does not have any indexes.
return (0)
end
--
create temp tables
CREATE
TABLE #spindtab
(
index_name sysname collate database_default NOT
NULL,
index_id int,
ignore_dup_key bit,
is_unique bit,
is_hypothetical bit,
is_primary_key bit,
is_unique_key bit,
auto_created bit,
no_recompute bit,
groupname sysname collate database_default NULL,
index_keys nvarchar(2126) collate database_default NOT
NULL, -- see @keys
above for length descr
filter_definition nvarchar(max),
inc_Count smallint,
inc_columns nvarchar(max)
)
CREATE
TABLE #IncludedColumns
( RowNumber smallint,
[Name] nvarchar(128)
)
--
Now check out each index, figure out its type and keys and
-- save the info in a temporary table that
we'll print out at the end.
while
@@fetch_status >=
0
begin
-- First we'll figure out what the keys are.
declare @i int, @thiskey nvarchar(131) -- 128+3
select @keys = index_col(@objname, @indid, 1), @i = 2
if (indexkey_property(@objid, @indid, 1, 'isdescending') = 1)
select @keys =
@keys + '(-)'
select @thiskey = index_col(@objname, @indid, @i)
if ((@thiskey is not null) and (indexkey_property(@objid, @indid, @i, 'isdescending') = 1))
select @thiskey =
@thiskey + '(-)'
while (@thiskey is not null )
begin
select @keys = @keys + ', ' + @thiskey, @i = @i + 1
select @thiskey = index_col(@objname, @indid, @i)
if ((@thiskey is not null) and (indexkey_property(@objid, @indid, @i, 'isdescending') = 1))
select @thiskey =
@thiskey + '(-)'
end
-- Second, we'll figure out what the included columns are.
SELECT @inc_Count = count(*)
FROM
sys.tables AS tbl
INNER JOIN sys.indexes AS si
ON (si.index_id > 0
and si.is_hypothetical
= 0)
AND (si.object_id=tbl.object_id)
INNER JOIN sys.index_columns AS ic
ON (ic.column_id > 0
and (ic.key_ordinal > 0 or ic.partition_ordinal =
0 or ic.is_included_column
!= 0))
AND (ic.index_id=CAST(si.index_id AS int) AND ic.object_id=si.object_id)
INNER JOIN sys.columns AS clmns
ON clmns.object_id = ic.object_id
and clmns.column_id = ic.column_id
WHERE ic.is_included_column
= 1 and
(si.index_id = @indid) and
(tbl.object_id= @objid)
IF @inc_Count > 0
INSERT #IncludedColumns
SELECT ROW_NUMBER() OVER (ORDER BY clmns.column_id)
, clmns.name
FROM
sys.tables AS tbl
INNER JOIN sys.indexes AS si
ON (si.index_id > 0
and si.is_hypothetical
= 0)
AND (si.object_id=tbl.object_id)
INNER JOIN sys.index_columns AS ic
ON (ic.column_id > 0
and (ic.key_ordinal > 0 or ic.partition_ordinal =
0 or ic.is_included_column
!= 0))
AND (ic.index_id=CAST(si.index_id AS int) AND ic.object_id=si.object_id)
INNER JOIN sys.columns AS clmns
ON clmns.object_id = ic.object_id
and clmns.column_id = ic.column_id
WHERE ic.is_included_column
= 1 and
(si.index_id = @indid) and
(tbl.object_id= @objid)
SELECT @inc_columns =
[Name] FROM #IncludedColumns WHERE RowNumber = 1
SET @loop_inc_Count =
1
WHILE @loop_inc_Count <
@inc_Count
BEGIN
SELECT @inc_columns =
@inc_columns + ', '
+ [Name]
FROM #IncludedColumns WHERE
RowNumber = @loop_inc_Count + 1
SET @loop_inc_Count =
@loop_inc_Count + 1
END
select @groupname = null
select @groupname =
name from sys.data_spaces where data_space_id =
@groupid
-- INSERT ROW FOR INDEX
insert into #spindtab
values (@indname, @indid,
@ignore_dup_key, @is_unique, @is_hypothetical,
@is_primary_key, @is_unique_key,
@auto_created, @no_recompute, @groupname, @keys, @filter_definition,
@inc_Count, @inc_columns)
-- Next index
fetch ms_crs_ind into
@indid, @groupid,
@indname, @ignore_dup_key, @is_unique,
@is_hypothetical,
@is_primary_key, @is_unique_key,
@auto_created, @no_recompute, @filter_definition
end
deallocate
ms_crs_ind
--
DISPLAY THE RESULTS
select
'index_name' =
index_name,
'index_description' = convert(varchar(210), --bits 16 off, 1, 2,
16777216 on, located on group
case when index_id = 1 then 'clustered' else 'nonclustered' end
+ case when ignore_dup_key <>0 then ', ignore duplicate keys' else
'' end
+ case when is_unique <>0
then ', unique' else '' end
+ case when is_hypothetical <>0
then ', hypothetical'
else '' end
+ case when is_primary_key <>0
then ', primary key'
else '' end
+ case when is_unique_key <>0
then ', unique key'
else '' end
+ case when auto_created <>0
then ', auto create'
else '' end
+ case when no_recompute <>0
then ', stats no
recompute' else ''
end
+ ' located on ' + groupname),
'index_keys' =
index_keys,
--'num_included_columns' = inc_Count,
'included_columns' =
inc_columns,
'filter_definition' =
filter_definition
from
#spindtab
order
by index_name
return
(0) -- sp_helpindexwinc2
go
exec sys.sp_MS_marksystemobject 'sp_helpindex2'
특정이름의 테이블/SP 등등 삭제 (0) | 2010.08.13 |
---|---|
버전 호환성 Upgrade 작업 후 해야할 작업 (0) | 2010.08.12 |
DB 파일 사용상태 쿼리 (0) | 2010.08.06 |
MSSQL 2008 설치 Video (Microsoft) (0) | 2010.07.23 |
[SSRS] Microsoft Video (0) | 2010.07.23 |
P&I 2010 모델... (0) | 2010.08.15 |
---|---|
시간아 먼저가라 ... - 헤이리 (0) | 2010.08.15 |
파주 헤이리 (휴식) (1) | 2010.08.09 |
비오는날 (0) | 2010.08.09 |
HP mini 5101 Driver Energystar (0) | 2010.06.27 |
시간아 먼저가라 ... - 헤이리 (0) | 2010.08.15 |
---|---|
파주 헤이리 (0) | 2010.08.09 |
비오는날 (0) | 2010.08.09 |
HP mini 5101 Driver Energystar (0) | 2010.06.27 |
HP mini 5101 Driver (0) | 2010.06.27 |
파주 헤이리 (0) | 2010.08.09 |
---|---|
파주 헤이리 (휴식) (1) | 2010.08.09 |
HP mini 5101 Driver Energystar (0) | 2010.06.27 |
HP mini 5101 Driver (0) | 2010.06.27 |
아이팟에서도 블로깅이 (1) | 2010.06.23 |
버전 호환성 Upgrade 작업 후 해야할 작업 (0) | 2010.08.12 |
---|---|
SP_Helpindex2 (0) | 2010.08.11 |
MSSQL 2008 설치 Video (Microsoft) (0) | 2010.07.23 |
[SSRS] Microsoft Video (0) | 2010.07.23 |
[SSAS] Microsoft Video (0) | 2010.07.23 |