SQL Server Miscellaneous Operation Tasks

SQL Server Miscellaneous Operation Tasks

This page contains information about small and helpful operational tasks and settings.

1. Compression

Dbvisit Standby Version 12.3 introduced new feature for SQL Server: Support for native SQL Server compression. Only Enterprise, Standard, Developer, and Business Intelligence editions support compression (i.e. excluding Web & Express Editions). Dbvisit utilizes ALGORITHM = MS_XPRESS.

More details can be found in MS Doc:

https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/view-or-configure-the-backup-compression-default-server-configuration-option?view=sql-server-ver16

Dbvisit enables user to utilize compression for following tasks:

1.1 Create Standby Database

Dbvisit enables user to utilize compression for create standby database task: https://dbvisit.atlassian.net/wiki/spaces/DSMPV12/pages/edit-v2/4521558021 Compression can be set by selecting following option:

image-20260112-142715.png

When enabled, dbvisit will create a compressed full database backup on primary making whole process quicker if there’s a concern for network bandwidth between primary and standby server.

This is one-time compression enable option for one create standby database process.

1.2 Synchronize

Much like compression for Create Standby database, user is also able to enable compression option for primary database backup for Synchronize process SQL Server Synchronize Standby :

image-20260112-143814.png

This is one-time compression enable option for one synchronize database process.

1.3 Manual and Automatic log shipping

Dbvisit is able to use compression for log backups as well. This helps in environments with big transaction load and low network bandwidth between primary and standby. It is expected (but not guaranteed) that the compression ratio will be better than 50%. The compression is effective for logshipping done by automatic standby update (ASU) as well as for situation when log backup is done manually by user:

Configuring Synchonization

The log shipping compression can be enabled during create standby database process:

image-20260112-144635.png

choosing “Instance Default” will assume value “backup compression default” from sys.configurations

This will affect future log backups. It is also possible to modify the compression for log backups once standby database is created in the configuration ACTIONS pane:

image-20260112-145027.png

2. Login Synchronization

Dbvisit is able to synchronize logins from primary instance to the standby instance. This is useful for example before activation or switchover is done: the users can be created in the standby server preventing issues with logins after standby database role change.

The login synchronization is done per-database basis and particular login to be synchronized must fulfill following conditions:

  • user must be mapped to the primary database in the primary instance:

image-20260112-150631.png

in this example user “sync_user” is mapped to the database “ocean”

  • user must not be present in the standby instance

Once both conditions are fulfilled, it is possible to synchronize login via the ACTIONS pane using “Synchronize Logins” Option (1):

image-20260112-151045.png

Once you press (2) and confirm (3) the login and its password will be synced to standby instance:

image-20260112-151227.png

User Server Roles are not synchronized

3. Start/Stop Database

You can use dbvcontrol GUI to start, stop or restart your primary Database. You can also restart standby database which is in read-only mode. From the ACTIONS pane, select “Change Database State”:

image-20260113-075624.png

3.1 Primary Database

You can choose desired action for your primary database:

image-20260113-075955.png

Bring Online (1) - open database read-write. This option is available only if primary database is OFFLINE

Take Offline (2) - stop the database and put it to OFFLINE mode

Restart (3) - put the database into OFFLINE mode, then bring it back to read-write mode again

3.2 Standby Database

It is possible to change standby database state only if it is in read-only mode: SQL Server Standby Read Only Mode If so, you can then restart it back to restoring mode or take it offline:

image-20260113-082419.png

 

Bring Online (1) - (only possible if standby database state is OFFLINE) brings the standby database into READ-ONLY mode

Take Offline (2) - Takes the standby database OFFLINE

Restart (3) - restarts the standby database into READ-ONLY mode

To bring standby database back to RESTORING state, you must use option “Switch Into Read Only Mode” from the actions pane as described in: SQL Server Standby Read Only Mode

4. Automatic Configuration Creation

Dbvisit StandbyMP can help users to enable automatic configuration creation for instance pair. Whenever new database is added to any instance in defined instance pair, which has automatic configuration enabled, then Dbvisit will perform automatically following tasks:

  • create DDC configuration for this new database. Dbvisit will designate the instance to which the database was added as primary instance. Dbvisit will designate the other instance from the instance pair as standby instance.

  • run create standby database process

  • enable Automatic Standby Update (ASU) for this automatically added DDC

This feature is useful when databases are frequently or on regular basis added to your SQL Server instances.

To enable automatic configuration creation, it is necessary to have at least one log shipping configuration created between two SQL Server instances. The option can be accessed by clicking on “A” button (2) for desired instance pair (1):

image-20260113-100535.png

Automatic configuration creation can be then configured:

image-20260113-102752.png
  • it is possible to enable the automatic creation per instance in the instance pair (1,2)

  • it is possible to exclude databases (current and future) from the automatic configuration creation. First fill in name in the textfield (3) and click on add button (4). Same can be done for standby instance (5). It is possible to use * wildcard

Be sure to exclude all existing databases you don’t want to replicate between the instances.

  • save all settings (6)

Once the settings are save they will come into effect. Automatic configuration creation will shortly start and run for each database which is located on the instance for which the feature was enabled and has not yet DDC configuration created.

The settings are effective for all existing databases on both instances and also for any database created in the future in both instances

Deletion of database performed by user in any instance is not handled by Automatic Configuration Creation in any way

Example:

Before automatic creation is enabled, the list of DDCs in dashboard is:

image-20260113-102409.png

Primary instance CZWIN0191 contains databases:

image-20260113-102439.png

Standby instance CZWIN0192 contains databases:

image-20260113-102517.png

The settings used for automatic configuration creation are:

image-20260113-102930.png

After settings are saved, within one minute, the automatic creation will start to be effective and creation of DDCs and standby database will be performed as per defined criteria. Once the automatic creation finishes, the status for this example will be:

dashboard:

image-20260113-103240.png

Primary instance CZWIN0191 contains databases:

image-20260113-103313.png

Standby instance CZWIN0192 contains databases:

image-20260113-103350.png
  • replication for database ocean was not automatically created, because it was excluded from the list on CZWIN0191

  • replication for database AdventureWorks2019 was automatically created because it was not excluded from the list on CZWIN0191 and standby database wasn’t present on CZWIN0192

  • replication for database test1 was automatically created because it was not excluded from the list on CZWIN0192 and standby database wasn’t present on CZWIN0191