While there are several benefits to having the metrics collected / aggregated in a centralized database, a definite advantage of the per-database model is that the data is available whenever and wherever a particular database is restored. The main use-case is when moving a database between instances. In the centralized model, a database's data does not live with that database, and will be missing if the database is restored to a different instance (even if on the same server).
Perhaps there could be a stored procedure that would copy a database's OQS data from a centralized store to a local (i.e. per-database) store. It would first need to ensure that the schema exists in the local database, and then copy the data for just that one DB into that DB.
Upon being restored, the database_id in the OQS tables will likely need to be adjusted since that database will probably have a different "database_id" value on the new instance. So there might need to be a "sync database_id in local store" stored procedure.
Then, once the database_id is correct for the new instance, there should probably be another stored procedure that can copy the local data into a centralized OQS database
While there are several benefits to having the metrics collected / aggregated in a centralized database, a definite advantage of the per-database model is that the data is available whenever and wherever a particular database is restored. The main use-case is when moving a database between instances. In the centralized model, a database's data does not live with that database, and will be missing if the database is restored to a different instance (even if on the same server).
Perhaps there could be a stored procedure that would copy a database's OQS data from a centralized store to a local (i.e. per-database) store. It would first need to ensure that the schema exists in the local database, and then copy the data for just that one DB into that DB.
Upon being restored, the
database_idin the OQS tables will likely need to be adjusted since that database will probably have a different "database_id" value on the new instance. So there might need to be a "sync database_id in local store" stored procedure.Then, once the
database_idis correct for the new instance, there should probably be another stored procedure that can copy the local data into a centralized OQS database