Out of memory exception in SQL Server Management Studio (SSMS) while opening ‘restore database’ page

Recently, my colleague came across a problem while trying to open the ‘Restore Database’ page in a SQL server database management tool , SSMS. Whether he right-clicked on the ‘Databases’ folder or on a specific database, the page wouldn’t open and eventually, he received an “out of memory” error message. Exception of type ‘System.OutOfMemoryException’ was … Read more

Using Snapshot Replication for Schema Transfer/Refresh Only

Snapshot replication distributes data exactly as it appears at a specific moment in time and does not monitor for updates to the data. When synchronization occurs, the entire snapshot is generated and sent to Subscribers. The snapshot process (which creates a copy of all of the objects and data specified by a publication) is also … Read more

Cleanup Log-shipping configuration through TSQL

For database migrations, DBAs many times configure log shipping from old server to new server to reduce the downtime required during the cutover. Below approach is followed to perform such migrations As in above approach, we offline our databases on primary instance , we can no longer remove the log shipping configuration using GUI through … Read more

Configure non-default PostgreSQL instance for automatic start on machine start in RHEL

Due to policies for Red Hat family distributions, the PostgreSQL installation is not enabled for automatic start or have the database initialized automatically. Database cluster need to be initialized manually post installation. Once initialized, data directory will get created but still PostgreSQL will not be running. We can use ‘systemctl’ service to enable and start postgresql-<versionnumber> … Read more

Código de error: 22903, texto: “Ya hay otra conexión ejecutando ‘sp_replcmds’ para la captura de datos modificados en la base de datos actual.”

Recientemente me enfrenté a un escenario muy interesante en el que para una base de datos se habilitaban tanto la captura de datos modificados como la replicación transaccional. Según la documentación de MS, ambas funciones pueden funcionar juntas, pero debemos tener algunas cosas en cuenta al implementar ambas funciones juntas en una base de datos. En … Read more

Import all logs to S3 bucket using DAS (Data Activity Stream) feature in Aurora Postgre RDS

Recently there was a requirement where I have to work on publishing all the activities (in real time) that is being done in a RDS instance (Aurora in this case) to S3 bucket as readable log files into a S3 bucket. So after researching and working on it by getting bits and pieces from different … Read more

Powershell to Automate Reindexing on Azure SQL DB

I was working on Azure SQL DB and got the task of running reindexing over several Azure SQL DB… I thought of why not automating it instead of running the script over the Azure SQL dbs one by one …

PowerShell to export data from a SQL Server table to csv in chunk of 15 days

A client had a table which was storing data since 11 years, and he wanted to export all that data into csv files in a chunk of 15 days data per csv file. So I developed a PowerShell script to do the same. Hope it helps in different scenarios.

Compresión de datos en SQL Server

A medida que las bases de datos crecen cada vez más, un desafío al que se enfrentan los administradores de bases de datos es administrar el tamaño de sus bases de datos. Las bases de datos más grandes pueden consumir más espacio en disco, memoria y potencia de procesamiento, lo que puede resultar en tiempos de … Read more

TSQL to get comprehensive SQL server backup report

Many times while trouble shooting backup issues on SQL server we have to check manually that when was the latest backup taken , where it was taken and for which all databases it happened . This requires a lot of manual clicks and script typing. To ease this , I have developed a script that … Read more