├── .env ├── .gitattributes ├── README.md ├── docker-compose.yml └── sql ├── Dockerfile └── scripts ├── AdventureWorksLT2019.bak ├── aoag_failover_job.sql ├── aoag_primary.sql ├── aoag_secondary.sql ├── db-init.sh ├── entrypoint.sh ├── install-tools.sh └── instance_config.sql /.env: -------------------------------------------------------------------------------- 1 | SA_PASSWORD="MssqlPass123" 2 | ACCEPT_EULA="Y" 3 | MSSQL_AGENT_ENABLED="true" 4 | MASTER_KEY_PASSWORD="Pa$$w0rd!?*&123" 5 | HADR_LOGIN_PASSWORD="Pa$$w0rd123!?*&" 6 | HADR_CERT_PASSWORD="Pa$$w0rd1*&23!?" 7 | HADR_PORT=5022 8 | INIT_WAIT=40 9 | DB1_TCP_PORT=2500 10 | DB2_TCP_PORT=2600 11 | SHARED_PATH=/var/opt/mssql/shared 12 | BACKUP_PATH=/var/opt/mssql/backup 13 | INSTALL_TOOLS=False -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Declare files that will always have LF line endings on checkout. 2 | *.sh text eol=lf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SQL Server AlwaysOn with containers 2 | 3 | This code uses two images of SQL Server docker to setup AlwaysOn Read-Scale/Clusterless AlwaysOn. 4 | 5 | ## How To 6 | 7 | 1. Run the following command in this directory: 8 | 9 | ```cmd 10 | docker-compose up 11 | ``` 12 | 13 | It will take about 2 min to configure the environemnt 14 | 15 | In your terminal, you should see something like this 16 | 17 | ```cmd 18 | ... 19 | db1 | ####### COMPLETED CONFIGURATION ####### 20 | ... 21 | db2 | ####### COMPLETED CONFIGURATION ####### 22 | ... 23 | ``` 24 | 25 | 2.Connect to the SQL Server instances using the sa login and the passowrd listed in the docker-compose.yml file 26 | 27 | 3.When done, clean up the environement by running 28 | 29 | ```cmd 30 | docker-compose down 31 | ``` 32 | 33 | ## Connecting to SQL Server 34 | 35 | - Connect to the primary replica using SQL Server Management Studio (SSMS) using localhost,2500 36 | - Connect to the secondary replica using SQL Server Management Studio (SSMS) using localhost,2600 37 | - SA Password specified on docker-compose.yml file 38 | 39 | ## Failover 40 | 41 | - Only a forced failover works in this type of setup. To perform a failover, connect to the secondary (localhost,2600) and run the command 42 | 43 | ```sql 44 | ALTER AVAILABILITY GROUP AG1 FORCE_FAILOVER_ALLOW_DATA_LOSS; 45 | ``` 46 | 47 | To resume data movement: 48 | 49 | ```sql 50 | ALTER DATABASE [AdventureWorks] SET HADR RESUME; 51 | ``` 52 | 53 | ## Troubleshooting 54 | 55 | - If you get sa login errors, please adjust the INIT_WAIT values in the docker-compose.yml file. 56 | Sometimes, depending on the system, the container startup tasks may take longer and the start sequence could potentially try to start configuring AlwaysOn before SQL Server is ready 57 | 58 | - Ensure that the shell scripts (\*.sh) always have 'LF' line endings. If for some reason they have Windows-style line endings the scripts will not run 59 | 60 | ## Configuration 61 | 62 | Update the .env file appropriately. 63 | 64 | `INSTALL_TOOLS` is used to install Powershell (Pwsh), and the PowerShell modules SqlServer and DBATools 65 | 66 | ## MSSQL container images 67 | 68 | 69 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | 3 | x-service-environment: &common-variables 4 | HADR_PORT: 5022 5 | INIT_WAIT: 40 6 | ACCEPT_EULA: 'Y' 7 | IS_AOAG_PRIMARY: False 8 | SA_PASSWORD: ${SA_PASSWORD} 9 | MASTER_KEY_PASSWORD: ${MASTER_KEY_PASSWORD} 10 | HADR_LOGIN_PASSWORD: ${HADR_LOGIN_PASSWORD} 11 | HADR_CERT_PASSWORD: ${HADR_CERT_PASSWORD} 12 | SHARED_PATH: ${SHARED_PATH} 13 | BACKUP_PATH: ${BACKUP_PATH} 14 | 15 | services: 16 | 17 | db1: 18 | container_name: db1 19 | hostname: db1 20 | build: 21 | context: .\sql 22 | args: 23 | - INSTALL_TOOLS=${INSTALL_TOOLS} 24 | environment: 25 | <<: *common-variables 26 | IS_AOAG_PRIMARY: True 27 | TCP_PORT: ${DB1_TCP_PORT} 28 | PARTNER_HOSTNAME: db2 29 | ports: 30 | - ${DB1_TCP_PORT}:${DB1_TCP_PORT} 31 | volumes: 32 | - mssql-server-shared:${SHARED_PATH} 33 | - mssql-server-backup:${BACKUP_PATH} 34 | networks: 35 | - sqlaoag 36 | 37 | db2: 38 | container_name: db2 39 | hostname: db2 40 | build: 41 | context: .\sql 42 | args: 43 | - INSTALL_TOOLS=${INSTALL_TOOLS} 44 | environment: 45 | <<: *common-variables 46 | INIT_WAIT: 60 47 | TCP_PORT: ${DB2_TCP_PORT} 48 | ports: 49 | - ${DB2_TCP_PORT}:${DB2_TCP_PORT} 50 | volumes: 51 | - mssql-server-shared:${SHARED_PATH} 52 | - mssql-server-backup:${BACKUP_PATH} 53 | depends_on: 54 | - db1 55 | networks: 56 | - sqlaoag 57 | 58 | volumes: 59 | mssql-server-shared: 60 | mssql-server-backup: 61 | networks: 62 | sqlaoag: -------------------------------------------------------------------------------- /sql/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/mssql/server:2019-latest 2 | 3 | ARG INSTALL_TOOLS=False 4 | 5 | COPY ./scripts / 6 | USER root 7 | RUN chmod +x db-init.sh 8 | RUN chmod +x install-tools.sh 9 | 10 | RUN ./install-tools.sh $INSTALL_TOOLS 11 | 12 | RUN /opt/mssql/bin/mssql-conf set sqlagent.enabled true 13 | RUN /opt/mssql/bin/mssql-conf set hadr.hadrenabled 1 14 | RUN /opt/mssql/bin/mssql-conf set memory.memorylimitmb 2048 15 | 16 | 17 | CMD /bin/bash ./entrypoint.sh 18 | -------------------------------------------------------------------------------- /sql/scripts/AdventureWorksLT2019.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rafaelrodrigues3092/docker-mssql-alwayson/e4c17406289d057236efe5c3fe8c1b9179477cc7/sql/scripts/AdventureWorksLT2019.bak -------------------------------------------------------------------------------- /sql/scripts/aoag_failover_job.sql: -------------------------------------------------------------------------------- 1 | USE [msdb] 2 | GO 3 | 4 | /****** Object: Job [FAILOVER - AG1] Script Date: 9/3/2022 10:24:49 PM ******/ 5 | BEGIN TRANSACTION 6 | DECLARE @ReturnCode INT 7 | SELECT @ReturnCode = 0 8 | /****** Object: JobCategory [[Uncategorized (Local)]] Script Date: 9/3/2022 10:24:49 PM ******/ 9 | IF NOT EXISTS (SELECT name FROM msdb.dbo.syscategories WHERE name=N'[Uncategorized (Local)]' AND category_class=1) 10 | BEGIN 11 | EXEC @ReturnCode = msdb.dbo.sp_add_category @class=N'JOB', @type=N'LOCAL', @name=N'[Uncategorized (Local)]' 12 | IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback 13 | 14 | END 15 | 16 | DECLARE @jobId BINARY(16) 17 | EXEC @ReturnCode = msdb.dbo.sp_add_job @job_name=N'FAILOVER - AG1', 18 | @enabled=1, 19 | @notify_level_eventlog=0, 20 | @notify_level_email=0, 21 | @notify_level_netsend=0, 22 | @notify_level_page=0, 23 | @delete_level=0, 24 | @description=N'Run this job from the secondary node to perform a failover with DATA_LOSS', 25 | @category_name=N'[Uncategorized (Local)]', 26 | @owner_login_name=N'sa', @job_id = @jobId OUTPUT 27 | IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback 28 | /****** Object: Step [Failover] Script Date: 9/3/2022 10:24:50 PM ******/ 29 | EXEC @ReturnCode = msdb.dbo.sp_add_jobstep @job_id=@jobId, @step_name=N'Failover', 30 | @step_id=1, 31 | @cmdexec_success_code=0, 32 | @on_success_action=1, 33 | @on_success_step_id=0, 34 | @on_fail_action=2, 35 | @on_fail_step_id=0, 36 | @retry_attempts=0, 37 | @retry_interval=0, 38 | @os_run_priority=0, @subsystem=N'TSQL', 39 | @command=N'ALTER AVAILABILITY GROUP AG1 FORCE_FAILOVER_ALLOW_DATA_LOSS;', 40 | @database_name=N'master', 41 | @flags=0 42 | IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback 43 | EXEC @ReturnCode = msdb.dbo.sp_update_job @job_id = @jobId, @start_step_id = 1 44 | IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback 45 | EXEC @ReturnCode = msdb.dbo.sp_add_jobserver @job_id = @jobId, @server_name = N'(local)' 46 | IF (@@ERROR <> 0 OR @ReturnCode <> 0) GOTO QuitWithRollback 47 | COMMIT TRANSACTION 48 | GOTO EndSave 49 | QuitWithRollback: 50 | IF (@@TRANCOUNT > 0) ROLLBACK TRANSACTION 51 | EndSave: 52 | GO 53 | 54 | 55 | -------------------------------------------------------------------------------- /sql/scripts/aoag_primary.sql: -------------------------------------------------------------------------------- 1 | 2 | USE [master] 3 | GO 4 | 5 | DECLARE 6 | @hadr_port nvarchar(5), 7 | @hadr_login_password nvarchar(50), 8 | @master_key_password nvarchar(50), 9 | @cert_password nvarchar(50), 10 | @cmd nvarchar(4000), 11 | @partner_hostname sysname, 12 | @shared_path nvarchar(4000), 13 | @backup_path nvarchar(4000), 14 | @backup_file nvarchar(4000) 15 | 16 | --these are automatically picked up from the env variables 17 | SET @master_key_password = '$(MASTER_KEY_PASSWORD)' 18 | SET @hadr_login_password = '$(HADR_LOGIN_PASSWORD)' 19 | SET @cert_password = '$(HADR_CERT_PASSWORD)' 20 | SET @hadr_port = '$(HADR_PORT)' 21 | SET @partner_hostname = '$(PARTNER_HOSTNAME)' 22 | SET @shared_path = '$(SHARED_PATH)' 23 | SET @backup_path = '$(BACKUP_PATH)' 24 | 25 | SET @backup_file = @backup_path +'/AdventureWorksLT2019.bak' 26 | 27 | --create logins for aoag 28 | -- command only accepts string literals so using sp_executesql 29 | PRINT 'CREATING AOAG LOGIN' 30 | SET @cmd = 'CREATE LOGIN aoag_login WITH PASSWORD = '''+@hadr_login_password+''', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF' 31 | EXEC sp_executesql @cmd 32 | 33 | PRINT 'CREATING AOAG USER on [master]' 34 | CREATE USER aoag_user FOR LOGIN aoag_login; 35 | 36 | -- create certificate for AOAG 37 | -- command only accepts string literals so using sp_executesql 38 | PRINT 'CREATING MASTER KEY' 39 | SET @cmd = 'CREATE MASTER KEY ENCRYPTION BY PASSWORD = '''+@master_key_password+'''' 40 | EXEC sp_executesql @cmd 41 | 42 | PRINT 'CREATING CERTIFICATE' 43 | CREATE CERTIFICATE aoag_certificate WITH SUBJECT = 'aoag_certificate'; 44 | 45 | -- command only accepts string literals so using sp_executesql 46 | PRINT 'BACKING UP CERTIFICATE' 47 | SET @cmd = ' 48 | BACKUP CERTIFICATE aoag_certificate 49 | TO FILE = '''+@shared_path+'/aoag_certificate.cert'' 50 | WITH PRIVATE KEY ( 51 | FILE = '''+@shared_path+'/aoag_certificate.key'', 52 | ENCRYPTION BY PASSWORD = '''+@cert_password+''' 53 | )' 54 | EXEC sp_executesql @cmd 55 | 56 | --create HADR endpoint 57 | PRINT 'CREATING HADR ENDPOINT' 58 | SET @cmd = ' 59 | CREATE ENDPOINT [Hadr_endpoint] 60 | STATE=STARTED 61 | AS TCP ( 62 | LISTENER_PORT = '+@hadr_port+', 63 | LISTENER_IP = ALL 64 | ) 65 | FOR DATA_MIRRORING ( 66 | ROLE = ALL, 67 | AUTHENTICATION = CERTIFICATE aoag_certificate, 68 | ENCRYPTION = REQUIRED ALGORITHM AES 69 | ) 70 | ' 71 | EXEC sp_executesql @cmd 72 | 73 | GRANT CONNECT ON ENDPOINT::Hadr_endpoint TO [aoag_login]; 74 | 75 | --------------------------------------------------------------------------------------------- 76 | --CREATE PRIMARY AG GROUP ON PRIMARY CLUSTER PRIMARY REPLICA 77 | --------------------------------------------------------------------------------------------- 78 | --for clusterless AOAG the failover mode always needs to be manual 79 | 80 | PRINT 'CREATING AG' 81 | SET @cmd =' 82 | CREATE AVAILABILITY GROUP [AG1] 83 | WITH ( 84 | CLUSTER_TYPE = NONE 85 | ) 86 | FOR REPLICA ON 87 | N'''+@@SERVERNAME+''' WITH 88 | ( 89 | ENDPOINT_URL = N''tcp://'+@@SERVERNAME+':'+@hadr_port+''', 90 | AVAILABILITY_MODE = SYNCHRONOUS_COMMIT, 91 | SEEDING_MODE = AUTOMATIC, 92 | FAILOVER_MODE = MANUAL, 93 | SECONDARY_ROLE (ALLOW_CONNECTIONS = ALL) 94 | ), 95 | N''db2'' WITH 96 | ( 97 | ENDPOINT_URL = N''tcp://'+@partner_hostname+':'+@hadr_port+''', 98 | AVAILABILITY_MODE = SYNCHRONOUS_COMMIT, 99 | SEEDING_MODE = AUTOMATIC, 100 | FAILOVER_MODE = MANUAL, 101 | SECONDARY_ROLE (ALLOW_CONNECTIONS = ALL) 102 | ); 103 | '; 104 | 105 | --execute creation of AOAG 106 | exec sp_executesql @cmd 107 | 108 | 109 | --create sample database 110 | PRINT 'CREATING DATABASE' 111 | 112 | RESTORE DATABASE [AdventureWorks] 113 | FROM DISK = @backup_file 114 | WITH FILE = 1, 115 | MOVE N'AdventureWorksLT2012_Data' TO N'/var/opt/mssql/data/AdventureWorksLT2012.mdf', 116 | MOVE N'AdventureWorksLT2012_Log' TO N'/var/opt/mssql/data/AdventureWorksLT2012_log.ldf', 117 | NOUNLOAD, REPLACE, STATS = 5 118 | 119 | 120 | -- --change recovery model and take full backup for db to meet requirements of AOAG 121 | PRINT 'CHANGING DB RECOVERY MODEL' 122 | ALTER DATABASE [AdventureWorks] SET RECOVERY FULL ; 123 | 124 | PRINT 'BACKING UP DATABASE' 125 | SET @backup_file = @backup_path +'/AdventureWorks_0.bak' 126 | BACKUP DATABASE [AdventureWorks] TO DISK = @backup_file WITH NOFORMAT, NOINIT, NAME = N'Sales-Full Database Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10 127 | 128 | --wait a bit and add database to AG 129 | 130 | WAITFOR DELAY '00:00:10' 131 | PRINT 'ADDING DB TO AG' 132 | ALTER AVAILABILITY GROUP [AG1] ADD DATABASE [AdventureWorks] 133 | GO 134 | -------------------------------------------------------------------------------- /sql/scripts/aoag_secondary.sql: -------------------------------------------------------------------------------- 1 | 2 | USE [master] 3 | GO 4 | 5 | DECLARE 6 | @hadr_port nvarchar(5), 7 | @hadr_login_password nvarchar(50), 8 | @master_key_password nvarchar(50), 9 | @cert_password nvarchar(50), 10 | @shared_path nvarchar(4000), 11 | @cmd nvarchar(4000) 12 | 13 | --these are automatically picked up from the env variables 14 | SET @master_key_password = '$(MASTER_KEY_PASSWORD)' 15 | SET @hadr_login_password = '$(HADR_LOGIN_PASSWORD)' 16 | SET @cert_password = '$(HADR_CERT_PASSWORD)' 17 | SET @hadr_port = '$(HADR_PORT)' 18 | SET @shared_path = '$(SHARED_PATH)' 19 | 20 | --create login for aoag 21 | -- command only accepts string literals so using sp_executesql 22 | PRINT 'CREATING AOAG LOGIN' 23 | SET @cmd = 'CREATE LOGIN aoag_login WITH PASSWORD = '''+@hadr_login_password+''', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF' 24 | EXEC sp_executesql @cmd 25 | 26 | PRINT 'CREATING AOAG USER on [master]' 27 | CREATE USER aoag_user FOR LOGIN aoag_login; 28 | 29 | -- create certificate 30 | -- command only accepts string literals so using sp_executesql 31 | PRINT 'CREATING MASTER KEY' 32 | SET @cmd = 'CREATE MASTER KEY ENCRYPTION BY PASSWORD = '''+@master_key_password+'''' 33 | EXEC sp_executesql @cmd 34 | 35 | -- command only accepts string literals so using sp_executesql 36 | PRINT 'CREATING CERTIFICATE' 37 | SET @cmd = ' 38 | CREATE CERTIFICATE aoag_certificate 39 | AUTHORIZATION aoag_user 40 | FROM FILE = '''+@shared_path+'/aoag_certificate.cert'' 41 | WITH PRIVATE KEY ( 42 | FILE = '''+@shared_path+'/aoag_certificate.key'', 43 | DECRYPTION BY PASSWORD = '''+@cert_password+''' 44 | )' 45 | EXEC sp_executesql @cmd 46 | 47 | --create HADR endpoint 48 | PRINT 'CREATING HADR ENDPOINT' 49 | SET @cmd = ' 50 | CREATE ENDPOINT [Hadr_endpoint] 51 | STATE=STARTED 52 | AS TCP ( 53 | LISTENER_PORT = '+@hadr_port+', 54 | LISTENER_IP = ALL 55 | ) 56 | FOR DATA_MIRRORING ( 57 | ROLE = ALL, 58 | AUTHENTICATION = CERTIFICATE aoag_certificate, 59 | ENCRYPTION = REQUIRED ALGORITHM AES 60 | ) 61 | ' 62 | EXEC sp_executesql @cmd 63 | 64 | GRANT CONNECT ON ENDPOINT::Hadr_endpoint TO [aoag_login]; 65 | GO 66 | 67 | --add current node to the availability group 68 | PRINT 'JOINING AG' 69 | ALTER AVAILABILITY GROUP [AG1] JOIN WITH (CLUSTER_TYPE = NONE) 70 | ALTER AVAILABILITY GROUP [AG1] GRANT CREATE ANY DATABASE 71 | GO 72 | 73 | -------------------------------------------------------------------------------- /sql/scripts/db-init.sh: -------------------------------------------------------------------------------- 1 | #!bin/sh 2 | 3 | echo "####### STARTED CONFIGURATION #######" 4 | 5 | SLEEP_TIME=$INIT_WAIT 6 | 7 | #run the setup script to create the DB and the schema in the DB 8 | #if this is the primary node, remove the certificate files. 9 | #if docker containers are stopped, but volumes are not removed, this certificate will be persisted 10 | echo "<#############> IS_AOAG_PRIMARY: ${IS_AOAG_PRIMARY}" 11 | if [ $IS_AOAG_PRIMARY = "true" ] 12 | then 13 | SQL_SCRIPT="aoag_primary.sql" 14 | #rm /var/opt/mssql/shared/aoag_certificate.key 2> /dev/null 15 | #rm /var/opt/mssql/shared/aoag_certificate.cert 2> /dev/null 16 | rm $SHARED_PATH/aoag_certificate.key 2> /dev/null 17 | rm $SHARED_PATH/aoag_certificate.cert 2> /dev/null 18 | 19 | else 20 | SQL_SCRIPT="aoag_secondary.sql" 21 | fi 22 | 23 | BAK_FILE="AdventureWorksLT2019.bak" 24 | 25 | echo "<#############> SQLSCRIPT: ${SQL_SCRIPT}" 26 | 27 | echo "<#############> Moving Backup File ${BAK_FILE} to ${BACKUP_PATH}" 28 | mv $BAK_FILE $BACKUP_PATH 29 | 30 | #wait for the SQL Server to come up 31 | echo "<#############> Sleeping for ${SLEEP_TIME} seconds ..." 32 | sleep ${SLEEP_TIME} 33 | 34 | #use the SA password from the environment variable 35 | echo "<#############> running set up script ${SQL_SCRIPT}" 36 | /opt/mssql-tools/bin/sqlcmd \ 37 | -S localhost,$TCP_PORT \ 38 | -U sa \ 39 | -P $SA_PASSWORD \ 40 | -d master \ 41 | -i $SQL_SCRIPT 42 | 43 | # create failove sql agent job 44 | echo "<#############> running sql agent failover job" 45 | /opt/mssql-tools/bin/sqlcmd \ 46 | -S localhost,$TCP_PORT \ 47 | -U sa \ 48 | -P $SA_PASSWORD \ 49 | -d master \ 50 | -i "aoag_failover_job.sql" 51 | 52 | 53 | 54 | echo "####### COMPLETED CONFIGURATION #######" -------------------------------------------------------------------------------- /sql/scripts/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!bin/sh 2 | 3 | #Set the defaultbackupdir (needs to be done here after the volume from docker-compose has been mapped) 4 | #run db-init.sh script 5 | #run sqlservr service so docker container does not stop 6 | if [ -z ${TCP_PORT+x} ]; then eset TCP_PORT=1433; fi 7 | 8 | /opt/mssql/bin/mssql-conf set filelocation.defaultbackupdir $BACKUP_PATH & 9 | /opt/mssql/bin/mssql-conf set network.tcpport $TCP_PORT & 10 | sh ./db-init.sh & 11 | /opt/mssql/bin/sqlservr -------------------------------------------------------------------------------- /sql/scripts/install-tools.sh: -------------------------------------------------------------------------------- 1 | #!bin/sh 2 | 3 | if [ $1 = "True" ]; then 4 | # Update the list of packages 5 | apt-get update 6 | # Install pre-requisite packages. 7 | apt-get install -y wget apt-transport-https software-properties-common 8 | # Download the Microsoft repository GPG keys 9 | wget -q "https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/packages-microsoft-prod.deb" 10 | # Register the Microsoft repository GPG keys 11 | dpkg -i packages-microsoft-prod.deb 12 | # Update the list of packages after we added packages.microsoft.com 13 | apt-get update 14 | # Install PowerShell 15 | apt-get install -y powershell 16 | # Start PowerShell 17 | pwsh -Command 'Install-Module -Name SQLServer -Scope AllUsers -Force' 18 | pwsh -Command 'Install-Module -Name dbatools -Scope AllUsers -Force' 19 | fi 20 | -------------------------------------------------------------------------------- /sql/scripts/instance_config.sql: -------------------------------------------------------------------------------- 1 | USE master; 2 | GO 3 | EXEC sp_configure 'show advanced options', '1'; 4 | RECONFIGURE WITH OVERRIDE; --------------------------------------------------------------------------------