Академический Документы
Профессиональный Документы
Культура Документы
Administration
Topics
Database Files and Logs
Database Administration Basics
Creating Databases
Altering Databases and Their Options
Managing Database and Log Size
Manipulating Databases
MS SQL Server
Database - a collection of data and the
objects that represent and interact with that
data
Tables, views, stored procedures, triggers,
and constraints are typical database objects
A single database server instance can have up
to 32,767 databases, and each database can
have more than 2 billion objects.
Transaction Logs
history of modifications to the database, and
SQL Server uses it to ensure that a database
has integrity
All changes to the database are first written
to the transaction log and then applied to the
database
If the database update is successful, the
transaction is completed and recorded as
twophase
successful
commit
If the database update fails, SQL Server
uses the transaction log to restore the
database to its original state.
enables SQL Server to restore a database
automatically in case of power failure, server
outage, or other problems that might occur when
you enter a transaction.
Database Files
Database
Administration Basics
Viewing Database
Information
General
Provides general database information, such as status, owner,date created, size,
and space available. This page also details the last backup date and collation
setting.
Files
Provides details on the data and log files associated with the database. If the
database has been configured for full-text search, the Use Full-Text Indexing
check box is selected. Catalog files associated with the database are not listed.
Filegroups
Lists the filegroups associated with the database and allows you to add or remove
filegroups.
Options
Provides controls for viewing and managing standard database options and
settings.
Change Tracking
Provides controls for viewing and managing change-tracking settings.
Database Properties
Permissions
Lists users or roles that have specific permissions allowed or denied in
the database. Also allows you to set database permissions for users or
roles.
Extended Properties
Provides controls for viewing and managing extended database
properties.
Mirroring
Provides controls for viewing and managing database mirroring settings.
Transaction Log Shipping
Details the current log shipping configuration (if any) and allows you to
manage log shipping.
Viewing Database
Information Using T-SQL
Certificates
Constraints
Defaults
Indexes
Keys
Stored procedures and extended stored procedures
Tables
Examining Database
Objects
Broker Priorities
Broker priorities define a priority level and
the set of criteria for determining which
Service Broker conversations to assign the
priority level
Servicer Broker assigns the priority level to
any conversation endpoint that uses the same
combination of contracts and services that
are specified in the conversation priority.
Plan Guides
Full-text stoplists
Creating Databases
Creating Databases
Creating Databases
Creating Databases
Creating Database
using T-SQL
* USE MASTER
* GO
* CREATE DATABASE Sample
* ON
* PRIMARY
* ( NAME = Sample1,
* FILENAME = "c:\data\sampledat1.mdf",
* SIZE = 100MB,
* MAXSIZE = UNLIMITED,
* FILEGROWTH = 10%),
* ( NAME = Sample2,
* FILENAME = "c:\data\sampledat2.ndf",
* SIZE = 100MB,
* MAXSIZE = UNLIMITED,
* FILEGROWTH = 10%)
* LOG ON
* ( NAME = SampleLog1,
* FILENAME = "c:\data\samplelog1.ldf",
* SIZE = 3MB,
* MAXSIZE = UNLIMITED,
* FILEGROWTH = 5MB)
* GO
Altering Databases
Configuring Automatic
Options
Configuring Automatic
Options
Configuring Automatic
Options
Configuring Automatic
Options
Configuring Automatic
Options
Parameterization Option
SIMPLE
SQL Server parameterizes very few classes of
queries and disables forced parameterization.
FORCED
any literal value that appears in a SELECT,
INSERT, UPDATE, or DELETE statement
submitted in any form is converted to a
parameter during query compilation.
Configuring
Parameterization
Configuring Cursor
Options
Configuring Cursor
Options
READ_ONLY,
you can read data but not modify it. You use this option to prevent users from
changing data and modifying database configuration settings.
READ_WRITE,
Normal Mode, which allows the database to be read and modified.
SINGLE_USER,
only the database owner can access the database. You use this option when
you are modifying a database and want to block access to it temporarily.
RESTRICTED_USER,
only members of the db_owner, dbcreator, or sysadmin roles can use the
database
MULTI_USER,
all users with the appropriate permissions to connect to the database are
permitted to use it.
Database State