30.06.2013 Views

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SQL Server Backup and Restore - Simple Talk

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3: Full Database <strong>Backup</strong>s<br />

In any event, in our case, we're just setting the SIZE <strong>and</strong> FILEGROWTH settings such that<br />

<strong>SQL</strong> <strong>Server</strong> doesn't have to grow the files while we pump in our test data. We've used an<br />

initial data files size of 500 MB, growing in 100 MB increments, <strong>and</strong> an initial size for the<br />

log file of 100 MB, growing in 10 MB increments.<br />

When you're ready, execute the script in Listing 3-1, <strong>and</strong> the database will be created.<br />

Alternatively, if you prefer to create the database via the SSMS GUI, rather than using a<br />

script, simply right-click on the Databases node in SSMS, select New Database…, <strong>and</strong> fill<br />

out the General tab so it looks like that shown in Figure 3-1.<br />

Figure 3-1: Creating a database via SSMS.<br />

Setting database properties<br />

If, via SSMS, we generate a CREATE script for an existing database, it will contain the<br />

expected CREATE DATABASE section, specifying the values for the NAME, FILENAME,<br />

SIZE, MAXSIZE <strong>and</strong> FILEGROWTH arguments. However, this will be followed by a swathe<br />

of ALTER DATABASE comm<strong>and</strong>s that set various other database options. To see them<br />

all, simply browse the various Properties pages for any database. All of these options<br />

are, under the covers, assigned default values according to those specified by the model<br />

system database; hence the name model, since it is used as a model from which to create<br />

all user databases. Listing 3-2 shows a script to set six of the more important options.<br />

91

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!