Installation and upgrade
Install YourSqlDba by running the main T-SQL installation script. This creates or updates the YourSqlDba database and deploys the objects used by maintenance.
Prerequisites
- SQL Server instance with SQL Agent enabled
- permissions to create or alter the
YourSqlDbadatabase - access to backup directories used by SQL Server
- Database Mail available for email reporting
- Windows account or service account that can write to backup paths
First installation
For a first installation:
- Open
YourSQLDba_InstallOrUpdateScript.sqlin SQL Server Management Studio. - Run the script against the target SQL Server instance.
- Execute
Install.InitialSetupOfYourSqlDbawith values that match your environment. - Review the created SQL Agent jobs and schedules.
- Confirm that Database Mail and SQL Agent notifications work.
Example:
EXEC Install.InitialSetupOfYourSqlDba
@FullBackupPath = N'D:\SQLBackups',
@LogBackupPath = N'D:\SQLBackups',
@email = N'dba-team@example.com',
@SmtpMailServer = N'smtp.example.com';
Initial setup
Initial setup creates the default SQL Agent maintenance jobs and configures:
- full backup path
- transaction log backup path
- Database Mail profile
- SMTP server
- notification recipients
- SQL Agent schedules
This step is required after a first installation.
Created SQL Agent jobs
The initial setup creates two default jobs.
| Job | Procedure called | Purpose |
|---|---|---|
| Full maintenance | Maint.YourSqlDba_DoMaint | Daily maintenance and full backups |
| Log backups | Maint.YourSqlDba_DoMaint | Frequent transaction log backups |
Each job contains a SQL Agent job step that calls Maint.YourSqlDba_DoMaint with different parameters.
Upgrade
To upgrade YourSqlDba, run the latest YourSQLDba_InstallOrUpdateScript.sql again.
The upgrade process preserves YourSqlDba configuration and history while updating the database objects.
After an upgrade:
- Review the version history.
- Check SQL Agent job steps for changes.
- Run a maintenance job manually if you want immediate validation.
- Confirm that the maintenance email report is received.
When to rerun initial setup
Rerun Install.InitialSetupOfYourSqlDba only when you need to recreate the default job definitions, backup paths, mail profile, or notification settings.
Warning:
Install.InitialSetupOfYourSqlDbarecreates the default definition of the daily maintenance and log backup jobs. Review any custom SQL Agent job steps before rerunning it.