2021-11-21

PowerShell Class

With PowerShell 5 we were given the possibility to create more "real" custom classes.

I have some notes, trials and personal examples in SQLAdmin Github (link).

2021-11-20

Short name of file or directory

 Some situations still require a short name like a 8.3 name of a file. This will often be on not only the name of the object but on the entire path. Back in the days of the Windows Shell we would use the command dir /x.

I have looked into getting the short name in a PowerShell script to make it available in a more complex script. 

Unfortunately .NET does not have such a method to a FileInfo or DirectoryInfo object. So I have used the Win32 function GetShortPathName().

The script is in SQLAdmin Github (link) with some technical notes in the associated markdown file.

2021-05-13

Recovery Point Objective with a time perspective

 Usually the Recovery Point Objective (RPO) is only discussed as the data loss in the time between the last backup and the incident. But on most systems a point-in-time restore is not relevant after some time. After some time and backup generations most backups are becoming irrelevant, and can be deleted to save storage. A few backup are then kept for audit purpose and long term investigations.

A RPO plan could look lige this:

  1. 0 to 42 days: Point-in-time
  2. 42 days to 3 years: Week
  3. 3 years to 10 years: Month
  4. 10 years to 20 years: Quarter
Cleaning up backup data is also called remediation  of backup data.

Cleaning up data is not only the backup sets but also the metadata on the backups. But the metadata on the backup duration, size of backup set etc. could be useful with a high degree of detail for a longer time that the backup sets.

2021-03-10

Windows Server 2022 preview on VMware Workstation

 If you want to try Windows Server 2022 preview on VMware Workstation there are a few steps you have to go through.

  1. Sign up for Windows Insider (link).
  2. Download Windows Server Insider Preview (link). Do it as a ISO-file.
  3. Install a new VM on the ISO. I configured the VM for 8 GiB memory, 4 processors each with one core and a 64 GB NVMe disk. I have disabled USB and removed printer on the VM.
  4. Get the product key in the blog entry "Announcing Windows Server Preview Build 20308". This you will have to use to get updates, which are frequent on a preview.
Do the updates and select to not transfer settings until you are up-to-date. Then you can start installing VMware Tools and configure the Windows Server installation.

I have chosen to install the complete set of VMware Tools, but I am sure that is not a requirement to get a decent installation.

Now you can start working on the Windows Server 2022 with your favorite applications. My favorite is SQL Server ;-)

Some initial steps could be to install PowerShell 7, disable Print Spooler service and other trivials.

FYI - I am running VMware workstation 16 Pro on Windows 10 (Pro for Workstations) on a i7-6700 with 64 GiB memory  and 1 TB SATA for VMs.

2021-02-08

SQL Server troubleshooting

Microsoft has moved the SQL Server troubleshooting documentation to a new and dedicated location:

https://docs.microsoft.com/en-us/troubleshoot/sql/welcome-sql-server

The documentation is moved from Knowledge Base articles. These articles still exists but are now focused on release notes.

See more details on the new SQL Server trouble shooting dokumentation site:

https://techcommunity.microsoft.com/t5/sql-server-support/new-home-for-sql-server-troubleshooting-kb-articles-and-for/ba-p/2113331