Thor Logo dbatools

Snapshot

Get-DbaDbSnapshot

Simone Bizzotto (@niphlod)

Get-DbaDbSnapshot View Source Simone Bizzotto (@niphlod) Windows, Linux, macOS Synopsis Retrieves database snapshots with their source databases, creation times, and disk usage Description Collects information about all database snapshots on a SQL Server instance, showing which database each snapshot was created from, when it was created, and how much disk space it’s consuming. This is useful for snapshot management, cleanup activities, and monitoring storage usage of point-in-time database copies. You can filter results by specific base databases or snapshot names to focus on particular snapshots of interest.

Read more

New-DbaDbSnapshot

Simone Bizzotto (@niphold)

New-DbaDbSnapshot View Source Simone Bizzotto (@niphold) Windows, Linux, macOS Synopsis Creates database snapshots for point-in-time recovery and testing scenarios Description Creates read-only database snapshots that capture the state of a database at a specific moment in time. Snapshots provide a fast way to revert databases to a previous state without restoring from backup files, making them ideal for pre-maintenance snapshots, testing scenarios, or quick rollback points. The function automatically generates snapshot file names with timestamps and handles the underlying file structure creation.

Read more

Remove-DbaDbSnapshot

Simone Bizzotto (@niphold)

Remove-DbaDbSnapshot View Source Simone Bizzotto (@niphold) Windows, Linux, macOS Synopsis Drops database snapshots from SQL Server instances Description Removes database snapshots by executing DROP DATABASE statements against the target SQL Server instances. Database snapshots are point-in-time, read-only copies of databases that consume minimal space through copy-on-write technology. This function helps DBAs clean up obsolete snapshots that are no longer needed for reporting, testing, or recovery purposes. The Force parameter can terminate active connections to snapshots that might otherwise prevent the drop operation from succeeding.

Read more

Restore-DbaDbSnapshot

Simone Bizzotto (@niphold)

Restore-DbaDbSnapshot View Source Simone Bizzotto (@niphold) Windows, Linux, macOS Synopsis Restores SQL Server databases from database snapshots, reverting to the snapshot’s point-in-time state Description Restores SQL Server databases to their exact state when a database snapshot was created, discarding all changes made since that point. This is particularly useful for quickly reverting development databases after testing, rolling back problematic changes, or returning to a known good state without restoring from backup files.

Read more