1
vote
3answers
16k views

How to calculate exact month (in days) difference b/w two dates

I am trying to get all the rows where the visit date was exact before five months from to date but somehow DateDiff function is including 26th Sept 2013 record which is not right as five month has ...
1
vote
2answers
5k views

Postgres client unable to detect UTF-8 database

Context I am deploying a Vagrant box for my development team, and have encountered a problem restoring UTF-8 collated dumps. I don't believe it is related to the now-infamous "UTF8" has no equivalent ...
2
votes
1answer
221 views

SQL Server Merge Replication Dummy Update issue

We have SQL Server 2005 SP4, using merge replication. We started getting this error when the subscribers try to replicate (not all of them but most): The process could not deliver dummy update ...
0
votes
1answer
579 views

trouble installing percona 5.6 on google compute engine debian

I've been trying to install percona server on a fresh google compute engine instance. I havent installed mysql server previously. i followed the instructions from here http://www.unixmen.com/install-...
2
votes
2answers
1k views

ORA-12899 when creating varchar virtual column based on numeric column

I have a table with numeric column: create table test (a number(2,0)); Next I want to create a virtual column based on column a: alter table test add (b varchar2(3) as ('A:'||to_char(a))); This ...
1
vote
0answers
102 views

MySQL: Sometimes query failed to use index

I have a complex query including join of 4-5 tables. 1 months back, I have optimized this query and it was using the index. Also, two months back, index of all tables had been rebuilt by just export ...
0
votes
0answers
30 views

How to distribute/release/publish a database schema

I want to distribute/release/publish a database schema to multiple 3rd parties (e.g. I'll produce a zip for them to download and they'll set up their database using it). They aren't all using the same ...
0
votes
0answers
75 views

SQL Server A network-related or instance-specific error

I have a windows service that performs a lot of hits to database. Sometimes the database connection is down and I got exception "A network-related or instance-specific error". I got this behavior on ...
0
votes
0answers
342 views

SQL Server Mirroring send/receive ack time not normal

I have a problem that arises during the performance test by microsoft team in my client. The report that is given to us provide information about whether or not a parameter is good based on the Object ...
2
votes
2answers
2k views

MySQL Workbench query tabs

I am trying MySQL Workbench 6.0 and when I execute a query the results are displayed with a tab called "Result 1". When I fire another query the same tab is reused, now named "Results 2". I found no ...
1
vote
0answers
1k views

SQL Maintenance Plan 'Could not find part of the path' - where is it getting the path from?

I have a SQL Server 2012 maintenance plan which backs up all of the databases. Today I had an issue with a failed backup which I was able to resolve by viewing the detail in the 'Log File Viewer' ...
0
votes
1answer
737 views

PostgreSQL encoding conversion error

I have a Postgresql database in LATIN9 encoding. I recently migrated my web applications (PHP) from iso_8859_15 (latin9) to UTF8. So, now, customers are able to specify UTF-8 characters in web forms ...
1
vote
0answers
602 views

Create new user without typing current user password

On a VPS, I need to create a new user on PostgreSQL 9.3 so I have tried sudo -u postgres psql -c "create user new_user with password 'secret';" This works but it asks me for the current user (...
0
votes
1answer
66 views

Orace tablespace extension operation

Could somebody clarify whether tablespace expansion procedure in Oracle 11g database requires any downtime or could impact availability of the database? My understanding that this can be done "on the ...
2
votes
1answer
67 views

How to calculate the space I need for the indexes?

CREATE TABLE info( home CHAR(10) CHARACTER SET latin1 NOT NULL, id TINYINT UNSIGNED NOT NULL, galaxy TINYINT UNSIGNED NOT NULL, galaxy_pos INT UNSIGNED NOT NULL, events TEXT NOT NULL, UNIQUE KEY(...
1
vote
1answer
9 views

Source control makes sure my code is never lost, how do I make sure my users/orders database is never lost?

Everyone is recommending the use of git, automated tests, continuous integration, automated deployment and so on, to reduce human error during all stages of web development. I have yet to come across ...
1
vote
1answer
633 views

Functional dependencies and candidate key example [closed]

Hi there I'm still learning for my examination and I got this exercise: A table is given: F-Name, F-Nation, Team-Name, Team-Nation ----------------------------------------------------...
2
votes
1answer
112 views

Skipping some data from Indexing in SQL Server

I have a situation where SQL Server is giving error that index size exceeding 900 bytes. Its happening because one of the column in index definition is varchar(2000), and whenever its length goes over ...
0
votes
2answers
96 views

Group by reversible pair

I'm sure my title is not clear enough... Let's say I have a "chat" table, storing individual messages like this: message_id, from_user_id, to_user_id, timestamp For a given user_id, I want a list ...
1
vote
0answers
171 views

Does using noatime on modern Linux make sense?

Starting from version 2.6.30 (which was released 5 years ago), Linux has the option relatime enabled by default. It means updates of file access time are very infrequent and prudent. But I still see ...
2
votes
1answer
321 views

Schema for a Soccer club

I am designing a database for a Soccer club. A soccer club has several teams. Those teams have several players and a coach. Right now I have three tables: Club Team (foreign key to club) Player (...
3
votes
1answer
121 views

Error trying to open database

The database is for ms exchange. I am getting the following error. Any ideas guys?
1
vote
1answer
1k views

mysql inner join if value = true ( share system ) [closed]

users | id | name | |------|-------| | 1 | John | | 2 | Clark | groups | id | group_name| |------|-----------| | 1 | groupName | posts authorType* 1- user 2- group | id | ...
0
votes
0answers
298 views

Huge load on CPU because of mysql process [closed]

I am getting a huge load on my linux servers because of this query. CPU is on 500% load & this query is causing load. /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/...
0
votes
0answers
244 views

Attendance Database using sql in MS Access

I'm currently working with a simple database for the attendance of the professor in our college. I'm using MS Access 2010 with a Main table that includes the Attendance log of all the professor with ...
0
votes
1answer
388 views

Improve Insert performance for 200 Million rows

How can the following insert statement be improved - which varies from 20mins on certain days to 70-140mins on most other days. SELECT DISTINCT od.SourceID, od.OrderID, od.OrderLineNo, ...
1
vote
1answer
260 views

Why there is a start (*) after Nodegroup:0 in MySQL cluster? What does it means?

I am new to MySQL and MySQL cluster setup. However going through several blogs and Web links I've finally able to manage the cluster up and running. I have 1 management, 1 SQL and 3 data nodes (...
1
vote
1answer
2k views

“Table or view does not exist” on synonym

I have a database and a USER administrating it. Then I have an additional USER_APP to whom I granted CRUD access to all tables in my oracle data modeler (and then applied these via generated script ) ...
0
votes
1answer
117 views

Create Table with Int-attribute which can only use values between 6 and 36

Hello I'm learning for my databases examination and in one exercise they asking for creating a table with a attribute which can only use values between 6 and 36. How do I solve it? We used in the ...
6
votes
3answers
4k views

db_owner unable to drop database - Error 615, SQL Server

I have a SQL Server 2012 database running on amazon EC2. I've created a user to be able to create, edit and drop databases. I gave the new user with dbcreator server role. My user can connect ...
0
votes
0answers
617 views

Yet another slow query Postgresql 9.3

I'd like to get a count(*) from a relatively small joined table (returned result is about ~30000 rows). I use Postgresql 9.3 so simply getting select count(*) from tasks_task; uses index-only scan, ...
1
vote
1answer
3k views

Cassandra: Request did not complete within rpc_timeout

i was working with Cassandra 1.2.4 probably, after restoring some key-space when i tried to query in a key-space it gave me Request did not complete within rpc_timeout so i checked system.log & ...
0
votes
0answers
45 views

How Can I Convert SQL Server 2012 Version 11.0.3000.0 to SQL Server 2012 Version 11.1.3000.0? [duplicate]

I have SQL Server 2012 with version 11.0.3000.0 . I need upgrade my version to SQL Server 2012 SP1 because I need install Cumulation 4 in Sql Server 2012 Cumulative Update 4 for use PowerPivot in ...
1
vote
2answers
13k views

How Can I Convert SQL Server 2012 Version 11.0.3000.0 to SQL Server 2012 Version 11.1.3000.0?

I have SQL Server 2012 with version 11.0.3000.0 . I need upgrade my version to SQL Server 2012 SP1 because I need install Cumulation 4 in Sql Server 2012 Cumulative Update 4 for use PowerPivot in ...
4
votes
4answers
2k views

innodb DEPENDENT SUBQUERY very slow

Here is some innodb table. It insert,update,query very frequently. tn is product id col is product sub id tindex is product description.(store by each word) date is product add date stored by ...
0
votes
3answers
157 views

How to query for 'First showed up as'

Given the following table: Date Trd (INT(10)) Code (VARCHAR(10)) T-Date 1-Jan-14 1 B 1-Nov-13 1-Jan-14 2 B 3-Oct-13 1-...
4
votes
1answer
164 views

Query the Differential Changed Maps in SQL Server

Differential backups use the Differential Changed Map pages to determine what pages to backup. I'd like to investigate a backup strategy involving differential backups. For that purpose I'd like to ...
2
votes
1answer
493 views

How to generate time in milliseconds in PostgreSQL stored procedure?

I have been reading the Postgres documentation about timestamps, but I am still a little bit confused. I need to store moments in times, measured in milliseconds, between the current time and ...
1
vote
1answer
214 views

Join Query effects natural ordering [closed]

If we have 2 tables **user** +----+------+------+-----------+ | id | user | pass | gender_id | +----+------+------+-----------+ | 1 | lisa | good | 11 | | 2 | jack | pass | 10 | | 3 |...
6
votes
1answer
2k views

How is SQL Server returning both a new value and old value during an UPDATE?

We've had issues, during high concurrency, of queries returning non-sensical results - results the violate the logic of the queries being issued. It took a while to reproduce the issue. I've managed ...
1
vote
2answers
335 views

security tools for mysql [closed]

We are using MySQL Community version on Windows and are trying to secure it as best we can. Assuming that changing the version (for example purchasing the Enterprise edition) is not possible in our ...
3
votes
4answers
6k views

How to handle table design with variable columns

I have a table design scenario and as a non-DBA type, would like opinions on which is more scaleable. Say you are asked to record information on houses for a metro area, starting with a small ...
4
votes
1answer
5k views

“No row was updated error” in SQL 2012 - worked fine in SQL 2005 and 2008 [closed]

I have a database in SQL Server 2005. We are currently looking at upgrading to SQL Server 2012. I installed SQL Server 2012 in a test environment (Windows Server 2012 virtual machine). Backed up ...
1
vote
1answer
98 views

Compare the database compatibility_level to the server version?

I have a mixed environment of servers from 2000 to 2012, and I'd like to find any databases that have a compatibility level set less than the version of the server it is running on. Ideally, I'd like ...
1
vote
0answers
723 views

Can not ping Always On listener from outside primary node

I just setup SQL Server 2012 (on Windows Server 2012) Always On feature and have a problem with connecting to SQL Server Listener from non-primary node (it works from primary node though). Here is ...
4
votes
2answers
698 views

Multicolumn statistics on large table yielding poor estimations

I have a rather large table (~200 million rows), and although the statistics are up to date using WITH FULLSCAN, is it possible that my histogram (limited to 200 steps) is simply too broad for the ...
2
votes
1answer
560 views

Reorganize Objects in OEM - Host Credentials do not have enough privileges

When I try to re-organize objects from OEM (11g) and enter my host credentials (not "oracle"), I get the message: "An error occurred verifying the host credentials. Make sure the credentials are ...
1
vote
0answers
266 views

MySQL database problems all of a sudden— users' programs can't connect, I saw error 2013, error 32

I am editing my problem, based on what I've researched and done: Hi This is mysql running on an osx server. We suddenly have an issue where only one of anything can seem to connect to mysql at ...
1
vote
2answers
206 views

sql custom calendar question

I need to create a custom report for my PMO where they want allocation to be calcualted by multiplying working days for each month * total hours For example January 2014 should have 21 working days (...
7
votes
4answers
1k views

Run Server Agent Job on Schedule only if CPU is idle

I have a job set up in SQL Server Agent to run an update query. I want this job to execute every night between midnight and 5am and I want it to repeat every 5 minutes during that time frame. But I ...

15 30 50 per page