Skip to main content

Posts

Showing posts from December, 2018

Powershell to collect SQLServer compliant info Verson 2

We established some best practice rules for SQL Server, we need method to collect these data and analyze the compliance. Powershell script is our solution。 The Best Practice rules are: ##• Do not install sqlserver on C drive, ##• do not put database files on C drive ##• Set maximum memory: should not left as default, leave 1GB memory for OS ##• Agent start automatically ##• Database auto growth on, with 10% percentage ##• Database backup regularly, either by SQLServer maintenance, Netbackup agent or Doc Ave ##• Transaction log backup regularly to prevent db size growth out of control ##• Disable CLR, with exception on kdcwdbsqlprd03 where respontek requires CLR. ##• Disable xp_cmdshell ##• Database recovery mode: full recovery mode for production, simple recovery mode for PPE ##• Turn off DB autoshrink Step 1: create the tables in oracle where the data will be saved, we choose oracle, it can be MSSQL, create table mssqlhostcpuinfo (hostname varchar2(20),