Design | data | database | Database design
MCDBA Database Design Learning Blog
2004-4-14
Planning Storage Management
1 has and can only have one master data file
2 data and transaction logs can never be in the same file
Cannot share a filegroup between 32 databases
4 when estimating the size of a database, you should use tables and indexes.
5 Unlimited file growth is limited only by operating system and physical disk capacity.
A 6 filegroup is a group of files that are treated like a single file, which is called a filegroup.
It enables a database to be stored on multiple disks, possibly through exercises that understand the concept of filegroups.
ALTER DATABASE Exam
MODIFY FILEGROUP examFG1 DEFAULT
Go
To delete a filegroup, you must first delete the group file
ALTER DATABASE EXAM
REMOVE FILE EXAM_DATA4
ALTER DATABASE EXAM
REMOVE FILE exam_data3
ALTER DATABASE EXAM
REMOVE FILEGROUP EXAMFG1
A useful SP:
EXEC sp_spaceused Usertablename
Find out the number of records and the amount of space used in a table, because a table can be very large in the actual application.
In the database, specify the use of filegroups for tables such as on, and note that [PRIMARY] in [PRIMARY] is the primary filegroup rather than the primary key.
CREATE TABLE [Acc_paymethod_mstr] (
[Paymethodid] [nvarchar] (a) COLLATE sql_latin1_general_cp1_ci_as not NULL,
[Paymethodname] [nvarchar] (COLLATE) SQL_Latin1_General_CP1_CI_AS not NULL,
[Stampusername] [Stampusername] Null
[Stampdatetime] [Stampdatetime] Null
) on [PRIMARY]
The corresponding syntax for changing the default file is:
ALTER DATABASE <database name>
MODIFY FILEGROUP <filegroup name> DEFAULT
Ensure data integrity
6 Kinds of implementation constraints
Alter Table <table name>
ADD constraint <constraint name>
<constraint Type><constraint define>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.