1
vote
2answers
2k views

“can't return a result set in the given context” error when calling stored procedure - differences between mysql 5.0 and 5.5?

I have a stored procedure to regenerate leafs (nleft, nright) in simple (id, id_parent) tree. (sample table) When I'am calling CALL EdgeListToNestedSet( 'category', 'id_category', 'id_parent'); ...
1
vote
1answer
57 views

MySql include partition key in index?

Please look at the following Mysql table: http://pastebin.com/b0NDSbdz I've partitioned the table by sent_at and I'm making sure that most of the queries pass sent_at. do I need to include sent_at in ...
1
vote
0answers
619 views

Oracle 11g release 2 32 bit client Installation

I have installed a 32 bit Oracle 11g Release 2 (11.2.0.3) client on my Solaris 64 bit machine. But I am getting: Generic Status: Library Open failed, Library Name: libclntsh.so, Platform Status: ...
0
votes
1answer
1k views

MySQL crashes with Signal 8 after “Table has no partition for value” error

We have a mysql database running well and suddenly it stops and below are the snippet of the log file. What is the best remedy in this scenario? 130202 1:08:59 [ERROR] Event Scheduler: ...
4
votes
1answer
312 views

Does the order of fields in SELECT query matter when using composite indexing?

I understand that the order of columns in the index itself matters immensely; however, what about the order of columns in the subsequent SELECT queries that make use of that index? For example, if I ...
2
votes
3answers
8k views

Get counts grouped by month and year

I am trying to report on data in e-email messaging system and wanted to have SQL tally counts by month/year. SELECT YEAR(crdate) AS y, MONTH(crdate) AS m, COUNT(*) AS tally FROM ...
2
votes
0answers
231 views

Simple Select * on SQL Server 2008 R2 table of 1812 rows is taking 3 minutes to load

A query on a table of 1812 rows is taking over 3 minutes to execute. Is there a reason this should be happening? If I execute a SELECT * statement on any other table the results pop back ...
2
votes
0answers
61 views

What is correct process to physically move an availability replica to another location

Current situation is we have 3 SQL Servers with one availablity group and we plan on moving one of the secondary replicas out of HQ to another location. There will be the span of a few hours between ...
3
votes
1answer
459 views

Make sure MySQL is not accepting remote connections

I am currently doing development for a LAMP-based website. I do not know what configuration changes have been made to MySQL since it was installed on our server. The way that we use MySQL, there is no ...
3
votes
2answers
737 views

PostgreSQL: Can the archive command for master and standby point to the same directory?

I use streaming replication and PITR (WAL files) in my cluster, currently I have different versions of postgresql.conf for the master and the standby server. The only difference in the files is the ...
0
votes
1answer
81 views

SQL Server 2008 Mirroring

How would one start the secondary mirror instance if the principal SQL server instance went off line?
0
votes
1answer
156 views

compare the same table

I am facing an issue with the following query. When I execute the query, it takes very long. I broke the query into two parts, compared with a shell script, but is there any chance to go with one ...
0
votes
2answers
3k views

Trying to create a sequence in Oracle that starts with the max value of primary key of a specific table. Why does this not work?

Trying to create a sequence in Oracle that starts with the max value from a specific table. Why does this not work ? CREATE SEQUENCE reservation_sequence MINVALUE 0 START WITH (SELECT ...
4
votes
1answer
198 views

What is the importance of customized data spaces in SQL Server and what are the quantitative measures that can be used to efficiently design this?

I am curious as to what are the advantages of creating custom table spaces for Microsoft SQL Server 2008. As of now, and based on my limited experience all I can really tell/assume are the following ...
1
vote
1answer
667 views

MySQL Tables crashing randomly

This is one of the many random Tables that get corrupted. Any ideas why and what would be causing this? How do I keep MySQL tables from crashing and MySQL from crashing? Repairing USR_wp537 ...
0
votes
0answers
210 views

Renaming the system generated partitions during interval partitioning

I am trying to rename the system-generated partition names (generated during interval partitioning). I try to do this while my table is live(data read and write is happening). I need two scripts. I ...
9
votes
3answers
26k views

Granting access to all tables for a user

I'm a new to Postgres and trying to migrate our MySQL databases over. In MySQL I can grant SELECT, UPDATE, INSERT, DELETE privileges on a low privileged user and enable those grants to apply to all ...
0
votes
1answer
264 views

Installation of SQL Server 2012 does not contain Virtual Interface Adapter?

I have installed the entire Enterprise edition of SQL Server 2012 and have noticed that I do not have the Virtual Interface Adapter. What is the cause of this?
5
votes
3answers
396 views

Good, Bad or Indifferent: WHERE 1=1

Given this question on reddit, I cleaned up the query to point out where the issue was in the query. I use comma first and WHERE 1=1 to make modifying queries easier, so my queries generally end up ...
1
vote
2answers
380 views

Query Performance Tuning on a huge table

I have the following table Transactions. The table looks like this: CREATE TABLE [dbo].[Transactions]( [TransactionID] [bigint] IDENTITY(1,10) NOT NULL, [PlayerID] [bigint] NOT NULL, ...
3
votes
1answer
609 views

Which is more efficient, trigger or PHP code?

My requirement is to move EMR data for a patient to a set of history tables when the patient has been discharged. I proposed to use an after trigger on the table housing the discharge flag, checking ...
1
vote
3answers
6k views

How can I copy data from one MySQL server to another based on a SELECT statement (then delete the data from the original)?

I have a very large log table from which I want to copy rows, putting them into the same table structure on a new server. I don't want to copy everything, only old rows, so that the table on the main ...
2
votes
1answer
714 views

error altering database collation

Due to a database-restore, collation has been changed. If I try to alter database <xyz> collate <xyz> I get an error, that no exclusive lock to database to fulfil this operation can be ...
2
votes
1answer
3k views

Privileges needed for Oracle Text

I'm new to Oracle Text and I am using it to support a search feature in an application I have written. The everything seems to be working correctly except I'm not happy with the fact that I had to ...
-1
votes
1answer
70 views

Total of Same Customer ID from a Single DB Table [closed]

I have a table with multiple customers. Each customer has a unique ID. Example, only one customer has ID as CustomerID = 100. The customer can be entered into the table numerous times but the ...
1
vote
1answer
254 views

How to select only the number from “show global status like 'Com_insert';”

The title says it all. How can I select only the number result from show global status like 'Com_insert' ?
2
votes
1answer
869 views

return percentage of records based on value in column

I'm working on a sql query that needs to get a percentage of the records based on the value of a particular column. The percentage is given by the user. A stripped down version of the query is below ...
1
vote
1answer
605 views

Master to Slave to Slave Configuration in MySQL

We currently have 3 MySQL Servers running; the first which contains production data and is due to be retired mysqld Ver 5.5.28-0ubuntu0.12.04.2 for debian-linux-gnu on x86_64 ((Ubuntu)) mysql> ...
1
vote
1answer
231 views

Best way to determine if a MySQL InnoDB table is in its own file, not in system tablespace

I have a MySQL development server that uses InnoDB tables in some of the databases. It was originally setup with the defaults so all data went into the system tablespace (e.g the main ibdata1 file). ...
1
vote
2answers
103 views

How to Perform Two Simple Queries using Select Value from First Query

I need to perform a select operation and get the id column's value (single value returned). Using this value, I need to perform two more selects on the same table using UNION ALL (in order to select ...
1
vote
2answers
216 views

Database Is In InRecovery Mode.

I have a database that has entered "Recovery Mode". It was working fine, but ended up in this status a few days ago. I have been told that a cause can be the partition holding the datafiles running ...
2
votes
2answers
64 views

2 databases in sql server 2005 “Production Server”

Can 2 databases decrease the performance in a sql 2005 production server? Server specs: Dell Power edge 2950, 2 Quad core Xeon, 16 GB of RAM, 3x73 GB sata hard drive hot plug, windows server 2003 R2 ...
3
votes
2answers
8k views

Add additional disks to FRA diskgroup in ASM

We're running Oracle 11.2.0.3 with a two node RAC and our FRA diskgroup is running low on space. I need to allocate some more disks to it through ASM. I'm not sure how to go about doing this. I can ...
1
vote
0answers
69 views

How to calculate run-off triangles?

(Note: This is copy of my question on StackOverflow here.) Reality description: We do have a list of projects. In every project there is a lot of accounts. You can do a lot of actions on every ...
1
vote
0answers
155 views

How to model Week Commencing / Week Ending scenario

I’m reasonably new to data warehousing and I’m struggling to get a feature of my time dimension working. I’d like to model a Week Commencing and Week Ending type of scenario. I’ve created a DimTime ...
7
votes
3answers
1k views

Store a formula in a table and use the formula in a function

I have a PostgreSQL 9.1 database where part of it handles agent commissions. Each agent has his/her own formula of calculation how much commission they get. I have a function to generate the amount of ...
2
votes
0answers
136 views

automated data sync after Primary node is down

I have this scenario, using version 2.2.2: Node A, Primary, Priority: 10, Wireless network Node B, Secondary, Priority: 9, VM Server1 Node C, Secondary, Priority: 8, VM Server1 Sequence: In Node ...
0
votes
1answer
431 views

inconsistent Data Type -ORA-00932

I know there is question related to inconsistent datatypes but that comes from a query. while I am getting this error on database side when we try to access user defined datatype on our schema that ...
1
vote
2answers
122 views

Who changed the size of the transaction log?

Can I know, who and when changed size of database transation log?
2
votes
1answer
2k views

What is the proper way to backup MySQL database with rsnapshot?

I want to backup my website that contains both user uploaded images and data stored in MySQL database such that they are always consistent with each other in any particular point of time. While ...
3
votes
1answer
151 views

SQL Database automatic back up

I have an SQL database - I need to back it up everyday (at a minimum) - preferably multiple times a day - automatically so it definitely gets done. I'm running Windows which the SQL database is ...
6
votes
1answer
249 views

Steal ownership on database from user that no longer exists

We have a few SQL Server 2008 R2 databases where its member domain was changed (i.e. it was connected to DOMAINA and is now on DOMAINB). We have three databases where the owner of the database is ...
6
votes
2answers
6k views

Restore database from backup file of different version / edition

I read that it's possible to restore a database in SQL Server as long as you're restoring from an older version to a newer version, for backwards compatibility reasons. Does anyone know off hand if ...
2
votes
1answer
1k views

SQL Server Create Access Denied even after adding MSSQLSERVER user permissions

I am aware that SQL Server instances need write access not for my user account (which is in fact irrelevant to that service's context) but for the user account or security principal under which the ...
4
votes
1answer
724 views

Slow SQL Server query using a DB2 linked server in virtual environment

I have a problem with a slow query which uses a linked server. Let me list out my environment first and I'll get to the issue: Virtual Windows 2003 R2 server (fresh deployments on XenServer 6.1 ...
0
votes
2answers
200 views

The difference between sys/ and sys@xe (Oracle)

Can anyone tell me in detail,what is the difference between sqlplus sys/ as sysdba and sqlplus sys@xe as sysdba?For the records the database is installed on the same machine as the client.
2
votes
1answer
199 views

SQL Server Alert - Description (None) [closed]

For every system Alert defined to send an email, we receive a 2 alerts with the following bodies. How do I stop the message with the empty (None) description? Empty Alert SQL Server Alert System: ...
1
vote
2answers
2k views

MySQL slow queries - Fast using PHPMyAdmin , low CPU and RAM usage

I have a site running on Amazon EC2 , which runs fast and contains some reasonably complex MySQL queries. Part of that site is an API which serves out data to another site. These queries are very ...
0
votes
1answer
864 views

Downloading image data type contain to desktop SQL Server 2008

I am very new to SQL Server 2008 and question may look very basic to gurus. Following in the problem universe. I have a huge (600 GB size) SQL Server 2008 table that stores pdf files in a column ...
1
vote
3answers
9k views

Non-Clustered-Index on a temporary table

I am working on various query optimization techniques. I reduced the query execution time from 1 minute to 12 seconds just by adding a Non-Clustered-Index on a table including one column (which is ...

15 30 50 per page