Skip to content

Latest commit

 

History

History
128 lines (101 loc) · 3.67 KB

SqlDatabases.adoc

File metadata and controls

128 lines (101 loc) · 3.67 KB

DSC Resource 'SqlDatabases'

SqlDatabases is used to create or delete a database. For more information about SQL Server databases, please read the following articles Create a Database and Delete a Database.

This resource sets the recovery model for a database. The recovery model controls how transactions are logged, whether the transaction log requires (and allows) backing up, and what kinds of restore operations are available. Three recovery models exist: full, simple, and bulk-logged. Read more about recovery model in the article View or Change the Recovery Model of a Database.

Source

DSC Resource

Documentation

Requirements
  • Target machine must be running Windows Server 2012 or later.

  • Target machine must be running SQL Server Database Engine 2012 or later.

  • Valid values per SQL Server version for the parameter CompatibilityLevel can be found in the article ALTER DATABASE (Transact-SQL) Compatibility Level.

Table 1. Attributes of category 'SqlDatabases'
Parameter Attribute DataType Description Allowed Values

Values

Mandatory

Hashtable[]

List of SQL databases.

Table 2. Attributes of category 'SqlDatabases'
Parameter Attribute DataType Description Allowed Values

Name

Key

String

The name of the SQL Server database.

InstanceName

Key

String

The name of the SQL Server instance to be configured.

Enure

String

Determines whether the alias should be added ('Present') or removed ('Absent'). Default value is 'Present'.

Present, Absent

ServerName

String

The host name of the SQL Server to be configured. Default value is the current computer name.

Collation

String

The name of the collation to use for the new database. Default value is the collation used by the server.

CompatibilityLevel

String

Specifies the version of the SQL Database Compatibility Level to use for the specified database.

Version80, Version90, Version100, Version110, Version120, Version130, Version140, Version150

RecoveryModel

String

The recovery model for the specified database.

Simple, Full, BulkLogged

Example
SqlDatabases:
  Values:
    - EndpointName: HADR
      EndpointType: DatabaseMirroring
      Port: 5022
      ServerName: SQL1
      InstanceName: MSSQLSERVER
    - EndpointName: HADR
      EndpointType: DatabaseMirroring
      Port: 5023
      ServerName: SQL2
      InstanceName: MSSQLSERVER