Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Resize a SQL Azure Database

How do I resize my SQL Azure Web Edition 5 GB database to a 1 GB database? I no longer need the extra capacity and do not want to be billed at the higher rate. I don't see anything in the Management Portal and a quick web search also turned up nothing.

like image 463
Joseph Sturtevant Avatar asked Jun 21 '11 18:06

Joseph Sturtevant


People also ask

How do I scale an SQL database in Azure?

Azure SQL Database offers the ability to dynamically scale your databases: With a single database, you can use either DTU or vCore models to define maximum amount of resources that will be assigned to each database. Elastic pools enable you to define maximum resource limit per group of databases in the pool.

Can we shrink Azure SQL Database?

In Azure SQL Database, to shrink files you can use either DBCC SHRINKDATABASE or DBCC SHRINKFILE commands: DBCC SHRINKDATABASE shrinks all data and log files in a database using a single command. The command shrinks one data file at a time, which can take a long time for larger databases.

How do I change the size of a SQL database?

To increase the size of a databaseExpand Databases, right-click the database to increase, and then click Properties. In Database Properties, select the Files page. To increase the size of an existing file, increase the value in the Initial Size (MB) column for the file.


1 Answers

I answered a similar question here. It should be as simple as running an ALTER DATABASE command:

ALTER DATABASE MyDatabase MODIFY (EDITION='WEB', MAXSIZE=1GB)

Just keep this in mind: As long as your usage is <= 1GB, you'll be billed at the 1GB rate. Billing is monthly but amortized daily. So you actually don't need to reduce your max size unless you're relying on SQL Azure to prevent you from growing beyond 1GB.

EDIT: As of Feb. 2012, there's a new 100MB pricing tier (at $4.99, vs. $9.99 at 1GB). While you can't set MAXSIZE to 100MB, your monthly cost will drop if you stay under 100MB. See this blog post for more details.

like image 152
David Makogon Avatar answered Nov 15 '22 08:11

David Makogon