All Questions

Filter by
Sorted by
Tagged with
0
votes
1answer
59 views

Is there a database table design to avoid storing table names in a table?

So my scenario demands to store details of businesses which offer varied services. One business can offer n different services. Since each service is different, details pertaining to a service are in ...
0
votes
0answers
43 views

A Procedure Causes Some Blockings In SQL Server [on hold]

There is a stored procedure in my sql server database and it causes so much blockings for itself. Here is the code. How to solve this issue? USE [FATURA] GO /****** Object: StoredProcedure [dbo]....
-1
votes
0answers
26 views

SQL Server crash? [on hold]

My Application on .Net framework using entity framework. I am using stored procedures also sometimes SQL server crash and need to restart server.how to trace why this problem occur?
0
votes
1answer
21 views

Speed up simple MySQL query on large database

I have a database with 1 million records and I frequently run this very simple query: select id from my_table limit 1000000; It takes around 5 seconds to execute. And if I add more columns to the ...
4
votes
1answer
66 views

Restore stuck in ASYNC_IO_COMPLETION

Very frequently when I restore databases the restore operation gets stuck and the wait type is ASYNC_IO_COMPLETION. It can be in such state for 10-20-30 minutes untill it proceeds to ...
0
votes
0answers
23 views

Can a decomposition of a database table into 2nf, or 3nf yeild different table results depending on the sequence of splitting?

I am not able to check if the decomposition of a table into 3nf, or 2nf form will depend on the sequence of decomposition. Please help, I want to be assured that even if I adapt different sequence of ...
0
votes
0answers
14 views

SqlAlchemy on conflict returning id [on hold]

I need to convert a PostgreSQL raw query to SQLAlchemy ORM. base = declarative_base() class table_name(base): __tablename__ = "table_name" id= Column(Integer, primary_key=True, autoincrement=...
0
votes
0answers
20 views

How to Track Table Usage

I need to track usage for 1 table, and log how this table is accessed (select, insert, etc.) and by which logins What is the proper way to do it using SQL Server Audit and Extended Events ? If there ...
0
votes
0answers
19 views

Data Loss issue while migrating data from Source(Oracle) to Data Warehouse Staging Database(SQL Server)

Project Overview Loading data from Oracle Database to Datawarehouse Staging Database(SQL Server). Using ETL process we are loading data from Oracle to SQL Server. Staging Database in SQL server is an ...
0
votes
1answer
27 views

SQL Server - Log file not shrinking in AlwaysOn group

We have three-node AO setup in SQL Server. Primary node, one secondary node in Sync mode and another secondary node in Async mode. Main Database on Primary node, log file-size is 434GB, Used 99.91%. ...
-1
votes
1answer
40 views

How can I achieve the below case in marketing cloud without using loop? [on hold]

I have a table like this and in the table you can see 123 losing to 456, 456 losing to 789 and 789 losing to 101112 and in the same fashion for ID's 5 and 6. In this case I want to replace winner ...
0
votes
0answers
17 views

Postgres Pass Subquery results to function that returns TABLE

I have a function that accepts arrays as parameters and returns a table. I can get the arguments passed in correctly, but it is returning rows of type record. If I try to expand the record with FROM I ...
1
vote
1answer
10 views

Cannot run 'uuid-ossp' functions even when it's activated

I want to generate a v4 uuid in PostgreSQL using the extension uuid-ossp, so in psql I ran: CREATE EXTENSION "uuid-ossp"; Then I ran SELECT uuid_generate_v1(); or SELECT uuid_generate_v4(); but I ...
0
votes
1answer
16 views

Is there a way to alias columns for reference in subqueries?

I have a SQL statement in PostgreSQL that takes the following form: SELECT * FROM db WHERE (b + 1) IN (SELECT b FROM db WHERE a = 7) This query returns each record whose b value, incremented by 1, ...
-1
votes
0answers
27 views

Insert into select 2 million row takes 1 hour sql server [on hold]

I am trying to insert into a table with select which returns around 2 million rows, this insert takes an hour, the query has just one where clause which is a date. nothing else.The table has 84 ...
-1
votes
0answers
14 views

to write and read in real time daily 15GB data - help select DB [on hold]

Currently, data is managed in a file(csv). The amount of data collected during the day is about 15GB per day. (10-15 GB) Currently, it is saved only as a file and later processed and analyzed. but ...
0
votes
1answer
34 views

Oracle function based index with empty function name

I'm trying to understand this syntax in the creation of an index in a database I'm using: CREATE INDEX IDX ON SQ.MYTABLE (('ID_COLUMN1'), ('ID_COLUMN2'), ('ID_COLUMN3')); After searching for a ...
1
vote
0answers
15 views

How to Parse a query in Azure Data Studio?

In Sql Server Management Studio, we can click a "Parse" button (or Ctrl+F5) to verify that a SQL statement is syntactically correct (without executing it). How can I do it the same in Azure Data ...
2
votes
1answer
54 views

Optimize query that only returns when the number of rows to be returned is less than an amount

I have a query that first counts the number of rows to be returned and, if it's below a limit, it returns those rows, else it returns nothing. For context: I have a map that displays some points ...
0
votes
2answers
43 views

SQL Server Always on Three node Cluster

We have two data centers DC1 and DC2 The distance between two DC's are about 200 miles. DC1 - has two nodes DC2 - has 1 node with SQL 2012 Always-On AG and windows 2008R2 Node majority cluster ...
0
votes
1answer
40 views

Specifying Order of Executing Stored Procedures [on hold]

Issue: The order in which my stored procedures are called produces no errors if run independently, but when run as once, yields the following error: Msg 2627, Level 14, State 1, Procedure ...
3
votes
1answer
39 views

SQL Server Plan Cache and Batch Request ration to Compiles [on hold]

I am wondering if I am overreacting and need advice from SQL DBAs. I am working with a client who has a DBA. After some research on my part I am seeing 16GB of cache dedicated to single use ad-hoc ...
1
vote
0answers
10 views

How to use ts_headline with multiple languages

I am using full-text search against a single table column. The data in the column could be of any language with no way to determine the language ahead of time. Assuming I only care about some subset ...
0
votes
1answer
24 views

Moving SQL server 2016 DB's from mirroring to HA

We have Windows Server 2016 machines with SQL server 2016 standard edition. Currently mirroring is implemented and now are planning to move to HA with 1 listener for each DB. We have multiple DB's ...
5
votes
1answer
79 views

Why should foreign keys be implemented in my relational database?

Earlier today, I sparked a rather unexpected debate with my professional peers on the topic of foreign keys in our company's databases. In a nutshell, a software engineer who is senior to me stated ...
1
vote
2answers
35 views

RMAN restoring datafile out of ASM

Why is RMAN restoring the datafiles out of ASM and how to restore a backup into ASM? Here is one output. The tablespace triscaltb was restored in /u01/app/oracle/product/12.1.0/dbhome_1/dbs/...
1
vote
3answers
36 views

Under load, the following job-queue design does not work reliably, why?

I have a job queue table which is meant to mark-and-return one job at a time to the caller. The stored procedure works like this: update job_queue set status = "WORKING", job_id = <...
5
votes
2answers
707 views

Infinite loop in CURSOR

I'm trying to use a cursor to clean up temp tables when they are no longer needed. I have a small table which has the names of the temp tables along with an identifier. The cursor is stuck in an ...
8
votes
4answers
1k views

How do I intentionally fragment a SQL Server Index?

I would like to create bad indexes conditions intentionally on a SQL Server 2017 test database I have, just to better understand these maintenance scripts? SQL Server Index and Statistics Maintenance ...
3
votes
3answers
127 views

What is the latest version of SQL Server native client that is compatible with Sql Server 2008 r2

Title says it all, what is the most recent version of Sql Server native client that is compatible with Sql Server 2008 R2
0
votes
1answer
23 views

Fastest method to export bacpac file from Azure SQL database

I am aware of all the methods and have used it before. While now we have a 10GB database which we need to export.Which method would take the least duration. Using SSMS Export data-tier application ...
0
votes
1answer
17 views

Auto-archive MariaDB10 database table

I am trying to auto-archive active database table to archive database table using stored procedure and event in MariaDB10. These are the steps I am following: Create new table everyday just before ...
4
votes
1answer
35 views

Add INCLUDE term to primary key index in Postgres 11

I work with Postgres 11 and would like to change the index that backs the primary key of a large table (~750 million rows). The primary key is the bigint column id and I would like to include an extra ...
0
votes
0answers
16 views

How Insert data to child table in different schema using trigger function and auto updates for these child tables

I am trying to insert data to the child tables from different schema i.e parent table and trigger function were in schema 1 and child tables were in schema 2. It throws me an error while I am doing ...
1
vote
1answer
32 views

How to determine CHECK or NO CHECK for foreign Key using SQL Server System Tables

I need to know at a low level whether a foreign key is to be exported as CHECK or NO CHECK but can't find out where to find that information. I am using -- using INFORMATION_SCHEMA to enumerate ...
0
votes
0answers
17 views

Mysql considers a constant column NULL in left join

I have a query that uses an left join between a table and a subquery. The subquery has a constant field 'Toys' as Product that in the final result set returns null for every row. The query is: ...
2
votes
2answers
33 views

composite clustered index with partitioning

I have a table with hundreds of millions of rows. Data is regularly retrieved via various queries and inserted. There is a clustered index on LookupID (int) TypeID (int) Created (datetime) (These ...
1
vote
3answers
44 views

How can I drop a view only if it exists in Oracle?

I would like to perform a DROP VIEW IF EXISTS... command on an Oracle DB as it can be done on a MySQL database. How can this be achieved?
0
votes
1answer
26 views

how the database calculate the text size? [on hold]

i have a table stored in file with 2Mb size, when I moved it to the oracle DB, it became around 100 Mb size or more! why? how the DB calculate the text or number size
3
votes
1answer
129 views

How can I get rid of this Lazy Spool, or otherwise improve this query's performance?

Here is the plan: https://www.brentozar.com/pastetheplan/?id=rkM8d7ONS I am mostly interested in how to get rid of the lazy spool? This is the query: SELECT DISTINCT SM.Security_ID '...
0
votes
0answers
14 views

PostgreSQL managed by AWS RDS - rdsadmin maxusedtransaction ID not shrinking

We are using AWS RDS Postgres. We reached the 200 million limit on one of the DB and triggered VACUUM FREEZE which took down the instance for roughly 40mins however the XID didn't shrink at all. We ...
0
votes
2answers
37 views

Is there a good reason to put the company name at the beginning of the table names? [on hold]

When developing a new system, for a big corporation. Technologies: Web, Java, Spring Boot, Rest Api, Postgres, Hibernate Company: Bank System: Promissory control, and all others Company name: ...
1
vote
1answer
11 views

Update all the elements of JSON array nested in a JSON column (Postgres)

I have json column with data that looks like this: { a: [ { q: 5 }, { q: 8 }, { q: 10 } ] } I'd like to map over the elements in the array and add an extra property ...
2
votes
0answers
15 views

How to reassign all privileges to another role in PostgreSQL?

​On an existing PostgreSQL server let say that I have two users "Alice" & "Bob" and I want to clean up my policy because they actually have the same job and should have exactly the same privileges ...
1
vote
2answers
23 views

Power BI Upload to SQL Reporting Services 2016 [on hold]

We have SQL Reporting Services 2016 and create SSRS reports, which are published to the report server. I have started to use Power BI Desktop (free), is it possible to upload the power bi reports to ...
0
votes
0answers
17 views

Where can I find resources for new PostgreSQL server builds? [on hold]

I'm pushing my server admin team to create a build for a new PostgreSQL cluster server. I'm very curious about how AMD's new EPYC Rome platform will affect storage performance, but they are not the ...
0
votes
1answer
50 views

Microsoft SQL Server Metadata Corruption

we have a bad incident right now. One of our larger SQL databases has broken metadata. unfortunately the warnings were ignored and they worked a week on the broken SQL database. Is it possible to ...
0
votes
0answers
8 views

Replicatation broker between master and slave with 'Can't find master key from keyring

I Have created new instance on AWS installed mysql on the server and made that server as Slave and added it to master. Master is in different network. 1) Installed the keyring. Started the ...
-4
votes
1answer
15 views

How to list not nullable unique column list in postgres DB? [on hold]

I want the list of unique columns with not null constraint
-2
votes
1answer
51 views

SQL Server Multicasting - Will it improve performance? [on hold]

Apologies in advance for the vagueness of this question. We're having a new product installed and it's performing really badly. I don't have access to any diagnostics - for this example, let's ...

15 30 50 per page