2
votes
0answers
9 views

Postgresql JDBC Table Valued Parameters

MSSQL has a great feature called Table Valued Parameters. It allows you to pass a table of a custom data to stored procedures and functions. I was wondering what is the equivalent , if exists, in ...
1
vote
0answers
6 views

Need help tuning my.cnf file

I need help tuning mysql. Currently it is using a lot of CPU. I dont find any query that last longer than 3 seconds in SHOW PROCESSLIST and there are only around 20-25 running most of the time. Still ...
1
vote
1answer
58 views

How do I transfer logins from 2008R2 to 2014 with passwords?

I've tried Tasks>Generate Scripts... and set 'Script Logins' in the Advanced Scripting Options, but I get this in the output: /* For security reasons the login is created disabled and with a random ...
1
vote
0answers
15 views

Mysql join two tables and limit by first input?

i am only starting to play with MySQL and i seem to have been stumped by one problem. I have one table containing a number of fields including a primary id field. I have a second table containing ...
0
votes
0answers
16 views

How to convert this relation to 2NF?

In my Entity Relationship Diagram, an entity type TEACHER had a relationship of TEACH with another entity type called CLASS. CLASS was a week entity type of TEACHER,so when mapping to a Relational ...
2
votes
1answer
24 views

Optimizing indexes

I just began optimizing my schemas with indexes (pretty late I guess). I never dealt with huge dataset but I'll be soon coping with about 1 to 5 millions rows. Here is the schema I'm using right now ...
0
votes
1answer
18 views

Does having many databases affect MySQL performance?

I have huge unused databases in MySQL. Do they affect my MySQL engine performance even if they are unused? Do they consume memory on their own? Thanks
0
votes
0answers
22 views

Oracle 12C, cannot drop NOT NULL constraint on a DEFAULT ON NULL column

In windows7 I Install oracle 12 C Then I connect to database as sys user and create new user so: CREATE USER C##USER IDENTIFIED BY user_pass; GRANT ALL PRIVILEGES TO C##USER; Then I connect to ...
1
vote
0answers
24 views

Possibly tempdb out of space or a system table is inconsistent

While running DBCC CHECKDB I got this error Msg 8921, Level 16, State 1, Line 1 Check terminated. A failure was detected while collecting facts. Possibly tempdb out of space or a system ...
0
votes
1answer
32 views

Merge two SELECT queries with different WHERE clauses

I have one table of services And I need to merge two SELECT queries, both have different where clauses For example SELECT U_REGN as 'Region', COUNT(callID) as 'OpenServices', SUM(CASE WHEN ...
0
votes
0answers
7 views

database insert criterion

am tryimg to record daily employees' time he has been at work.but am unable to store them in the database in such a way that I will view later for how long at a specific date did a given employee ...
-9
votes
0answers
25 views

Mirroring error #1418 [on hold]

I have configured mirroring in server without witness but I am getting a error no 1418 please suggest how to solve it. Even if I tried to create a endpoint but I couldn't create it.
0
votes
1answer
15 views

Can I estimate the row count of a large mysql table using the disk space?

Sysadmin here (not a developer by trade), so go easy please ;) I have a mysql table, on a linux server that uses innodb_file_per_table. When I try to do select count(foo) from table; It doesn't ...
0
votes
0answers
8 views

Dynamically REVOKE CONNECT FROM guest in SQL Server 2005

I wrote this simplistic script (I'm not very familiar with TSQL and dynamic SQL) to revoke all connections from guest accounts: DECLARE @database_id int, @database_name nvarchar(100); DECLARE ...
1
vote
1answer
15 views

How to store temp tables in memory during table “optimize”?

When optimizing tables, SHOW PROCESSLIST lists it as "copying to tmp table". I'm trying to ensure the copy takes place in memory to speed up the process. I've tried adjusting the tmp_table_size to ...
0
votes
0answers
10 views

MongoDB on Raspberry Pi --dbpath not setting

I installed MongoDB using this tutorial. I have tried to set --dbpath in /etc/mongodb.conf like this: dbpath=/path/that/iwant #where to log logpath=/var/log/mongodb/mongodb.log logappend=true ...
-1
votes
1answer
19 views

MySQL ran out of space, now won't start

So the partition MySQL was mounted on ran out of space. As a quick fix, I decided to move mysql's data directory to /home/minecraft/mysql/. I then changed the datadir in the config to the correcy ...
2
votes
1answer
43 views

Relational modeled design to store versioned files

The scenario I have images in a database table and some of these need to be altered then re-saved(not overwriting the original) whilst providing a reference back to the original. I also save the ...
0
votes
0answers
10 views

No privileges on the admin

I am using MySQL on AWS, and I came to horrific realization that privileges were flushed shut N across the board today. I was able to view this from an other user has very few privileges, but one of ...
0
votes
2answers
23 views

Returning empty string when string_agg has no records

I am trying to return a text field in a PostgreSQL query that is of the form 'stringOne' || string_agg(field, ',') || 'stringTwo' where for certain elements in the group clause, field is always ...
11
votes
3answers
168 views

In SQL Server, should I force a LOOP JOIN in the following case?

Typically, I recommend against using join hints for all the standard reasons. Recently, however, I have found a pattern where I almost always find a forced loop join to perform better. In fact, I am ...
2
votes
1answer
18 views

How to create function(table_name) that returns a set of the table

I have a set of tables that share the same fields (some timestamps and users names used for version control). I need to create a function with dynamic sql that uses a table_name and a timestamp as ...
2
votes
0answers
27 views

Phantom Transactions using Version Store in tempDB

We are seeing version store space increasing on one of our servers, and there are ~20 sessions that are showing as actively accessing version store rows for over 24 hours. The problem is, when I try ...
0
votes
0answers
38 views

OUTER APPLY vs LEFT JOIN

I'm working on the query bellow. Its structure is based on someone else's similar query... SELECT tptype.Code AS ThirdpartyTypeCode, ptf.Ticker AS TextId, finIn.InternalCode AS ...
0
votes
0answers
10 views

How to pass log file in pg_dump

I am using this command to export. export PGPASSWOD=${PASSWORD} pg_dump –i –b -o -host=${HOST} -port=5444 -username=${USERNAME} -format=c -schema=${SCHEMA} --file=${SCHEMA}_${DATE}.dmp ${HOST} ...
-1
votes
0answers
39 views

MS SQL Server Implement Limit Functionality

I am facing problem to implement the pagination on grid. Actually after applying all the filter we get 3000k records from database but if pull the 3000k data the query take time so I am showing only ...
0
votes
1answer
16 views

Merge left outer join column

I have a query that use left outer join. something like that : select issues.id, journal.notes from issues left outer join on (issues.id = journal.issue_id and journal.notes != '') So far it ...
1
vote
2answers
55 views

Will redirecting queries to dev/null warm up indexes?

I'm trying to warm up the buffer pool. Will running a query and re-directing the output to /dev/null suffice? e.g. mysql -u username -p -e "select id from tbl where 1=1" > /tmp/results.txt Thanks
0
votes
2answers
21 views

Installing scott schema for oracle 11g express

I want to install scott schema, a sample database in oracle. But in express edition, I can't find out it. Please help me install it on Oracle 11g express. I'm a newbie, pls help me
1
vote
1answer
35 views

Looking for ideas on maintaining data warehouse in close to real-time - ETL tools, etc

I have done a fair number of traditional data warehouse implementations where the loads were done in a batch-oriented manner, i.e. the data is refreshed nightly or, at most, every few hours. I now ...
0
votes
0answers
17 views

Is there a psql equivalent of bash's reverse-search-history?

I am very fond of bash's reverse-search-history (C-r) (command-line feature): Search backward starting at the current line and moving ‘up’ through the history as necessary. This is an incremental ...
0
votes
1answer
32 views

What data will be lost with DBCC CHECKDB (REPAIR_ALLOW_DATA_LOSS)?

I have a corrupt database. The last known good backup was over 2 weeks ago. I've run a CHECKDB and have the page numbers where SQL Server located the corruption. I've looked at the data on the ...
2
votes
2answers
169 views

DISTINCT not using an index

I have table (2139868 rows): COLUMN1 NUMBER(20,0) COLUMN2 XMLTYPE COLUMN3 XMLTYPE COLUMN4 VARCHAR2(50 BYTE) COLUMN5 VARCHAR2(50 BYTE) COLUMN6 VARCHAR2(50 BYTE) COLUMN7 VARCHAR2(50 BYTE) COLUMN8 ...
0
votes
0answers
5 views

Upgrade MongoDB meta-data after binary upgrade

I upgraded our MongoDB binaries from 2.2.5 to 2.4.9. I did not follow one of the considerations prior to upgrading: To upgrade to 2.4, sharded clusters must upgrade following the meta-data upgrade ...
0
votes
0answers
14 views

Issues with Inserting due to FK constraints

I have two tables: Employee, and Department. They are setup like so, : CREATE TABLE IF NOT EXISTS `mydb`.`Department` ( `Dname` VARCHAR(25) NULL, `Dno` INT NULL, `Total_sal` INT NULL, ...
1
vote
2answers
74 views

What is the best way to get all data for a date range, plus the last event just before the range?

For this question assume the following: There is a table of events [Event] There is a table of employees [Employee] There is a table that relates the two [EventEmployee] (EventID + EmployeeID) Each ...
1
vote
1answer
27 views

Avoiding entitized characters when using FOR XML PATH for string concatenation

I have this query: SELECT DISTINCT f1.CourseEventKey, STUFF ( ( SELECT '; ' + Title FROM ( SELECT DISTINCT ...
0
votes
1answer
11 views

Failover Mirror

My name is Jackson and I'm from Brazil, sorry about my English. My question is about the failover process in SQL Server Mirror. Question: If just the database, not a instance or a server, goes ...
0
votes
1answer
20 views

SQl comand works in Workbench but not from Java Program

I am working on a program that manages a database of client information. I am currently stuck on a problem where the SQL statement created by my java program but get the error SQLException: You ...
0
votes
0answers
8 views

“Display width out of range for column” error when importing mysql 5.1 dump into 5.5

I am migrating to a new server, and trying to move my database from a 5.1 to 5.5 server. I created a dump with mysqldump -u root -p --add-drop-database --triggers dbname > dbname.sql When I ...
1
vote
1answer
41 views

Error checking with sp_send_dbmail

This question is kind of multifaceted. First, what I'm trying to actually accomplish: I am in an environment where there is not really heavy data validation on inputs. So there is lots of opportunity ...
0
votes
1answer
20 views

DB2 removing white spaces in field values

In a table I have a column called column_xml defined as CLOB(1000000). The fields in the column contain XML formatted information. My problem is that there are lots of white spaces in these fields ...
1
vote
0answers
28 views

Profiling parameters

I was trying to fine the parameters of a query I suspect to be causing unnecessary logical read and eventually captured it in profiler, however parameters @p3 and @p4 are not listed. Is anyone able ...
0
votes
0answers
18 views

Many temporary tables created on disk since mysql 5.6 upgrade

I recently upgraded MySql (from 5.5 to 5.6) on a Debian Wheezy server. Drupal 7 and a PunBB board are installed on this server (Drupal 7 database size: 54 M / board database size < 800 M). These ...
1
vote
3answers
30 views

New SQL Server 2008 instance, load old instance DB's

BACK STORY: I'm a developer with a local instance of SQL Server 2008 on my workstation. I just recently upgraded my motherboard and found out (much to my dismay) the old motherboard's RAID drivers ...
0
votes
0answers
42 views

Avoid transaction rollback when Deadlock is encountered (mysql)

I'm currently trying to handle concurrent inserts correctly using MySQL, I'm basically doing the following: CREATE TABLE foo (id INT NOT NULL PRIMARY KEY) ENGINE=INNODB; CREATE TABLE bar (id INT NOT ...
0
votes
1answer
29 views

How to decide whether to enable MySQL query cache using InnoDB

How should the decision to enable / disable the MySQL query cache be made, on a server that uses just InnoDB tables. Say for example, if the cache is enabled, then how should the output of: SHOW ...
0
votes
0answers
17 views

MySQL CPU high usage

My MySQL service started to using a lot of CPU recently. Few second after restart it takes 100% CPU's. I tried already changing my.cnf file to optimize cache/buffers. I have no idea what causing that ...
4
votes
1answer
51 views

sql indexing and performance

I am using mysql5.1, i have table which has about 15 lakh (1.5 million) records.This table has records for different entities i.e child records for all master entities. There are 8 columns in this ...
-3
votes
0answers
32 views

Is it possible to get the queries executed in the past? [on hold]

Is it possible to get the queries executed in the past? the server is restarted.

15 30 50 per page