How to setup SQL server in Azure
Step 1:
- Format F: and G: with the NTFS and Allocation unit size : 64 kilobytes
- Create the following directoies:
F:\MSSQL\Data
G:\MSSQL\Log
G:\MSSQL\ErrorLog
H:\MSSQL\Backup
Give user: NT Service\MSSQLSERVER full access to the
F:\MSSQL
G:\MSSQL
H:\MSSQL
Please note when removing Everyone & Users from the main drive to add the 'NT Service\MSSQLSERVER' account on the top level with read rights
Step 2:
go to the SQL Server Configuration Manager and there stop the SQL Server(MSSQLSERVER) service
Change in SQL Server(MSSQLSERVER) (Right click --> Properties --> Startup Parameters) to the following:
-dF:\MSSQL\Data\master.mdf
-eG:\MSSQL\ErrorLog\ERRORLOG
-lG:\MSSQL\Log\mastlog.ldf
Now move the Master.mdf and masterlog.ldf from C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA to:
*Please note that the MSSQL12.MSSQLSERVER is the version of the SQL in older versions this can change
F:\MSSQL\Data\master.mdf
G:\MSSQL\Log\mastlog.ldf
When done start the SQL server
Step 3:
Open the MSSQL studio and run the following queries:
USE master; |
Stop the SQL service (SQL Server (MSSQLSERVER))
Move the files form C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA to:
F:\MSSQL\Data\tempdb.mdf
F:\MSSQL\Data\model.mdf
F:\MSSQL\Data\MSDBData.mdf
G:\MSSQL\Log\templog.ldf
G:\MSSQL\Log\modellog.ldf
G:\MSSQL\Log\MSDBLog.ldf
Start the SQL Service (SQL Server (MSSQLSERVER))
Check the Databases --> System Databases if the all have started, when all is OK. remove the databases and databaselogs from :
C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA
Step 4:
Right click on the DB instance name and select properties.
- On memory change the value to 80% of the system memory
- On Database settings change the Data / Log & Backup path:
Backup: H:\MSSQL\Backup
Step 5:
- Create Backup plan
- Create a daily maintenance plan