Database Design

Published on July 2016 | Categories: Types, Books - Non-fiction | Downloads: 54 | Comments: 0 | Views: 287
of 14
Download PDF   Embed   Report

Database Design

Comments

Content

Database Design

In This Presentation..
         

What is SQL Server Database? What does SQL Server Database contain? Database Architecture Files and Filegroups Understanding Log Files Database Design Considerations System Databases Resource Database Types of SQL Server Databases Database Objects

What is SQL Server Database?
A

Database in SQL Server is made up of a collection of tables. These tables contain tables and other objects that are defined to support activities performed with the data.  At physical level, the Database is can be seen as a collection of simple files.  Each database can store either interrelated or unrelated data.

What does Database contain?
A

database consists of :
 Data  Different Objects useful for managing the Data

 Data

is physically stored in specific objects called : TABLES  There are tens of Database Objects that are needed for easy retrieval, working with and securing the data in a database.

Database Architecture

Files and FileGroups
 



At minimum, every database has two operating system files: a data file and a log file. The Data File contains data and other objects and the Log files contain the information that is required to recover all transactions in the database. There are THREE different types of Files:
  

Primary Data Files (*.mdf) Secondary Data Files (*.ndf) Transaction Log File(s) (*.ldf)

 

Data files can be grouped together in FILEGROUPS for allocation and administration purposes. A Filegroup can contain any number of files inside it.

Understanding Log Files
Every SQL Server 2005 database has a transaction log that records all transactions and the database modifications made by each transaction.  The transaction log is a critical component of the database and, if there is a system failure, it can be the only source of recent data.  The transaction log is not a part of any Filegroup.


Database Design Considerations
Each Database has at least two files – Database File and Transaction Log File  There can be multiple database and log files.  Primary Database file has .mdf extension.  All other database files have .ndf  Transaction Log File has .ldf  All the data and log files must reside on the same computer as SQL Server.


System Databases
When we install an instance of SQL Server 2005, following System databases are created by default:


master : Records all the system-level information for an instance
of SQL Server.



model : Used as the template for all databases created on the
instance of SQL Server.

msdb : Used by SQL Server Agent for scheduling alerts and jobs.  tempdb : Workspace for holding temporary objects or


intermediate result sets.

Resource Database
In addition to the FOUR system databases discussed previously, a separate system database called “Resource” database is also installed. But this database cannot be seen in SSMS for security reasons.  Resource database is a read-only database that contains system objects that are included with SQL Server 2005.  System objects are physically persisted in the Resource database.


Types of SQL Server Databases
 OLTP

Databases: Online Transaction Processing (OLTP) Databases are optimal for managing changing concurrent data.  OLAP Databases: Online Analytical Processing (OLAP) Databases are used for organizing lots of stable data for easy analysis and retrieval.

Precautions for Database design
Only one database is allowed per database file, but a single database can span multiple files.  Transaction logs must reside on their own file. There could be more than one transaction file per database.  Transaction log files are filled up one at a time.  When you create a database and do not specify the size of the log file, the log file will be 25% of the database file but minimum is 1MB by default.


Database Objects - I
          

Database Tables Views Constraints Rules Defaults Indexes Views Triggers Stored Procedures User Defined Functions

Database Objects - II
         

Cursors Synonyms Partitions Catalogs Logins Users Roles Files File Groups Certificates, etc

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close