Categories
Database Development

Postgres denormalize tables into json objects for node

Heres my problem. I have the following tables CREATE TABLE inventory( id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), owner text NOT NULL references profile(name) ); CREATE TABLE inventory_item( id uuid PRIMARY KEY DEFAULT uuid_generate_v4(), description text, amount bigint, inventory uuid nOT NULL references table(id) ); Now I would like to query for a single inventory all […]

Categories
Database Development

Will SQL Server go offline if it loses network connectivity to SAN where master and msdb system databases reside?

I have a setup where 3 servers combined into Availability Group All 3 servers have local directly attached SSD drives, and user database files are hosted on these drives But the system databases (master and msdb) of each server in AG, are hosted on a SAN device that is accessed over the network Did not […]

Categories
Database Development

Linked Server to Hana DB

I am trying to create a linked server connection from sql-server to Hana DB. I have downloaded the Hana client and all the drivers along with it. I have tried creating a system DSN and then adding the Hana database using the sp_addlinkedserver and sp_addlinkedsrvlogin procedures. This creates the linked server but when I expand […]

Categories
Database Development

How should I model my database – cannot decide on multiple options

I apologize if this might be a rather beginner-level-question. For my database design, I have worked out multiple options but cannot decide on which one I should implement. I am using 10.4.17-MariaDB. The basic idea: I have a Table called Article in which I want to store simple fields such as name (e.g. varchar), description […]

Categories
Database Development

How should I model my database – cannot decide on multiple options

I apologize if this might be a rather beginner-level-question. For my database design, I have worked out multiple options but cannot decide on which one I should implement. I am using 10.4.17-MariaDB. The basic idea: I have a Table called Article in which I want to store simple fields such as name (e.g. varchar), description […]

Categories
Database Development

Display line number where error occurred in DB2 stored procedure

I have added an EXIT handler in my procedure that captures the SQLSTATE and SQLCODE, and even found a way to get the procedure name, but I also need to know where the error occurred. Suggestions greatly appreciated. declare EXIT handler for SQLEXCEPTION begin select sysibm.routine_specific_name, SQLSTATE, SQLCODE into v_sp_name, v_sqlstate, v_sqlcode from sysibm.sysdummy1; call […]

Categories
Database Development

barman + how to cleanup the wals folder

we are using the barman – backup and restore for postgresql we noticed the under folder usage – /var/lib/barman/main-db-server/wals is 110G example to what we have 824M /var/lib/barman/main-db-server/wals/0000000100000010 692M /var/lib/barman/main-db-server/wals/0000000100000011 677M /var/lib/barman/main-db-server/wals/0000000100000012 681M /var/lib/barman/main-db-server/wals/0000000100000013 677M /var/lib/barman/main-db-server/wals/0000000100000014 686M /var/lib/barman/main-db-server/wals/0000000100000015 680M /var/lib/barman/main-db-server/wals/0000000100000016 701M /var/lib/barman/main-db-server/wals/0000000100000017 . . . . . . and date and time drwxr-xr-x. 2 barman […]

Categories
Database Development

Index automation job script

Our Production instance is running SQL Server 2014. There needs to be an automated Index defragmentation job that will either reorganize or rebuild the indexes based on the fragmentation level for a specific table in a specific database. This job needs to be scheduled and ran on a weekly basis due to large data load […]

Categories
Database Development

DB autogrowth issue

I have a database that will growth in 1 month time the autogrowth was set to 500MB but as I monitored it, the consumption is 1GB+ per day. Should I wait for it to auto grow or is it better to set the initial size to much bigger size? Or set the auto growth to […]

Categories
Database Development

DB autogrowth issue

I have a database that will growth in 1 month time the autogrowth was set to 500MB but as I monitored it, the consumption is 1GB+ per day. Should I wait for it to auto grow or is it better to set the initial size to much bigger size? Or set the auto growth to […]