Computer Science, asked by kirandeep98, 1 year ago

list two files of database

Answers

Answered by 15121115anil
1
APPLIES TO: SQL Server Azure SQL Database Azure SQL Data Warehouse Parallel Data Warehouse

At a minimum, every SQL Server database has two operating system files: a data file and a log file. Data files contain data and objects such as tables, indexes, stored procedures, and views. Log files contain the information that is required to recover all transactions in the database. Data files can be grouped together in filegroups for allocation and administration purposes.

Database Files

SQL Server databases have three types of files, as shown in the following table.

FileDescriptionPrimaryThe primary data file contains the startup information for the database and points to the other files in the database. User data and objects can be stored in this file or in secondary data files. Every database has one primary data file. The recommended file name extension for primary data files is .mdf.SecondarySecondary data files are optional, are user-defined, and store user data. Secondary files can be used to spread data across multiple disks by putting each file on a different disk drive. Additionally, if a database exceeds the maximum size for a single Windows file, you can use secondary data files so the database can continue to grow.

The recommended file name extension for secondary data files is .ndf.Transaction LogThe transaction log files hold the log information that is used to recover the database. There must be at least one log file for each database. The recommended file name extension for transaction logs is .ldf.

For example, a simple database named Salescan be created that includes one primary file that contains all data and objects and a log file that contains the transaction log information. Alternatively, a more complex database named Orders can be created that includes one primary file and five secondary files. The data and objects within the database spread across all six files, and the four log files contain the transaction log information.

By default, the data and transaction logs are put on the same drive and path. This is done to handle single-disk systems. However, this may not be optimal for production environments. We recommend that you put data and log files on separate disks.

Logical and Physical File Names

SQL Server files have two file name types:

logical_file_name: The logical_file_name is the name used to refer to the physical file in all Transact-SQL statements. The logical file name must comply with the rules for SQL Server identifiers and must be unique among logical file names in the database. This is set by the NAME argument in ALTER DATABASE. For more information, see ALTER DATABASE File and Filegroup Options (Transact-SQL).

os_file_name: The os_file_name is the name of the physical file including the directory path. It must follow the rules for the operating system file names. This is set by the FILENAMEargument in ALTER DATABASE. For more information, see ALTER DATABASE File and Filegroup Options (Transact-SQL


kirandeep98: thanks
Answered by puru3725
0
Hey mate! Here is your answer. (1.) Hardware (2). Software. OR. (1.) Microsoft (2) Excel . Hope it will help you.
Similar questions