INTRODUCTION
As you know, the latest version of Veeam Backup & Replication, that is 12.1.2.172, was released last May 21.
Among the various new features and security patches, the aspect I would like to elaborate on is this:
Security & Compliance Analyzer
A new backup infrastructure check was added to ensure that the PostgreSQL instance hosting the configuration database has been configured with the recommended settings. These settings can be applied with the Set-VBRPSQLDatabaseServerLimits cmdlet.
This new check just verifies that the recommended settings for PosgreSQL are actually applied to our backup server.
But what does it mean in detail?
INFRASTRUCTURE CHECK DETAILS
We know that since version 12 of VBR, the database that is installed by default is PostgreSQL and no longer the Microsoft SQL Express.
So when installing the product, if you choose to keep the default DB and have it installed during the wizard, Veeam will install PostgreSQL on the same VBR server.
During this operation, Veeam will edit the file C:\Program Files\PostgreSQL\15\data\posgresql.conf setting the recommended parameters for its DB.
So, if after a standard installation like the one described above we run the Security & Compliance Analyzer tool, we notice that the new check on PosgreSQL gives us a positive result.
![](https://uploads-eu-west-1.insided.com/veeam-en/attachment/5e83ab14-6cda-41eb-b0fe-65991e92f695.png)
So when should the Set-VBRPSQLDatabaseServerLimits command be applied ?
USE CASES
There are basically two cases:
- PostgreSQL is installed manually, thus not automatically during Veeam deployment.
- CPU and/or RAM resources of the server on which PostgreSQL is installed are changed.
![](https://uploads-eu-west-1.insided.com/veeam-en/attachment/8f24d4b2-9ffa-4fe1-91a0-fb556fca676a.png)
How to use the Set-VBRPSQLDatabaseServerLimits command depending on the case scenarios?
There are essentially three ways:
- Modify a local PostgreSQL instance: from the Veeam powershell, run the Set-VBRPSQLDatabaseServerLimits command and restart PostgreSQL services to make the change effective
- Modify a remote PostgreSQL instance already used by Veeam: from the Veeam powershell, run the command, with the appropriately set parameters, Set-VBRPSQLDatabaseServerLimits -OSType <String> -CPUCount <Int32> -RamGb <Int32> and restart the PostgreSQL services to make the change effective
- Modify a remote PostgreSQL instance not yet used by Veeam: from the Veeam powershell, run the command, with the appropriately set parameters, Set-VBRPSQLDatabaseServerLimits -OSType <String> -CPUCount <Int32> -RamGb <Int32> -DumpToFile <String> and restart the PostgreSQL services to make the change effective.
![](https://uploads-eu-west-1.insided.com/veeam-en/attachment/574e0258-4dd4-4b1a-b827-575b78a33d93.png)
Specifically, OS type refers to the OS version of the server where PostgreSQL is installed, CPUCount and RamGb are the CPU and RAM parameters of the server where PostgreSQL is installed, DumpToFile is the path where a file with a .sql extension containing the recommended settings will be generated.
Example: Set-VBRPSQLDatabaseServerLimits -OSType <String> -CPUCount 16 -RamGb 30 -DumpToFile "C:\file.sql"
It is not explicitly specified in the official guide (you can see only “run it” in the PS output), but obviously in the third mode the file with the optimized parameters must be “uploaded” to the PostgreSQL server.
![](https://uploads-eu-west-1.insided.com/veeam-en/attachment/a5cf3f50-a76f-4e42-860b-9152318d7c17.png)
To pass these parameters to the PostgreSQL instance you can use, for example:
- PgAdmin's query tool
- The psql command line
In all cases these operations will go to modify, via the ALTER SYSTEM command, the C:\Program Files\PostgreSQL\15\data\posgresql.auto.conf file, which is read each time the C:\ProgramFiles\posgresql.conf file is and effectively overwrites the parameters of the existing settings.
REFERENCES
https://helpcenter.veeam.com/docs/backup/powershell/set-vbrpsqldatabaseserverlimits.html?ver=120
https://www.postgresql.org/docs/current/config-setting.html
Enjoy!