Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How is the SQLServer database formed?

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

The main content of this article is to explain how the SQLServer database is formed. Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how the SQLServer database is formed.

How is the SQLServer database formed?

Data file: it is divided into two forms: primary data file and secondary data file. Each database has one and only one primary data file. The default file extension for the primary data file is .mdf. It stores data in tables and indexes and contains startup information for the database, as well as system tables that record the location information of database objects and other files. The secondary data file contains all data files except the primary data file. Some databases may not have secondary data files, while others may have multiple secondary data files. The default file extension for secondary data files is .ndf.

Log files: SQLServer has a transaction function to ensure the consistency and integrity of database operations. The so-called transaction is the work of a unit, which is either completed or not completed. Log files are used to record all modifications that have occurred in the database and transactions that perform each modification. SQLServer is a database system that complies with writing logs first and then performing database modifications, so if the database system crashes, the database administrator (DBA) can repair and rebuild the database through log files. Each database must have at least one log file, but there can be more than one. The default file extension for log files is .1df. When setting up the database, SQI. Server automatically creates log files for the database.

How to make up the SQLServer database

Filegroups: some systems can improve their performance by controlling the data and indexes placed on specific disk drives. Filegroups can help with this process. The system administrator can create filegroups for each disk drive and then assign text, ntext, or image data in a specific table, index, or table to a specific filegroup.

SQI.Server has two types of filegroups: primary filegroups and user-defined filegroups. The primary filegroup contains the primary data files and any files that are not explicitly assigned to other filegroups, and all pages of the system table are assigned to the primary filegroup; user-defined filegroups are filegroups specified using the FII,EGROUP keyword in CRE_ATEDATA_BASE or AI,TERDATA.BASE statements. SQt.Server2000 works effectively without filegroups, so many systems do not need to specify user-defined filegroups. In this case, all files are contained in the primary filegroup, and SQI. Server2000 can allocate data anywhere in the database.

There is a filegroup running as the default filegroup in each database. When SQI. When Server allocates pages to a table or index that did not have a filegroup specified when it was created, it is allocated from the default filegroup. Only one filegroup can be the default filegroup at a time. If no default filegroup is specified, the primary filegroup becomes the default filegroup.

At this point, I believe you have a deeper understanding of "how the SQLServer database is composed". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report