All Questions

Filter by
Sorted by
Tagged with
1
vote
2answers
107 views

Postgresql import user from linux

I install postgresql 9.2 on a Ubuntu 12.10 machine I tried to import linux's user to postgresql but only way I can figure out is CREATE USER Jack WITH PASSWORD '1234'; and do it 10 times (if ...
0
votes
1answer
43 views

Queries of MySQL from Java are executed serially from multiple threads

I have REST API developed in spring + java and hosted on Tomcat server. I have a MySQL database where i store all my data. API makes just simple select from db as descripted below. I failed ...
-1
votes
2answers
34 views

Avoid writing duplicate query

Is there any way to collect somehow or write in another way query's which is repeted couple of times. I have a lot of query which are repeted a couple of times, and I dont know to to avoid this issue....
4
votes
2answers
39k views

Commit and rollback in Oracle stored procedure

In my Oracle stored procedure, I have multiple insert and update statements like below: create or replace PROCEDURE SPTest AS BEGIN insert into emptest(empid,empname,deptno) (1,'ravi',10); ...
0
votes
1answer
29 views

SQL Server :: how to move country code column to another table?

I have 2 tables: tbl_Countries: 250 values, with columns like CountryName (Afghanistan), TwoCharCountryCode (AF), ThreeCharCountryCode (AFG). Like this: CountryName TwoCharCountryCode ...
1
vote
2answers
105 views

Dropping columns from a table, truncating it and then re-inserting data as before into the table doesn't reduce space occupied

I dropped a few (decimal) columns from my table. Truncated the table and then re-inserted the data as before, barring the dropped columns. However I don't notice any perceptible difference in the ...
0
votes
1answer
12 views

MySQL: how to use audit_log plugin to audit user modification

I am trying to audit any user modification action (create user/alter user/drop user/rename user) on a MySQL Enterprise server 5.7.24. I have installed the audit_log plugin following the document, and ...
-5
votes
0answers
31 views

convert sql query into laravel (urgently) [closed]

function show($status,$main_table,$table) { $status=''; $check=''; $current_date=date('Y-m-d'); $provision=''; if($main_table=='companies') ...
0
votes
2answers
64 views

How to solve Vendor Code 17002 when connecting to a remote Oracle database?

I have an Oracle database 12c standard edition release 12.2.0.1.0 running on a Linux instance of AWS ec2. When I try to connect to it remotely from my machine (macOS) using SQL Developer I get an IO ...
0
votes
0answers
14 views

Is there a portable profile/well defined subset of SQL/PSM?

https://en.wikipedia.org/wiki/SQL/PSM says that DB2's SQL PL and Mimer SQL's PSM implement the SQL/PSM standard and that the MySQL/MariaDB is close while HSQLDB stored procedures, OpenLink Virtuoso ...
2
votes
1answer
273 views

Huge logs are generated in mongo db shard logs

We are using Mongo db Shard set up. What i see that on primary of each shard log file keep growing to GBs. Even in a day it reaches to 10GB for single day. This appears to be slowing down Mongo ...
1
vote
1answer
138 views

Storing arrays of data in a time-series database

I'm building an low utilization time-series database to capture yearly data points for a set of items fewer than 100,000. My question has to do with storing arrays of data in a way that is easily ...
4
votes
2answers
346 views

SQL TDE and Certificate Handling Recommendations

I've seen the information on this post: But I don't think it answers this particular question/concern: I have multiple SQL servers with multiple databases. We want to use TDE on a few of them. ...
1
vote
0answers
27 views

Correlated subquery with common table expressions in SQLite

Yesterday I achieved a 500x performance boost after rewriting an EXISTS with IN. I did some investigation to find out why and finally came to the following example. Basically, we draw 5 lucky numbers ...
1
vote
0answers
17 views

Required WAL settings to permit large queries to run on server which is replicating to standby server

What WAL/conf settings are required to permit large queries in PostgreSQL without breaking replication to the replica server? Is it only a matter of ensuring that: the WAL writes don't time out? the ...
0
votes
1answer
269 views

Comparing multiple tables on two databases using dynamic PL/SQL

The issue I'm having is I have a block of dynamic SQL that I can't get the results from. Here's the SQL: CREATE OR REPLACE PROCEDURE GGCHECKER IS cursor c1 is SELECT TABLE_NAME, ...
1
vote
0answers
17 views

Why does adding an index increase the execution time in SQLite?

I'll just show you an example. Here candidates is a table of 1000000 candidates from 1000 teams and their individual scores. We want a list of all teams and whether the total score of all candidates ...
0
votes
1answer
87 views

trying to get date to MM/DD/YYY

I have a coding using sqldeveloper under Oracle database using a student database, PowerSchool: PS_CUSTOMFIELDS.getStudentsCF(s.id,'CA_LastIEPDate') AnnDate This is a custom field, ca_lastIEPdate ...
0
votes
1answer
24 views

Best way to optimize an aggregated issues over time query?

I have a query that creates an aggregated issues over time report that includes back-filling data from entities with missing dates. I've been using the following query for a few years but it is ...
0
votes
1answer
79 views

Built-in Postgres' Automatic Backup

Is there any automatic built-in mechanism in postgres to backup data if the data have exceeded the maximum permissible storage amount?
0
votes
0answers
16 views

SQL Replication Subscriber with AlwaysON setup

We have 2 AlwaysON cluster and we want that to set up as a SQL Replication server which is the Always-on Cluster 1 is the Publisher and Always-on Cluster 2 is the SUBSCRIBER, my question is it ...
0
votes
1answer
83 views

Mysqldump backup size issue - 5.6

I'm using MySQL 5.6 with about 5 databases on linux. I have scheduled daily full backups using mysqldump. All databases use InnoDB engine. What I observe is that the backup size seems to vary ...
-1
votes
0answers
29 views

Sums from each day for 4 weeks

I am using pg11 I need to get the sums of "earnings" for each day for the past 4 weeks. In one table we have a list of "hotspots" we need sums from id | hotspot_name ...
0
votes
1answer
225 views

How To Store EAV Data When It Has Nested Objects/Entities

I have json data that have both nested objects and attributes. Eg of one json object: (After json_decode into an array:) Array ( [attributename1] => attributevalue1 [attributename2] => ...
2
votes
1answer
47 views

Database schema design implementation feedback

I'm having difficulty on designing a database schema design with the right relationships. I'm currently trying to design a database system where a question can be answer via a live_stream. The ...
0
votes
0answers
5 views

Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE' vulnerability for Windows 2008 R2 SQL

I have a MSSQL Windows 2008 R2 server. Vulnerability for "Ensure 'Adjust memory quotas for a process' is set to 'Administrators, LOCAL SERVICE, NETWORK SERVICE'" has been found. Current ...
1
vote
1answer
807 views

MongoDB: Grant roles to multiple databases based on a pattern

Is it possible to grant database access to a user based on a prefix? For example in MYSQL you can do the following: GRANT ALL PRIVILEGES ON `username\_%` . * TO 'username'@'localhost'; In my use-...
0
votes
1answer
25 views

How to query an Extended Events target file on a SQL Azure Managed Instance by using T-SQL?

I'm setting up an Extended Events trace in a Managed Instance (NOT Azure SQL DB) for the first time. These are the steps I've carefully followed: Created a Master key on my Database. Created a ...
2
votes
1answer
134 views

Database Design when Admin and Employee have similar roles except Admin can see all the other Employees Data

We are building a system with concept of Admin and Employee. so basically Admin is an employee with all powers and can view all the data created by other Employee. CREATE TABLE `Vendor` ( `...
0
votes
1answer
27 views

Joining Additional Table Column

I need to add another column from another table i.e. CusSorMaster+.SalesOrder.The join is on where dbo.SorMaster.SalesOrder = dbo.CusSorMaster+.SalesOrder. This wasn't written by me and I need to ...
1
vote
1answer
103 views

Index or query tuning for complex predicates

I'm struggling to identify effective indexes (or rewrite the query) to improve a query with the following confounding predicates: JOIN on a date from one table being in range - between two date ...
0
votes
3answers
107 views

Need to configure Availability Groups between three different SQL failover instance

We have total 6 Nodes and 3 failover cluster (Each with two node). Cluster1.TestAD.com(Node1,Node2) - SQL Failover Instance (SQL1) - 1 TB Shared storage Cluster2.TestAD.com(Node3,Node4) - SQL ...
1
vote
2answers
202 views

Postgres list constraints that use a stored procedure

I have a postgres database (v9.6) and I have multiple CHECK constraints that use user-defined functions. something like: CREATE TABLE payment ( amount bigint, CONSTRAINT amount_gt_0 CHECK (...
0
votes
2answers
117 views

Mysql Query Take Longer To Prcoess On My Dedicated Server Than My Local Server

One of my MySQL queries takes a very long time to process on my live server compared with my development server. My live server (Windows dedicated server) is more powerful than my local (development) ...
1
vote
1answer
26 views

Find what values are not in multiple columns [duplicate]

I need to find what "Codes" from column "RMS_CODE" and column "RMS_ALT1_Cde" are not being used in the Child # (starting in position 6 for a length of 4) column within the "APC_Spec" number. I tried ...
1
vote
0answers
17 views

How not to “naturalize” surrogate keys?

Don't naturalize surrogate keys. As soon as you display the value of a surrogate key to your end users, or worse yet allow them to work with the value (perhaps to search), you have effectively given ...
1
vote
2answers
225 views

Best practice for multiple 0,1 to many relationships

I'm an application developer without a ton of database design experience and I'm wondering if someone can suggest a design/implementation for relating one table to one or more other tables. For ...
-1
votes
1answer
23 views

Error convert data type varchar to numeric when using a case statement order by

I am using SQL Server. I have a table called ReviewWebsite with a column Answer VARCHAR(1000) NULLABLE. This query runs perfectly: SELECT * FROM (SELECT CONVERT(DECIMAL(4,2),Answer) AS Rating FROM ...
0
votes
0answers
5 views

Date Conversion Error SSIS [closed]

I am importing from a pipe delimited flat file via SSIS Package were date in source text file is in format MMDDYYYY using data conversion for field as date [DT_DATE] is there another conversion type ...
1
vote
1answer
139 views

listagg in order and including a sequence of separator when missing any row of a sequence

Sorry for the long title but it's a little bit difficult to explain. We have a table | N rows | Atrib1 | Atrib2 | Atrib3 | Atrib4 | Final row | --------------------------------------------------...
0
votes
1answer
28 views

SQL Backup routine regarding DB Logs

I recently had an incident that got me rethinking my backup plan: One of our MSSQL driven aplications stalled because the log fle had grown too big on the filesystem (it was 50 GBs IIRC). It turned ...
0
votes
0answers
27 views

Availability Group SQL Server Databases Always fall back to Restoring State [closed]

I have two Databases out of several others which I constantly need to re-add to a SQL Server Availability Group (all other 50 or so Databases from the same AG cause no issue). Indeed, they always go ...
-5
votes
0answers
47 views

How to determine what is the potential max worker thread count on a server where the server property is set to 0? [duplicate]

I have a SQL Server instance where the Max Worker Threads server property is set to the default of 0. Periodically I'm receiving the the following errors (in the SQL Error Log): Error: 17189, ...
2
votes
0answers
27 views

MySQL router on server with tomcat memory leak

Memory is slowly used by mysql router. I am running mysql router version 8.0.20 (I found there was a memory leak on mysql router 2.1.2 but mysql router 8.x is newer) I have a 3 node single-primary ...
3
votes
1answer
195 views

sp_primary_keys_rowset is consuming a lot of CPU

I manage a database server that supports a C#/VB.NET application and we've had a lot of CPU usage problems. I am using the following dmv query from Glenn Berry at SQLSkills: SELECT TOP(50) DB_NAME(t....
0
votes
1answer
20 views

Large MySQL import stuck at “Waiting for table flush”

Two weeks ago (!) I started a large import (dump sql file is 540GB). Now the import is stuck at this state: "show processlist" shows: Command = "Field List", State="Waiting ...
0
votes
1answer
53 views

Restore Database without taking RDP [closed]

I have a DB server 192.168.X.X, Now due to some Issue with the domain user we are unable to get the RDP of that server. but we can get the DB connected from other server which is there on the network. ...
0
votes
0answers
25 views

Dynamic config file generation using powershell

I am trying to build a config file for a monitoring app for all our SQL Servers. For this I need to add all instance details of a server in a config file(i.e. one file will be generated per server and ...
0
votes
1answer
108 views

is Master-Master replication ok for me?

I have two separated locations connected by a not too reliable VPN. I have a common system that depends on MYSQL that read/write tables. Will master-master replication keep both locations in sync? I ...
0
votes
2answers
30 views

What is best for a primary key? Bigint of 20 numbers or varchar / varbinary of 15 characters?

I have already seen some posts making comparisons of varchar with numeric fields, but most only compare with equal values ​​and do not talk about performance in primary keys. I have a user ...

15 30 50 per page
1
3 4
5
6 7
1700