SQL Server Central is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 

Resize data file manually to prevent downtime

By acampoma, 2003/06/19

Total article views: 102 | Views in the last 30 days: 7

This script will resize the data file of a passed in database name and filename by 10%. It can run in 3 modes.Resize, INFO, HELP. RESIZE is passed into parameter @Mode when we know the database name and file we wish to resize. INFO is passed in when we only know the database name and we wish to find out the data file names. HELP is passed in when we have no idea what to do. I run this in my job agent every night to prevent SQL from doing it automatically every time the data file fills up. The reason for this is that this automatic resize can happen at any time (including peak hours) and it could slow down performance.
Instructions and parameter definitions are in the stored proc comments.
Keep in mind this uses custom errors for error trapping. You should create these errors before doing this:.Just run the following SQL. EXEC sp_addmessage 55001, 16, 'Validate - Source: [''%s''] Operation: [''%s''] Description: [''%s'']' , NULL, true, REPLACE

By acampoma, 2003/06/19

Total article views: 102 | Views in the last 30 days: 7
Your response
 
 
Related tags
 
Already registered?  

Free registration required

To read the rest of this article, and access thousands of other articles, we ask you to register on the site and subscribe to our newsletters.

Register

E-mail address:
Password:
Password (confirm):

  

Subscriptions

We ask you to register on the site and subscribe to our newsletters. Subscribing to our newsletters gets you:

  • ALL of our content (thousands of articles, scripts, and forum postings)
  • A daily newsletter (example)
  • A weekly news round up (example)
  • The opportunity to ask and answer questions in our forums
  • A daily Question of the Day to test and help you increase your knowledge of SQL Server.

We ask that you give the newsletter a try for a week. Over 200,000 SQL Server Professionals a day find it entertaining and useful. If not, you are welcome to unsubscribe at anytime.

Steve Jones
Editor, SQLServerCentral.com