In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
How do I create a filegroup filegroup in an SQL server database? Many novices are not very clear about this. In order to help you solve this problem, the following editor will explain it in detail. People with this need can come and learn. I hope you can gain something.
Operation of the database:
1. Operations on data files (add, delete, modify initial file size, maximum size, step size)
two。 Shrinkage of database files
3. Read-only / read-write read_only of the database read-only read_write read-write read_only means read-only read_write means read-write
4. Restricted access to the database (single-user, multi-user, restricted user mode)
5. Database offline / online offline offline alter database love set offline online online alter database love set online
6. Database attach / detach. Sp_attach_db additional SP_detach_db separation additional sp_attach_db separation sp_detach_db offline offline online online
This article focuses on the SQL server database creation code filegroup filegroup modification. The example code is as follows:
The following example creates a database on the SQL Server instance. The database includes a master data file, a user-defined filegroup, and a log file. The primary data file is in the primary filegroup, while the user-defined filegroup contains two secondary data files. The ALTER DATABASE statement specifies a user-defined filegroup as the default. The table is then created by specifying a user-defined filegroup.
USE master;GO-- Create the database with the default data-- filegroup and a log file. Specify the-- growth increment and the max size for the-- primary data file.CREATE DATABASE MyDBON PRIMARY (NAME='MyDB_Primary',FILENAME='c:\ Program Files\ Microsoft SQL Server\ MSSQL10_50.MSSQLSERVER\ MSSQL\ data\ MyDB_Prm.mdf',SIZE=4MB,MAXSIZE=10MB,FILEGROWTH=1MB), FILEGROUP MyDB_FG1 (NAME='MyDB_ FG1_Dat1',FILENAME ='c:\ Program Files\ Microsoft SQL Server\ MSSQL10_50.MSSQLSERVER\ MSSQL\ data\ MyDB_FG1_1.ndf',SIZE = 1MB law MAXSIZE 10MB camera FILEGROWTH 1MB) (NAME='MyDB_ FG1_Dat2',FILENAME ='c:\ Program Files\ Microsoft SQL Server\ MSSQL10_50.MSSQLSERVER\ MSSQL\ data\ MyDB_FG1_2.ndf',SIZE = 1MB MAXSIZE 10MB MILEGROWTH 1MB) LOG ON (NAME='MyDB_log',FILENAME ='c:\ Program Files\ Microsoft SQL Server\ MSSQL10_50.MSSQLSERVER\ MSSQL\ data\ MyDB.ldf',SIZE=1MB,MAXSIZE=10MB,FILEGROWTH=1MB) Is it helpful for GOALTER DATABASE MyDB MODIFY FILEGROUP MyDB_FG1 DEFAULT;GO-- Create a table in the user-defined filegroup.USE MyDB;CREATE TABLE MyTable (cola int PRIMARY KEY,colb char (8)) ON MyDB_FG1;GO to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.