All Questions

Filter by
Sorted by
Tagged with
-1
votes
1answer
34 views

Optimising SQL Query

Currently I have a query to calculate the averages of auctions that are present within a game, in order to do this I have the following query: SELECT item_name, tier , CAST(SUM(highest_bid) AS ...
0
votes
0answers
3 views

How to save database connection information when using `psql`?

I am learning to use psql to work with a postgres database on linux. I can connect using a long connection string, for example by running: psql postgresql://myusername:mypassword@localhost:5433/dbname ...
0
votes
0answers
4 views

Help in database design for creating investment platform

I am creating an investment platform where investors would be able to invest in various real estate properties and also able to sell their shares on platform. There would be the following types of ...
0
votes
0answers
4 views

How to use WITH inside IF statement in PostgreSQL

I am writing a function that accepts a text flag based on which I need to run some code. So I am using an IF clause. However the code that has to execute inside IF and ELSE is a recursive CTE which ...
2
votes
1answer
420 views

how to publish user defined table type as an article in Transactional replication

I am new to replication and trying to use transactional replication. I am trying to publish all data and schema. My stored procedure takes user defined table type as input. CREATE type TableBParam as ...
0
votes
0answers
9 views

SQL Server HA Design (FCI) - Windows Storage Replication - Test-SRTopology - Physical Memory Error - AWS EC2

I'm trying to set up AlwaysOn Failover Cluster Instance (Not Availability Groups) on 2 VMs(each on different AWS Availability Zone) in AWS-EC2 instances. To make this happen, I've to set up Windows ...
0
votes
0answers
4 views

mysql query cache — how to determine if I should turned it off

I have a lot of queries that are repeated and would benefit from cache. A lot of articles online to say to turn it off. Below is `show global status. Do you think I would benefit from turning it off? ...
0
votes
2answers
62 views

Slow planning time on PostgreSQL 12.4

I have a database with Openstreetmap location data, and in particular there is a polygon table with around 500 million rows. I created indexes on all of my queries consisting of using gist(way) where ...
1
vote
1answer
35 views

Modeling an either/or relationship

I've seen this post (How should I model an “either/or” relationship?) but it's not exactly what I'm looking for. both answers are suggesting creating a subtype instead of a relationship. Say I have an ...
0
votes
2answers
14 views

How can I optimize dashboard performance?

I have a table like FieldA, FieldB, FieldC, FieldD, Date, Count I have a web app which provides a dashboard of the top few Count by each of the fields. Not wanting to prematurely optimize, the ...
0
votes
1answer
20 views

SQL Server options that influence log buffer flushing or commits-per-second performance?

I am investigating two SQL Server 2014 instances, both running identical software, both running identical hardware (VMs), both loaded with the same test database, but one with hugely greater ...
0
votes
0answers
5 views

Best Practice on reusing Service Broker Conversations and Conversation Groups

At the moment, we're using Service Broker on a lot of our critical components in our database, and I wanted to ask about the best practices on Conversation and Conversation Group reuse. Presently, we'...
0
votes
0answers
8 views

Implications of using the underscore before the table name

For a ERP database schema, with a large quantity of tables to variable applications, to describe general tables like, users, groups, logs, i can, write table name with a underscore before? Example: ...
0
votes
1answer
176 views

Configuring SQL Server management data warehouse (MDW) for data collection

I am configuring a data warehouse on an SQL Server to collect data. However, the process is not finishing and it stays as per below for hours until it is manually stopped: Have you ever encountered ...
0
votes
1answer
28 views

How can I get LOAD DATA LOCAL INFILE to work for MySQL 8.0.21 on a Windows machine?

I've created a file: 'C:\fff.txt' which contains data for my database table. Then I'm trying to load data from that file like this: LOAD DATA LOCAL INFILE 'C:\\fff.txt' INTO TABLE fff LINES TERMINATED ...
-1
votes
0answers
11 views

Need to duplicate rows that have same criteria in SQL case statement

I have below data set, from which I want to extract multiple rows. account 123 start_date 5/10/20 end_date 10/20/20 Using the below code my result is only 1 row with "today", but since ...
0
votes
2answers
50 views

Benefits of not having a clustered index on tables (Heaps)

What are the benefits of not having a clustered index on a table in SQL server. Will a SELECT * INTO TABLE_A FROM TABLE_B Be faster if TABLE_A is a heap? Which operation will benefit if the table is ...
0
votes
0answers
9 views

How to change the default initial and next for new partitions in oracle

This is kind of a follow up on this question : How to change initial extent of an existing partition I have a table that was created with an initial extent of 8M for new partitions and this takes too ...
0
votes
0answers
3 views

Bash Script Can't Connect to Azure Postgres using ENV Vars - “The Username should be in <username@hostname> format”

I have a bash script that exports ENV vars to use in connecting to an Azure Postgres DB (mydb.postgres.database.azure.com). For the user portion of that specifically it looks like this: export PGUSER=&...
1
vote
1answer
14 views

How to inspect a view's structure in information schema in PostgreSQL?

Is there a way to discover the structure of a view in a similar way to how tables are described by entries in information_schema.columns? I can also use the pg_* tables. In other words, similar to how ...
-1
votes
1answer
21 views

Getting duplicate value when using join

I have 4 tables accordingly that i want join query. Each contact Center id have one annual budget value in second table. Each contact center id have multiple row value in remaining two table i.e ...
0
votes
1answer
289 views

shrink ibdata1 in Galera Cluster

I'm having a Galera cluster (3 nodes, but currently using only one), MariaDB 10.0 Galera. However, my ibdata1 is growing HUGE (although using inno_file_per_table=1). Now i want to "shrink" it by ...
0
votes
2answers
122 views

What firewall ports should be opened for central management server

Within my environment we currently have a MSSQL installation which serves as the Master in a Multiserver Agent environment (MSX). Due to this server being within a tightly controlled network the ...
9
votes
10answers
58k views

Database cannot be upgraded because it is read-only or has read-only files. Make the database or files writeable, and rerun recovery

I have received a database file and the instructions for loading it is to install SQL Server 2005 and then attach it using SQL Server Management Studio. After installing everything, I tried to attach ...
0
votes
0answers
16 views

Good way to limit access of rows different for different users? (Postgres)

I am writing a closed application in which a user enters his db-connection details and then all queries are hard coded. Let's assume I got a table "tbl" with 1000 entries (rows). One day the ...
0
votes
0answers
31 views

Compare previous column and current column in ORACLE SQL and do SUM

This is my query to get TIME_DIFFERENT-> TO_CHAR (DATE '1900-01-01' + ABS ( LAG(MODIFIED_DATE,1)OVER(ORDER BY MODIFIED_DATE DESC) - MODIFIED_DATE), 'HH24:MI:SS') AS TIME_DIFFERENT Now, I want to ...
0
votes
1answer
507 views

How to update collections and restore while doing mongorestore?

is there any way that i can update the collection and restore the same from dump created by mongodump cmd . when we do mongorestore , it directly restores from the dump , but my requireemnet is to ...
1
vote
3answers
49 views

Role to grant a DBA who should not access confidential Database

I am a junior DBA and I am in a bit of a pickle. I need to grant elevated privileges to our new DBA but he hasn't signed consent forms yet so I cannot grant him access to a specific database in our ...
2
votes
1answer
33 views

Does Postgresql create a new tuple for an no-change update statement?

I need to fix some data issues in a Postgresql database, the primary of which is trimming whitespace from text columns. I'm doing this using a statement like: UPDATE app.products SET "description&...
3
votes
1answer
74 views

Statistics histogram AVG_RANGE_ROWS discrepancy

According to MS docs, the description for AVG_RANGE_ROWS is: Average number of rows with duplicate column values within a histogram step, excluding the upper bound. When DISTINCT_RANGE_ROWS is ...
0
votes
1answer
11 views

Maintaining Postgres copies of fdw tables from Oracle

I have a production Oracle 11g server, from which I want to copy data regularly to PostgreSQL 10.14 database for DWH uses, so as not to overload the production with analytics queries. I have ...
0
votes
1answer
359 views

MySQL Backup with innobackupex error: Unrecognized character \x01; marked by <— HERE after <— HERE near column 1 at - line 1374

Getting following error message: Unrecognized character \x01; marked by <-- HERE after <-- HERE near column 1 at - line 1374. 170414 19:01:33 Connecting to MySQL server host: localhost, user: ...
0
votes
0answers
14 views

MySQL replication error 1452

could you help me to figure out the solution for a MySQL replication error? mysql replication error: (Last_Errno: 1452) Last_SQL_Error: Error
'Cannot add or update a child row: a foreign key ...
0
votes
2answers
310 views

Oracle user created information

Is it possible to determine what user created another user's account in Oracle database? I have two types of users in database: Users having system and object privileges Users having only system ...
0
votes
0answers
6 views

Error while updating Extended Property

The following Error occurs while updating extended property of a table in SQL Server 2008 R2. What is the reason for this error and how to find who is causing lock? Error: ============================...
0
votes
0answers
5 views

Trying to decode unknown .db format file generated by windows app Wunderlist

I don't think it's encrypted as I can make out all the records in notepad or a hex editor, and although it's possible to make sense of it, it'll require a lot of manual effort to recover it completely:...
4
votes
1answer
310 views

Spatialite: use of virtual spatial index for distances

I'm currently learning to use spatial access methods for query optimization. I'm going through the examples in spatialite cookbook and got stuck in here http://www.gaia-gis.it/gaia-sins/spatialite-...
0
votes
0answers
11 views

Replacing Null value with existing value

How would it be possible to replace the null value from Order - column with the above existing value that has the the same Document-number? Document Value Value2 Order 1234567 4 7 ...
0
votes
2answers
24 views

Performace of SELECT query based on primary key vs. indexed column

I have a scenario where a row in a table can be obtained by using either primary key or another column which is indexed: SELECT * FROM table_name WHERE primary_key = ? vs. SELECT * FROM table_name ...
2
votes
1answer
102 views

What is the difference between `ALTER TABLE DISABLE TRIGGER` and `DISABLE TRIGGER`?

My company logs DDL on one database using a Database Trigger, looking for DDL including: ALTER_TABLE CREATE_TRIGGER ALTER_TRIGGER DROP_TRIGGER When I disable or enable triggers using ALTER TABLE x ...
0
votes
0answers
6 views

ibd + frm file exist after table dropped

I am having trouble with my server running out of space I am currently running a mariadb instance with 27 databases inside. When i dropped the table i can see that the folder and ibd and frm files ...
0
votes
0answers
8 views

SQL Server -SSIS package to merge data is not working

Not able to find cause for more than two weeks. We are using SSIS package to transfer data from stage table to production table. There are two copy of production (Ware House- WH and Reduced House- RH)....
1
vote
1answer
579 views

drop table causes ORA-08103 with another one

In my process I have 2 tables. target table, load table. The target table holds the current data, and a lot of queries are fired against it. When new data coming we use a FULL LOAD and the goal ...
-2
votes
1answer
37 views

How to find whether SQL server updates enabled or not using powershell?

I would like to list of servers which are sql servers updates(sps&Cus) enabled through windows updates or microsoft updates by using powershell scripts.
0
votes
1answer
31 views

Passing in multiple instances into the dbatools command GET-DBADBFILE

I am attempting to gather all of the dbfile information on all of our sql instances in one of our environments. It is a fairly large environment and would be tedious to perform one instance at a time. ...
1
vote
1answer
454 views

MySQL - Grant user permission to create table as long is it has a prefix in the name

I'd like to grant a user permission to create tables in a database so long as the table has a particular prefix, let's say example_. I've tried the following: $ mysql -u root -p mysql> CREATE ...
0
votes
1answer
32 views

ORA-00932: inconsistent datatypes: expected CHAR got NUMBER

I am trying to SUBSTR the first 3 character in use this query -> CASE WHEN (RMSTMP_PNG.ota_activity_lotinfo.KEY = 'TestProgram') THEN TO_CHAR(SUBSTR(RMSTMP_PNG.ota_activity_lotinfo.VALUE,1,3)) ELSE ...
0
votes
1answer
3k views

RAC database fails to start

I encountered the below errors when i am trying to start the RAC DB/instances. The Cluster/CRS is up but could not bring up the RAC DB instances. Environment: 2 Node RAC (12cr2) on Linux 7.3 [...
0
votes
1answer
29 views

SQL Merge Replication Issue - problem where backup and maintenance job which is running till morning and most of the server jobs are stuck

We have a merge replication environment which includes Publisher: Server1 where only one database of 125 GB in replication and also Distributor is also configured on same server hosted in a HyperV ...
1
vote
1answer
460 views

Do too many subquries create multiple sleeping processes in MySQL?

I am using java & MySQL to make an app. When I check the process list. I see a lot of sleeping processes. It also reaches to a points when no further connection is allowed. I have read many ...

15 30 50 per page
1
2 3 4 5
1719