Management Studio1Nội dung1. SQL Server Management Studio2. Thao tác trên Object Explorer3. Database Objects4. Backup Restore1. SQL Server Management Studio2. Thao tác với các đối tượng trongExplorerCreate a databaseCreate a tableAdd data to a tableSelect data in a tableDrop tableDrop databaseDemo3. Các đối tượng trong hệ QLTCSDL(Database Objects) The database itself The transaction log Tables Indexes Filegroups Diagrams Views Stored procedures• Userdefined functions• Sequences• Users• Roles• Assemblies• Reports• Fulltext catalogs• Userdefined data types3.1. CSDL hệ thống
Trang 1Management Studio
1
Trang 2Nội dung
1. SQL Server Management Studio
2. Thao tác trên Object Explorer
3. Database Objects
4. Backup & Restore
Trang 31 SQL Server Management Studio
Trang 42 Thao tác với các đối tượng trong
Explorer
Create a database
Create a table
Add data to a table
Select data in a table
Drop table
Drop database
Demo
Trang 53 Các đối tượng trong hệ QLTCSDL
(Database Objects)
The database itself
The transaction log
Tables
Indexes
Filegroups
Diagrams
Views
Stored procedures
• User-defined functions
• Sequences
• Users
• Roles
• Assemblies
• Reports
• Full-text catalogs
• User-defined data types
Trang 63.1 CSDL hệ thống (System Database)
Mặc định:
master
model
msdb
Tempdb
Phụ thuộc vào tùy chọn cài đặt:
ReportServer
ReportServerTempDB
AdventureWorks
AdventureWorksDW
Trang 73.2 Transaction Log
Ghi nhận các thay đổi trong DB
Dựa vào thay đổi dữ liệu của các thao tác: INSERT, UPDATE, DELETE
1 Load data page tương ứng lên memory (data cache)
2 Data trong data cache được thay đổi
(dirty-page)
3 Các thay đổi ghi vào transaction log file
write-ahead log
4 Check Point Process kiểm tra và ghi nhận các transaction được committed vào hardisk
được học chi tiết ở chương quản lý Transaction
Trang 83.3 Filegroups
Primary filegroup
Secondary files
User-defined filegroups
Trang 94 Backup & Restore
Backup
R_Click trên DB cần backup Tasks Backup
Thực hiện theo hướng dẫn wizard
Restore
R_Click trên Object database chọn Restorechọn tập tin đã backup cần restore
Thực hiện theo hướng dẫn wizard
Detach & Attach
Detach: gỡ DB (Tập tin mdf và ldf ) ra khỏi
Management Studio
Attach: đưa tập tin mdf và ldf vào Mamagement
Studio.