20
votes
3answers
8k views

Is the CPU performance relevant for a database server?

This is a purely theoretical question. Let's say I have an application deployed on multiple servers. A load balancer, Multiple/scalable applications servers A (single) database server (for the ...
3
votes
2answers
488 views

How do I count rows with two properties in one index scan in SQL?

I have a table Units where I have rows ItemId, ItemCreationDate, ItemUnitsCount. ItemId is a primary key and I have a clustered index over it. I need to output the following: for each day I need to ...
7
votes
1answer
4k views

Fast general method to calculate percentiles

I want to find n>1 percentiles of an unsorted column in PostgreSQL. For example the 20th, 40th, 60th, 80th and 100th percentile. An obvious solution is to count and sort the column and then do a ...
4
votes
1answer
256 views

MySQL: A better way to write this query?

We are using the following query in our system: SELECT f.type AS type, COUNT(i.id) AS submissions, SUM((CASE (e.oiPost + e.oiPhone + e.oiEmail) WHEN 0 THEN 0 WHEN ...
1
vote
2answers
333 views

how to get count(*) from table which either has column or not?

I have a post table as below: CREATE TABLE `post` ( `p_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT, `user_id` smallint(5) unsigned NOT NULL, `cat_id` tinyint(3) unsigned NOT NULL, ...
2
votes
1answer
196 views

database connection time expired issue

I have a server machine and four client machine for database connectivity. I installed sqlexpress 2008 in server and one machine and all remaining systems, they have connected the database through ...
1
vote
1answer
854 views

Secure method beside phpMyAdmin for remote mysql

Recently, one of my centos linux servers was hacked and the cause of due to phpMyAdmin. It was said due to this problem PhpMyAdmin vulnerability CVE-2011-2505 ...
3
votes
3answers
5k views

innodb_buffer_pool_size not changed

I use MySQL 5.5.23-1~dotdeb.0 (Debian) and here is the relevant part of my.cnf default-storage-engine = innodb innodb_buffer_pool_size = 3G innodb_log_file_size = 256M innodb_thread_concurrency = 8 ...
0
votes
1answer
1k views

Cannot Login after configure oracle-xe [closed]

I already success install oracle-xe on my ubuntu 10-04, tried to configure the port and password sudo /etc/init.d/oracle-xe configure, and then restart my computer and go to http://127.0.0.1:8080/apex ...
4
votes
2answers
3k views

Does Oracle support table-level & column-level permissions?

If there is a customer table, and some extra-private/secure information like SSN is there, should I create another table to store such information and lock that table so only certain people can view ...
2
votes
1answer
181 views

Is it possible to sync a Pervasive SQL database to a PostgreSQL database, and vice-versa?

I was wondering if it is possible to sync a Pervasive SQL database to a PostgreSQL database. If I set this up I would need the ability to sync both ways either on command or via a schedule. Does ...
5
votes
2answers
179 views

In SQL Server, is it possible to have a PRIMARY KEY on a table without either CLUSTERED or NONCLUSTERED indexes on the same key?

In Sql Server (2008), is it possible to have a PRIMARY KEY on a set of columns without either CLUSTERED or NONCLUSTERED indexes on the same set of columns? I am aware of the fact that PRIMARY KEY and ...
5
votes
2answers
4k views

Frequently slow queries while in the 'Update' state

I have two tables that I update very frequently, one with a direct UPDATE .. and another INSERT .. ON DUPLICATE KEY UPDATE ... Normally these queries are instant but at times will take 0.1s to 1+ ...
2
votes
1answer
401 views

Greater than operator ignoring a nonclustered index?

I have a pretty simple query in SQL 2008 R2 and I have a nonclustered index on the "sDate" datetime column. When I look at the execution plan for the following query it seeks the nonclustered index. ...
0
votes
1answer
460 views

mysql picasa like photo tags store and query [closed]

I want to make a photo website, allow users to upload photos and write 1-10 customs photo tags, like picasa. I use mysql. Tags could be words or short sentence, but total length can not over 80 ...
6
votes
1answer
4k views

I need to run VACUUM FULL with no available disk space

I have one table that is taking up close to 90% of hd space on our server. I have decided to drop a few columns to free up space. But I need to return the space to the OS. The problem, though, is ...
2
votes
1answer
4k views

Very Large Log Files

I'm running Windows Server 2008 R2 and executed a large query by accident. Next, the sever ran out of hard drive space. I now have a file in my administrtor documents (log.log) that is over 18GB. I ...
1
vote
0answers
548 views

ORACLE SSL using Microsoft Certificate Store for PKI

I am trying to set up PKI SSL authentication between client and server using a Microsoft Certificate Store. Client: Windows 7 64 bit with Oracle client 11.2.0.3.0 Server: Windows 2008 R2 64 bit with ...
4
votes
1answer
4k views

MySQL Innodb corruption

I recently inherited a Drupal site that has an Innodb corruption. MySQL will run for sometime--usually about 24-hours but will eventually need to be manually restarted(see log output below). I have ...
12
votes
1answer
4k views

When should you specify PAD_INDEX?

So, you can use FILLFACTOR to leave space in leaf index pages. Specifying PAD_INDEX also leaves space in intermediate nodes. What scenarios should you specify PAD_INDEX, and what benefit does it ...
5
votes
3answers
395 views

Restoring SQL DB from down SQL Server (on domain) to existing SQL server (not on domain)

If and when my SQL server goes down and takes too long to get back up, can I restore my DB on another SQL server and run my software from there (I can point which SQL server to run from)? Will all ...
2
votes
1answer
557 views

How can I restore a MySQL database after formatting my hard drive

I recently formatted my PC which had MySQL running on it. As a result, I lost the databases on my hard drive. I tried to restore the databases by re-installing the MySQL Server and putting the ...
4
votes
2answers
1k views

Add column taking too long

I'm trying to add a column to a database. The query has been running for 25mins and it's locking web access to the table and breaking our website: alter table MyTable add MyNewColumn varchar(max) not ...
0
votes
1answer
108 views

Mysql dump restore doing some funny stuff

I am using linux platform. I also dump the data into a file and I restore into a server and I ran this command [root@localhost /]# mysqldump -u root -p fms < /device.sql The funny part it keep ...
2
votes
1answer
4k views

Using a foreign key on multiple fields in one table

Simple question probably. For two tables. A one to many relation is created from A -> B, TeamID -> Fk_Team, however there are multiple fields that need to reference this one relationship how does ...
6
votes
2answers
373 views

Help with this query

I have a person table. I also have a car table and books table. The car and book table both have a foreign key back person. I am trying to count the number of books and cars each person has: I try: ...
5
votes
2answers
3k views

Find the disk size of specific rows

I am trying to figure out the disk size a number of rows in various tables take up. I can define this rows by a query. How can I find out the actual disk size that corresponds to the result set in ...
1
vote
1answer
839 views

Changing collation type database-wide in MySQL

How do I retroactively update the collation type database wide without dropping and recreating it? I accidentally created a database without specifying UTF8 as the default collation type. I then went ...
3
votes
1answer
2k views

How to speed up a loading data into MySQL from a zipped archive

I dumped a large database to an archive with: mysqldump --compress --max_allowed_packet=500M -h myhost mydb | gzip > /tmp/mydb.sql.gz This took about 10 minutes to run, and generated a file ...
0
votes
1answer
6k views

How to export a table on postgresql command line

Anyone can do tell me how to do that? (I know maybe is a dumb question but I'm trying to learn how to use command line of postgresql) ~$ psql mybase psql (9.1.3) Type "help" for help. and then ...
1
vote
1answer
745 views

Change root password of mysql database

This could be a Rookie problem , but it seems that i am not able to solve it. I have MySQL server installed on my windows machine(MySQL 5.5) under the Admin username root. Some How i lost the ...
5
votes
1answer
582 views

SQL Server falling below 5000 free pages

I have set alerts on two SQL Server 2005 instances I have in production. One of those alerts is sent whenever the Free Pages performance counter falls below the 5000 pages mark. Both servers normally ...
4
votes
1answer
1k views

mysql change password in session

I changed my password from old hash to a new hash using the following query SET SESSION old_passwords=FALSE; SET PASSWORD = PASSWORD('[your password]'); I found this query on Mysql password hashing ...
5
votes
2answers
2k views

how does SQL Server know to lock view objects?

Not sure whether this is a more or less appropriate place to ask this question, originally posed at Stack Overflow. In SQL Server 2008 I have a view V over tables A and B that looks roughly like ...
1
vote
0answers
1k views

Installing over a SQL Server 2008 Express default instance named “SQLEXPRESS”

We have a system in which there a SQL Server Express 2008 default instance called "SQLExpress". Normally the SQL Server Express default instance is called "MSSQLSERVER". Now we have an application ...
9
votes
2answers
13k views

How to view data in pgAdmin III

I can't believe they make it this hard. I am at a loss about how to view the data in my database. Is there an easy way to see what data is in my tables with pgAdmin III? Alternatively, is there a ...
1
vote
1answer
2k views

Simple Car Rental database

I am trying to learn SQL development using SQL Server 2008 R2 Database Management Studio. I was trying to model a car rental company, where clients can rent cars, and I have to know which client has ...
9
votes
0answers
3k views

Deploying dacpac application to SQL Server 2008 R2 [closed]

I cannot get dacpac working on my installation of MS SQL Server 2008 R2. I am using Visual Studio 2010 Shell with MS SQL Server Data Tools to build a project into a dacpac file. However, when I try to ...
2
votes
1answer
496 views

Configure sp_send_dbmail to send emails ONLY to certain recipients

For our environment test we need to configure sp_send_dbmail to send emails only to certain recipients. Let's say a stored procedure executes the following code: EXEC msdb.dbo.sp_send_dbmail ...
2
votes
2answers
690 views

Out of memory mysql was aborted

I am using windows 2003 server, with 8G of RAM and MySQL was installed on It. I am getting error as follows out of memory.[ERROR] mysqld: Out of memory (Needed 523712 bytes). The configuration ...
4
votes
1answer
1k views

Oracle Database Enterprise Users & Roles with Microsoft Active Directory?

We have a legacy application and we have full access to source code and platform running it, so virtually any change can be implemented if required. The application is a Java Swing heavy-weight GUI ...
1
vote
1answer
91 views

Transfering data from one MongoDB server to another while eliminating users/authentication

I am transferring MongoDB databases from one server to another. The servers cannot talk to each other, so I must use mongodump/mongorestore. The 'from' server used authentication for the databases. ...
1
vote
2answers
6k views

Changing TimeZone of an Oracle Database

I am looking to change the timezone in a quite large Oracle database. What are some of the issues I might run into when trying to change the timezone in this way? I don't want to 'trash' the ...
1
vote
1answer
174 views

How to prepare a date and double for a mysql replace statement?

I have a MySql table with three columns: CU VARCHAR(3) DA DATETIME VA DOUBLE I need to execute several REPLACE into mytable (CU, DA, VA) values("ABC", mydate, myval) statements from Java. mydate is ...
1
vote
1answer
204 views

In a simple table with no complex indexes, does a large number of existing rows slow down an INSERT?

I have this small, simple table: CREATE TABLE `ads_tracker` ( `id` int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, `type` smallint unsigned NOT NULL, `reference` smallint unsigned NOT NULL, ...
2
votes
3answers
3k views

Recover lost data from .LDF file

Background: Using Business Contacts Manager 2010 with SQL 2008. Master database is hosted through SQL and each computer connects. When the connection is stopped, each computer switches to local copy ...
7
votes
3answers
4k views

How costly is opening and closing of a DB connection?

How CPU intensive is opening and closing of a DB connection (for a web app) in MySQL ... when the DB software is on localhost? ... when the DB software is on another machine?
2
votes
1answer
861 views

innodb_flush settings on Amazon RDS

Setting innodb_flush_log_at_trx_commit = 2 improves my application performance considerably on my local development environment. The response time and number of requests per second on a 40 concurrent ...
6
votes
3answers
653 views

Single query sending and retreiving duplicate data on MS SQL Server?

Very odd thing happening. It would appear that all queries against a particular database in our system are periodically "running slow". Ie "normal speed" for 5 minutes then slow for 5 minutes ...
2
votes
2answers
1k views

Does it ever make sense to use RAM Disk to force RAM allocation for tempdb with SQL Server 2008

If I give all RAM to SQL Server, it will use it's own pattern to determine what RAM to allocate for what. If I allocate portion of RAM as RAM Disk and put tempdb into that disk it will force RAM ...

15 30 50 per page