Categories
Database Development

Question response time on StackOverflow

I thought that this was fun to share. I was wondering when should I give up all hope that my question would ever be answered and begin to start crying. So, I wrote a query for the StackOverflow DB that would give me that answer (in general). It calculates how many and what percentage of […]

Categories
Database Development

What value to set for MAX and MIN memory of SQL Server hosted on Bare Metal

Within AWS, Many of our Database servers are being migrated from EC2 Instance to Bare Metal. (Correct me, If I am wrong) In Bare metal, there are two memory limits available for the VM hosted on Bare metal. Current total memory that is assigned to the VM hosted on Bare metal. (105 as per below […]

Categories
Database Development

Why is it important for every table to have a primary key?

So I have some tables in Sql Server that are essentially a list of sales, things like: ProductID SalesOrderID ProductFamilyID ProductCost ProductSource and so on. In this case, none of the columns are necessarily unique, so I can’t create a primary key from any combination of them. In fact, the only constraint that I really […]

Categories
Database Development

MySQL: change column type using expression

In a MySQL database, I need to convert some UUID columns (BINARY(16)) into VARCHAR. I want to convert them in the canonical form, not as bytes. For clarity, in lowercase and with hyphens, and not in the 0xHEXADECIMAL format. In Postgres, this is enough: ALTER TABLE my_table ALTER COLUMN my_uuid_column TYPE VARCHAR(36); The MySQL equivalent […]

Categories
Database Development

DBCC CHECKTABLE – 2570 error

Running DBCC Checktable on one of my tables causes several errors: Msg 2570, Level 16, State 3, Line 1 errors, Page (1:442), slot 1 in object ID 565577053, index ID 0, partition ID 72057594041270272, alloc unit ID 72057594046906368 (type “In-row data”). Column “XXXX” value is out of range for data type “decimal”. Update column to […]

Categories
Database Development

Restore mongodb database from blockstore snapshot backup

I have a situation where I need to restore the mongodb database from the blockstore snapshot backup taken from the ops manager which is used to manage 3 node replica set. I need to restore this backup into the new completly standalone instance in the DR site. I am new working with MongoDB and not […]

Categories
Database Development

Database ER diagram review. Is this a good database design?

I have a task to design an ER diagram and task is given as points below is the description of the problem: A telecommunicationscompanyemploys thousands of consultants. Each consultant is assigned to company department, each department might be a part higher level company division up to the CEO board (multiple levels) The personal dataforeach employee […]

Categories
Database Development

Database ER diagram review. Is this a good database design?

I have a task to design an ER diagram and task is given as points below is the description of the problem: A telecommunicationscompanyemploys thousands of consultants. Each consultant is assigned to company department, each department might be a part higher level company division up to the CEO board (multiple levels) The personal dataforeach employee […]

Categories
Database Development

Database ER diagram review. Is this a good database design?

I have a task to design an ER diagram and task is given as points below is the description of the problem: A telecommunicationscompanyemploys thousands of consultants. Each consultant is assigned to company department, each department might be a part higher level company division up to the CEO board (multiple levels) The personal dataforeach employee […]

Categories
Database Development

How to “catchup” data after a backup

I need to transfer a database to another server with hopefully 0 downtime. I have Percona Mysql 8 on the destination and Mariadb on the source. I have successfully used Percona XtraBackup to create a hot backup and restore it to the destination server, but this process took a few hours. About 95% of the […]