Monday , December 23 2024

How To Set Filegroup As Readonly

 

For more information about Filegroup, please read the article “How to Create a Database on SQL Server“. Especially in large and partitioned databases, we need to set the filegroup as read only. In the article “How To Create Partition On SQL Server” you can see how to create a partition.

By right-clicking on the database, we click on properties, and we’ll get to the filegroups tab and set the filegroup that we want as readonly.

If you have an active session on the database you will get the error as follows.

In order to avoid this error, we get the script of the change we made by clicking on the script in the screenshot above.

We then run the script again by editing it as follows.(At First Alter Database To Single_User Mode, Finaly Alter Database To Multi_User Mode)

Loading

About dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *