AdventureWorks 예제 데이터베이스를 활용한 SQL Server 2005 학습 가이드


--------------------------------------------------------------------------

1. 최신(2006.04월 업데이트) 예제 데이터베이스와 샘플을 다운로드 받는다


http://www.microsoft.com/downloads/details.aspx?familyid=e719ecf7-9f46-4312-af89-6ad8702e4e6e&displaylang=en


2. 예제데이터베이스 설치/제거방법


- AdventureWorksDB.msi(OLTP용 예제)  --> BI 용 예제는 AdventureWorksBI.msi

AdventureWorksDB.msi 에는 AdventureWorks OLTP 데이터베이스 파일이 포함되어 있습니다. 새로운 버전을 설치하기 전에 이전에 설치된 AdventureWorks 데이터베이스는 완전히 제거해야 합니다.


이전 버전 AdventureWorks 데이터베이스를 제거하려면,

1) AdventureWorks 데이터베이스를 Drop 한 다음,

2) 프로그램 추가/제거 애플릿을 사용하여 AdventureWorksDB를 선택하고 제거를 클릭합니다.


Setup 프로그램을 사용하여 AdventureWorks 데이터베이스를 제거하기 위해서는

1) AdventureWorks 데이터베이스를 Drop 한 다음,

2) 프로그램 추가/제거 애플릿에서, MS SQL Server 2005를 선택하고 변경을 클릭합니다.

3) 구성요소 선택에서 워크스테이션 구성요소를 선택한 다음, 다음을 클릭합니다.

4) SQL Server 설치 마법사 첫 화면이 나타나면, 다음을 클릭합니다.

5) 시스템 구성 검사가 나타나면, 다음을 클릭합니다.

6) 인스턴스 변경 또는 제거 화면이 나타나면, 설치된 구성 요소 변경을 클릭합니다.

7) 기능 선택화면에서, 설명서, 예제 및 예제데이터베이스 노트를 확장합니다.

8) 예제 코드 및 응용 프로그램을 선택합니다.

9) 예제 데이터베이스를 선택하고, "모든 기능을 사용할 수 없습니다."를 선택하고, 다음을클릭합니다.

10) 설치를 클릭하여, 설치 마법사를 완료합니다.


SQL Server 인스턴스가 하나 이상 설치되어 있는 경우에서는 MSI에서 지정하는 디렉토리를 해당 인스턴스의 master 데이터베이스가 위치하는 디렉토리와 동일하게 수정해 주어야 합니다. master 데이터베이스의 위치를 확인하기 위해서는, Express Manager나 SQL Server Management Studio에서 AdventureWorks 데이터베이스를 설치하고자 하는 인스턴스에 연결한 다음, 다음 쿼리를 실행하면 됩니다.

select physical_name from sys.database_files where name = 'master'

 

예제 데이터베이스와 예제 코드를 사용하기 위해서는, Microsoft SQL Server 2005 Express Edition이나 Microsoft SQL Server 2005의 인스턴스에 해당 데이터베이스 파일을 연결(attach)해야 합니다. SQLCMD나 SQL Server Management Studio를 사용하여, 다음 예제와 같은 쿼리를 실행하여 AdventureWorks 데이터베이스를 연결할 수 있습니다.

exec sp_attach_db @dbname=N'AdventureWorks', @filename1=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_Data.mdf', @filename2=N'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\AdventureWorks_log.ldf'

 

AdventureWorks 데이터베이스를 다른 디렉토리나 드라이브에 설치하기 위해서는, 각자의 환경에 따라 sp_attach_db 저장 프로시저에 입력해야 하는 매개변수를 적절하게 수정해 주어야 합니다.


3. 2006.04월 예제 코드에 추가된 내용


SqlServerSamples.msi에는 Microsoft SQL Server 2005와 Microsoft SQL Server 2005 Express Edition에 대한 예제코드가 포함되어 있습니다. Visual C#과 Visual Basic.NET 예제로 개발된 코드 중 대부분은 예제에 대한 설명에 언급된 것과 같이 Microsoft SQL Server 2005 Express Edition에서는 동작하지 않습니다.


예제를 설치하기 위해서는 SqlServerSamples.msi를 실행하면 됩니다. 설치시 다른 경로를 지정하지 않는다면, 기본값으로, [drive:]\Program Files\Microsoft SQL Server\90\Samples에 설치됩니다.


2006년 4월에 추가된 예제 코드는 다음과 같은 것이 있습니다.

Analysis Services:

 

Data Access (OLEDB)

 

Data Access (ODBC)

 

Common Language Runtime (CLR) Integration:

 

Integration Services

 

Replication


CLR 통합과 관련된 2005년 12 월 업데이트 내용도 포함되어 있습니다.

 

Server Management Objects (SMO):

 

Integration Services:

 

Replication:

 

Reporting Services


4.

아래는 SQL 2005 AdventureWorks  예제 데이터베이스에 대한 내용을 다루는 블로그에 기재된 내용입니다.


참고하시기 바랍니다.


원문출처...

=====================================================


http://blogs.msdn.com/bonniefe/


Welcome everyone! The purpose of this blog is to chat about the samples and sample databases for Microsoft SQL Server.  I'll be talking about some of the cool samples already shipping, and let you know about updates and new samples as time goes by.  Please participate by sending in feedback on existing samples and suggestions for new ones.

If you have Microsoft SQL Server 2005, read the topic "Installing Samples" in Microsoft SQL Server Books Online (Books Online) to learn how to install the samples which ship with that product.  You do have to go through some extra steps during installation of SQL Server to get samples installed.  In particular, on the page where you select what to install use the "Advanced" button to activate the control which allows you to select the samples for installation.

Even better, you can get the latest version of the samples on the web at http://msdn.microsoft.com/sql/downloads/samples/default.aspx.  Right the December 2005 refresh is available there.  You'll find MSIs with the samples in them, and also MSIs with various sample databases.  Be sure to pick out the correct MSI for your computer's processor (x86, x64, or IA64).

At http://www.microsoft.com/downloads/details.aspx?familyid=e719ecf7-9f46-4312-af89-6ad8702e4e6e&displaylang=en you'll find the actual MSIs, and also two important documents, GettingStartedWithSQLSamples.htm which gives you a top 10 list of things to know about the samples, and SQLServerDatabasesAndSamplesOverview.htm which provides detailed information about all the samples and sample databases.

The readme files for the samples and a lot of other sample information is located in Books Online starting at [SQL Server 2005 Books Online / Samples and Sample Databases].

The samples cover the gamut of SQL Server technologies: CLR Integration, SMO, XML, Administration, Data Access, Full Text Search, Service Broker, Analysis Services, Integration Services, Notification Services, Reporting Services, Replication.  The Integrated Samples show how to combine several of the above technologies to solve a particular business problem.

The AdventureWorks sample database provides an example of an enterprise class database schema for manufacturing, sales, inventory, purchasing, and human resource scenarios.  The AdventureWorksDW and AdventureWorksAS sample databases demonstrate how to design and use a data warehouse and an analysis services project to gather business intelligence.

Thanks for taking a look at the samples.  I hope they help you get up to speed faster on SQL Server 2005 and make your job easier and more fun.

--Bonnie

Posted by 나비:D
:
BLOG main image
by 나비:D

공지사항

카테고리

분류 전체보기 (278)
Programming? (0)
---------------------------.. (0)
나비의삽질 (5)
Application (177)
SQL (51)
Web (27)
etc. (14)
Omnia (0)
---------------------------.. (0)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

글 보관함

달력

«   2024/04   »
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 29 30
Total :
Today : Yesterday :