1. Gioi thieu va cai dat SQL SERVER 2005 express tài liệu, giáo án, bài giảng , luận văn, luận án, đồ án, bài tập lớn về...
Trang 1Giới thiệu SQL SERVER 2005
Express Edition
TRẦN THỊ BẠCH HUỆ
2
Nội dung
Giới thiệu
Cài đặt
Đăng nhập SQL Server 2005 Express
Một số thao tác cơ bản
– Tạo mới database, tạo mới bảng
– Xoá bảng, xoá database
– Mở một query editor để viết câu lệnh SQL
3
Giới thiệu
SQL Server 2005 là một hệ quản trị CSDL quan hệ (RDBMS – Relational Database Management System) sử dụng Transact-SQL để trao đổi dữ liệu giữa client và server
Một số hệ quản trị khác như Oracle, Access, MySQL,…
4
Các phiên bản của SQL Server 2005:
– Enterprise
– Standard
– Workgroup
– Express
– Developer
– Compact
Trang 2 Enterprise:
– Chỉ hỗ trợ cho các hệ điều hành Windows Server
– Bao gồm tất cả các đặc tính của SQL Server
2005 và có khả năng xử lý giao dịch kinh doanh
trực tuyến và các ứng dụng data warehousing
– Hỗ trợ không giới hạn số lượng CPU, kích thước
Database, RAM (nhưng tùy thuộc vào kích thước
RAM tối đa mà HĐH hỗ trợ) và hỗ trợ trên các hệ
thống 64 bit
6
Standard:
– Chủ yếu hỗ trợ cho các hệ điều hành Windows
Server
– Bao gồm các tính năng cần thiết cho các giải
pháp thương mại điện tử, data warehousing và
line-of-bussiness
– Hỗ trợ tối đa 4 CPU
7
Workgroup:
– Bao gồm các tính năng cốt lõi của SQL Server
Đây là giải pháp quản trị dữ liệu cho các tổ chức nhỏ cần có một CSDL không giới hạn về kích thước cũng như số lượng người dùng
– Hỗ trợ 2 CPU và tối đa 3GB RAM
8
Express:
– Bản miễn phí, dễ sử dụng, nhẹ Bao gồm một số tính năng như SQL Server 2005 Reporting Services và SQL Server
2005 Management Studio Express
– Hỗ trợ tối đa 1CPU, 1GB RAM và kích thước database giới hạn trong 4GB
Tham khảo chi tiết tại link sau (ngày cung cấp link 9/5/2013):
http://technet.microsoft.com/en-US/library/ms345154(v=sql.90).aspx
Trang 3 Developer (có thể sử dụng trên Windows XP)
– Bao gồm tất cả các tính năng của phiên bản kinh doanh
(Enterprise Edition)
– Được dùng chủ yếu cho việc phát triển (development), test
và demo
– Bản miễn phí, dễ sử dụng
– Dành cho các nhà phát triển xây dựng các ứng dụng
Windows Desktop và di động, chạy trên tất cả các nền
Windows
10
Cài đặt SQL Server 2005 Express
Các yêu cầu hệ thống
Windows XP Service Pack (SP) 2 hoặc cao hơn Windows 2000 Professional SP4
Windows 2000 Server SP 4 hoặc cao hơn Windows Server 2003 Standard, Enterprise, hoặc Datacenter editions SP 1 hoặc cao hơn
Hệ điều hành
(Operating
System)
Trước khi cài SQL Server 2005 Express, cần phải cài NET Framework 2.0 trước
Framework
Pentium III 600-megahertz (MHz) hoặc cao hơn
Đề nghị: 1GHz hoặc cao hơn Processor
32 bit
11
CD-ROM hoặc DVD-ROM Drive
350 MB ổ cứng cho các cài đặt cơ bản
425 MB ổ cứng co việc cài SQL Server Books Online, SQL Server Mobile Books Online và CSDL mẫu (sample database)
Hard Disk
Tối thiểu 192 MB RAM; tốt nhất là 512MB trở lên Memory
Windows Server 2003 Web Edition SP1 Windows Small Business Server 2003 SP 1 hoặc cao hơn
Vista Home Basic và các phiên bản cao hơn (SQL Express SP1 và SQL Express Advanced SP2)
12
Microsoft Internet Explorer 6.0 SP1 hoặc cao hơn
Các yêu cầu khác
(other requirements)
Mouse, Keyboard Other devices
Super VGA (1,024x768) hoặc cao hơn Display
Tham khảo link sau (ngày cung cấp link 9/5/2013):
http://technet.microsoft.com/en-US/library/cc917692.aspx
Trang 4 Các bước cài đặt SQL Server Express
Các bước thực hiện ở các slide sau được lấy từ link
sau (ngày truy cập 9/5/2013)
http://technet.microsoft.com/en-US/library/ms143722(v=SQL.90).aspx)
14
Step 1: To begin installation, double-click
sqlexpr.exe
Step 2: On the End User License Agreement
page, read the license agreement, and then
select I accept the licensing terms and
conditions check box Click Next
15
16
Step 3: SQL Server Component Update
runs, installing the software required prior to
installing SQL Server Express Click Next
Trang 5 Step 4: The Welcome to the Microsoft SQL
Server Installation Wizard page appears
Click Next
20
Step 5: On the System Configuration Check page, the computer is scanned for
potential installation problems To interrupt
the scan, click Stop To proceed with setup after the scan completes, click Continue
Trang 622
23
Step 6: On the Registration Information page,
enter information in the Name and Company text boxes Click Next
– Because SQL Server Express is free, there is no
Product Key text box on this page.
– If you select the Hide advanced configuration options check box, the Service Account,
Collation Settings, Instance Name, and User Instances pages do not appear during setup.
24
Trang 7 Step 7: On the Feature selection page, select
the program features to install and click Next
26
27
28
Step 8: On the Instance Name page, select a
Default instance or a Named instance for your installation If you select Default instance, an existing default instance will be upgraded If you select Named Instance,
specify an instance name or the default
named instance of SQLExpress is used
Click Next
Trang 8 Step 9: The Service Account page lets you assign
local system account or a domain user account to
SQL Server service This page does not appear if
you select the Hide advanced configuration
options check box
– Select Use a Local System account that does not require
a password to connect to SQL Server on the same
computer, and then click Next.
– Select Use a Domain User account, enter the Username,
Password, and the Domain name, and then click Next
32
Step 10: On the Authentication Mode page,
specify the security mode used to connect to your instance of SQL Server
– If you select Windows Authentication, Setup creates an sa account that is disabled by default.
– If you select Mixed Mode Authentication you must set strong passwords for all SQL Server logins
Enter and confirm a strong sa logon password
Click Next
Trang 934
Step 12: On the User Instances page,
specify if you want to generate a separate
instance of the Database Engine for
non-administrator users By default, user instance
functionality is enabled To turn off user
instances, clear the check box This page
does not appear if you select the Hide
advanced configuration options check
box Click Next
35
Step 13: On the Error and Usage Report Setting page, select whether to turn on error
reporting and usage reporting for SQL Server and its components By default, error
reporting is turned on To turn off error
reporting, clear the check box Click Next
36
Step 14: On the Ready to Install page, click Install to finish installing SQL Server.
Trang 10 Step 15: On the Setup Progress page, you
can monitor installation progress as setup
proceeds Click Next.
40
Step 16: On the Completing the Microsoft SQL Server Installation Wizard page, you
can view the setup summary log by clicking the link provided on this page To complete the SQL Server Installation Wizard, click
Finish.
Trang 11Đăng nhập SQL Server 2005 Express
Khởi động SQL Server Management Studio
Express
Server name: Đã được điền sẵn
Authentication: Có thể chọn:
– Windows Authentication
– SQL Server Authentication: Phải nhập password
(được thiết lập trong quá trình cài đặt)
Nhấn nút Connect(tham khảo hình slide sau)
43
44
Nếu trong quá trình cài đặt chúng ta không cho phép SQL Server kích hoạt ngay khi khởi động máy, bấm nút Connect sẽ gây ra lỗi
Khắc phục:
– Start | Run | gõ services.msc | enter
– Nhấp đúp vào SQL Server (SQLExpress), chọn Automatic tại combo box Startup | Apply | Start | OK
Giao diện sau khi đăng nhập thành công như slide sau:
Trang 1246
Một số thao tác cơ bản
Một số thao tác cơ bản
– Tạo mới database, tạo mới bảng
– Nhập dữ liệu vào bảng
– Xoá bảng, xoá database
– Mở một query editor để viết câu lệnh SQL
47
Tạo mới database
48
Trang 13Tạo bảng mới
52
• Save bảng mới
Trang 14Nhập dữ liệu vào bảng
Tham khảo slide sau
56
Xoá bảng, xoá database (DB)
Nhắp phải chuột lên bảng hay DB cần xoá | chọn Delete | OK
Trong trường hợp xoá một DB, nên check vào mục Close existing connections Khi đó SQL Server 2005 sẽ ngắt tất cả các kết nối vào CSDL này và việc xoá sẽ không gây lỗi
Trang 15Mở một query editor để viết câu lệnh SQL
Các bước tạo một query
(tham khảo slide sau)
Chú ý: Câu lệnh SQL sẽ có tác dụng trên CSDL
đang được chọn trong Combo box Do đó cần chú ý
lựa chọn đúng CSDL cần tương tác
58
1
2 3
4
59
Hết