All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
13 views

Postgres permission for new objects [duplicate]

Postgres version: 11 I've got 2 roles - one used for read and one for write on the same database. CREATE ROLE reader WITH login; CREATE ROLE writer WITH login; CREATE DATABASE thedatabase; GRANT ...
0
votes
2answers
25 views

What happens at low level when I add a column to a table in PostgreSQL?

I have a table with number of rows in the order of billions. Let's say I want to add a column to that table. I would like to know what happens behind the scene to know the cost, expected time of this ...
0
votes
2answers
52 views

Single node availability group - is it possible?

Is it possible to have an availability group with just one node in it? The reason I ask is because I am considering a distributed availability group spanning two single node always on availability ...
0
votes
0answers
7 views

Separate MongoDB Table Server got down

This issue is very new for me. This scenario is about Production as per I have kept some large tables on other server. for a month The Server was going smooth but after one month it got down ...
0
votes
0answers
13 views

Is Mysql faster if on separate VPS (with cores dedicated to it) or on the same but faster VPS [closed]

Note: This is not a question about capacity planning The problem: Lately traffic on my wordpress site grew and so did my cpu usage. mainly by mysql (roughly 2/3 of the cpu is used by mysql and the ...
0
votes
0answers
47 views

Is it better to store often changed columns in separate table away from more “static” data? [closed]

Please imagine simple database for eshop. There is always "product" table and it can have many relations like product images, category connections, barcodes etc. The "product" table has, for example,...
0
votes
1answer
22 views

Invalid object name 'ApexSQL.ApexSQL_SourceControl.Objects'

I was trialing Apex source control - trial ended. Uninstalled Apex (well I thought I did). Today I deleted the Apex database. Now I get Msg 208, Level 16, State 1, Procedure ...
0
votes
1answer
12 views

Best practices relational design

I'm creating tables in a database currently and one of the tables has a status column. the status column has 4 different statuses that it could potentially have. I've made a separate table that has ...
1
vote
1answer
29 views

Backup and restore for PostgreSQL + why number of backups increased while we limit the recovery window of 7 days

We are using the barman for PostgreSQL backup and restore on rhel 7.2 machines In the barman configuration file - /etc/barman.conf we set the following retention_policy_mode = auto retention_policy ...
0
votes
0answers
35 views

Sqlite - Limit Characters for different parts of one String with Check

I have to make sure that any inserted Email has the format: "X@Y.Z" X and Y may only contain letters and numbers and Z can only have Letters. I tried something like this, but i cant figure out how ...
0
votes
1answer
22 views

how to show combined results of two tables?

I want to show the result as combination of two. Table 1 SELECT au.invoice`.`InvoiceID`, au.invoice`.`UserID` FROM au.`invoice` WHERE au.`invoice`.`InvoiceID` > 11126 -- total results 757 ...
0
votes
1answer
41 views

In SQL server during Log Shippping which portion (active\Inactive) of the Log file (.ldf) backup is taken and further restored in SQL Server

I am confused, like if we take the backup of the whole log file, wont it clear the transaction log though we have copy only backup. In log file we have 2 parts, like active and inactive logs, in ...
-1
votes
1answer
13 views

Compare 2 column- Column A and Column B , result if the column A has the string of Column B get the output [closed]

Sl no Column A Column B 1 Dell Laptop Laptop 2 Dell Mouse Laptop 3 Dell Acc Laptop 4 Dell Laptop 1 Laptop Result Output Sl no Column A ...
0
votes
1answer
16 views

Select rows from table having specific values depending on another values in the same table

I need to be able to select all Userpin that have tr_type 7 only but if there is tr_type 7 and 8 in other row ignore 7 and 8 example: Userpin TrDate Time1 Tr_type 4555 12-02-2020 ...
0
votes
1answer
33 views

Selecting preferred row in database based on condition

I'm new to SQL coding and I'm struggling to find a solution to my issue. I have a database with contractors that have worked at our organisation on and off. The database contains the contractors ...
0
votes
1answer
64 views

change stored procedure to accept a range of ids

So I'm looking at a stored procedure, which works with nopcommerce. It's used when searching products. There is one section which allows filtering of specification attributes, and it it seems to only ...
0
votes
1answer
33 views

Select Column data, from sys.column info

Either this is impossible, or I can't write a good internet search. I have a query to get the table and column information for our database: Select t.name [table], c.name [column] From sys.tables t ...
0
votes
2answers
34 views

Referencing two documents to each other

Is it good practice and or recommended to reference 2 documents to each other using ref? Like this: const FirstDocumentId = mongoose.model( 'FirstDocumentId', new mongoose.Schema({ ...
0
votes
0answers
19 views

Best practice guidelines for a application table archive in Oracle 12C

Database environment: Oracle 12C Enterprise edition I have a table in the application schema and corresponding history table in the history schema. The application table has about 10 small varchar2 ...
0
votes
0answers
21 views

Is it practical to use entity-attribute-value (EAV) model to support custom user fields and avoid bloating of tables?

I am currently working on a medium-sized web app project that is already in production using Laravel framework and MySQL 5.6.40. My clients have been asking for the ability to add additional ...
4
votes
2answers
191 views

Execution Plan Warnings cardinality xml data type

I have the following statements: -- 1st DECLARE @AuditParameters XML = ( SELECT 1 AS AccountID, 2 AS CategoryID, 3 AS CategoryAttributeID, '4' AS SyncBatchGUID ...
0
votes
0answers
19 views

Database migration assistant for Unicode by Oracle is not responding after using schedule column option

I have posted this issue on Oracle Community but I would like to post it on here so that I will have more opinions on this issue. Issue: I am facing an issue with DMU 19.1 which is the DMU ...
0
votes
0answers
21 views

SQL Server Agent fails to start

I am replacing a SQL Server 2012 cluster with a new one (keeping the same version of SQL, changing OS from 2008R2 to 2012R2). I have 1 node installed so far, but the agent won't start. The error ...
0
votes
0answers
20 views

barman & Dockerized PostgreSQL: check timeout: FAILED (barman check command timed out)

I am trying to configure barman to backup a PostgreSQL 11 database running inside a Docker container. barman v2.10 is installed directly in the Ubuntu 18.04.3 host machine. barman check pgsql gives ...
0
votes
2answers
25 views

How should I configure my postgresql.conf file to backup the database once per hour?

My goal is to back up the PostgreSQL 10 database on a Ubuntu 18.04 VPS once per hour. However, I clearly do not understand how to achieve this. Here is what I've done. I modify the postgresql.conf ...
0
votes
1answer
17 views

i have error in query [closed]

i am not getting what is the issue in the query probably i am not following the correct way to put the string and char sign , i am inserting the data in c# to local host with where clause please check ...
1
vote
1answer
16 views

Is it possible to Increase storage performance in azure vm using disk striping?

Given the following Azure VM: E8s_v3 (8 cpu, 64 GB RAM, 12800 IOPS, 192 MBps) I added 2 SSD Premium drives, one for data (1024 GBs / 200 MBps / Host Caching enabled read-only) and one for Logs (256 ...
0
votes
0answers
49 views

Why additional plans are created under simple parameterization?

I have a table which has 2163 rows and clustered index on id column. I run the following queries: select id from ticket_attach where id = 1 select id from ticket_attach where id = 2 select id from ...
-1
votes
0answers
14 views

barman + how to limit barman to create only X backups

we are using barman in order to perform backup for PostgreSQL under - main-db-server/base/ we see 13 backup of folders , and this number is grow each day is it possible to limit barman to create ...
0
votes
1answer
27 views

Using subquery within IF condition

Hello i am having a weird problem currently i have the following query SELECT * FROM `txt_campaign_message` `cm` LEFT JOIN `txt_campaign` `c` ON c.id = cm.campaign_id LEFT JOIN `...
0
votes
2answers
15 views

How to get all create for index and Constraints in PostgreSQL using just SQL

I want a sql to get a list of CREATE of all Index and Constraints in a table 'tablename' just using SQL.
6
votes
1answer
51 views

Azure IaaS VM - Use D:\ Drive for tempdb - NTFS Formatting 64k

This was a question I was battling with earlier today and eventually figured out an answer. Wouldn't mind something better, but wanted to provide this to whomever also needed. First, on an Azure VM ...
0
votes
0answers
61 views

Why simple mysql query takes too long?

I really give up. Mysql server suddenly got working very slowly. I have mysql server 5.7.29-0ubuntu0.18.04.1 - (Ubuntu). The machine is pretty powerful, 50 cores, 300GB RAM. I did not have problems, ...
0
votes
1answer
50 views

Implementing MySQL tuner suggesstions

Mine is GoDaddy VPS with 4CPU, 8GB -200GB Centos server with WHM. I am using latest Moodle with MySQL version 5.7.29 on 64-bit architecture. I was advised to tune DB for better concurrent usage. I ...
0
votes
0answers
12 views

Best way to archive old data from SQL Azure?

I have an app that stores event data. We use SQL Azure. Right now it's very expensive. Over $800/month to host. Once the event is over, I want to move the data to a DB that has a lower cost. Thus this ...
0
votes
0answers
20 views

Optimal query using indexes

I have an sqlite table Task(type INT ,due_date LONG) where due_date is stored in epoch TYPE DUE_DATE ---- ---------- 1 1582038293 1 1485034292 2 1082048291 3 ...
0
votes
1answer
17 views

Mysql max connections and event scheduler

Is there a limit to how many "instance" of a scheduled event MySQL can run? I have set this up: CREATE TABLE IF NOT EXISTS t (c1 INT UNSIGNED NOT NULL) ENGINE=INNODB; SELECT * FROM t; DELIMITER $$ ...
-2
votes
1answer
42 views

PowerShell script to output SQL query results [closed]

I have the SQL cmdlets loaded in PowerShell, need a script to execute a SQL statements and save results in pipe delimited file
0
votes
0answers
20 views

Complete and Accurate xEvents Resources [closed]

Does anyone have a good and COMPLETE resource for xEvents?? (And changes from SQL Version to Version)... There are a lot of bits and piece of information but I have not been able to find a definitive ...
0
votes
1answer
20 views

Select rows from two joined table that not in a third table

I have 3 table A,B,C,D with the same columns and I'm trying to retrieve the user_id that are in table a and b but not c. For instance: Table A user_id closed acct 10102345 ...
2
votes
1answer
40 views

How do I view data in pgAdmin 4? [closed]

Similar to How to view data in pgAdmin III, how do I view data in pgAdmin 4? Like the other question, I can't believe they (still) make it this hard. I have created a table and bunch of records using ...
0
votes
0answers
40 views

SQL Server database restore from backup changes all dates with datetime2 type return with values to future dates

I'm trying to restore a SQL Server database from a .bak file. The process completes without any issues, but the dates with datatype datetime2 are presented with totally different values (change to ...
0
votes
1answer
76 views

Queries on large database kill connection to the server, works with LIMIT

I'm trying to run queries on a large-ish database without killing the connection to the server. I'm using Postgres 12.1 on a mac with 16gb of memory, and about 40gb of free disk. The database is ...
0
votes
0answers
17 views

Getting “unknown variable postgresqlini” when updating PostgreSQL

I am getting an error when attempting to upgrade a PostgreSQL installation. The full error is: A data directory is registered in ***unknown variable postgresqlini*** but is neither empty or a ...
1
vote
2answers
52 views

Querying JSON data

I am struggling to extract data from a table, which was partially inserted from a JSON file. The table has two fields (name nvarchar(50) and details nvarchar(max). The values of the fields are: name ...
1
vote
1answer
40 views

How to reinstall SSISDB

I have a SQL Server 2014 Enterprise Edition where the SSISDB catalog is already here, but corrupted because of a rogue package that made it balloon to enormous size and a failed cleanup attempt. Is ...
1
vote
2answers
34 views

SUM several CASE results

Given: CASE WHEN A IS NULL THEN 1 ELSE 0 END AS [A] , CASE WHEN B IS NULL THEN 1 ELSE 0 END AS [B] , CASE WHEN C IS NULL THEN 1 ELSE 0 END AS [C] How can I SUM A+B+C being the ...
0
votes
0answers
11 views

mysqljs batch insert placeholder for mysql-function

using mysqljs/mysql how to correctly use placeholder when doing batch insert where one or more value is using mysql-functions? e.g: UUID(), UNHEX(), NOW(), DEFAULT, FROM_UNIXTIME(), etc example: ...
0
votes
0answers
13 views

MySQL 5.6 to 8.0 (Windows)

I need to upgrade MySQL 5.6 to 8.0 on a Windows community server (install version). Do I need to dump and import to 5.7 then to 8.0 ? or a simple dump of all databases from 5.6 is enough ? thanks ...
2
votes
1answer
45 views

SQL Server Installer appears to be resetting MSDB Recovery Mode to Simple

Everytime we upgrade a SQL Server installation (service pack or cumulative update), msdb is changed from FULL recovery mode to SIMPLE recovery mode. I understand that the msdb database doesn't change ...

15 30 50 per page