Posts

Showing posts from November, 2013

SQL Server: SQL Build post script or Script to be executed after SQL SERVER Installation

Post scripts to implement after successful SQl Server installation in a new server:
1. Listing the advanced configuration options and RUN the reconfigure statement to install. use master go sp_configure 'show advanced options',1 go reconfigure with override go
2. Enable the Database Mail XPs.
sp_configure 'Database Mail XPs',1 --go --sp_configure 'SQL Mail XPs',0 go reconfigure go
3. Mail account settings
a).Create an account for the notifications(set the email account, mail server and user credentials as per your environment)
EXECUTE msdb.dbo.sysmail_add_account_sp @account_name = 'SQL', @description = 'DBA Email account', @email_address = ' sqlalerts@gmail.com', @display_name = ' SQL DBA Alerts', @username='', @password='',   @mailserver_name = 'smtp.gmail.com'
b).Create a new mail profile. EXECUTE msdb.dbo.sysmail_add_profile_sp            @profile_name = 'mssql',            @description = 'Pro…

SQL Server:Steps to Configure Database Mirroring by T-SQL Script.

Enable Mirroring Check Endpoints & mirroring logins account exist by running the below scripts‘MIR1_Script to check endpoints and logins.sql’
--Scripts to check existence of endpoints and port associated with database --mirroring in the principal and mirror server.
SELECTe.name,e.protocol_desc,e.type_desc,e.role_desc,e.state_desc, t.port,e.is_encryption_enabled,e.encryption_algorithm_desc, e.connection_auth_desc FROM