1
vote
2answers
57 views

Label data according to percentile

I have a table name temp with column customer_id , sum and I need to add extra column customer_label (may be on view) which is 1 if customer lies in top 10% according to value of sum, 2 if lies within ...
1
vote
1answer
1k views

Mysql query grouping by two columns for max date takes too long

I have table that looks like this: l_p l_a l_timestamp l_n l_act l_name 123 321 2011-1-1T01:00:00Z B q das 21 23 2012-1-1T01:00:00Z C q sd 123 ...
2
votes
0answers
85 views

MySQL Partitioning Performance

I have a MyISAM table with billions of rows that is still causing me problems because the indexes, even after I shortened them as much as possible, do not fit in my 64GB of RAM. I am unable to index ...
-4
votes
0answers
78 views

Why is LRU is not suitable for joining 2 relations in DBMS [closed]

In DBMS, can someone please explain how the LRU (least recently used) buffer replacement policy acts when joining 2 relations in a database? I have read that LRU is not efficient when joining two ...
0
votes
0answers
312 views

MySQL CSV LOAD DATA INFILE … doesn't want to load more than 72 lines

I'm trying to load a .csv file into my database with many lines of input from a website I'm working on. For some reason I can load files multiple times (over and over) into the database but they have ...
-1
votes
0answers
280 views

All users missing after a detach/reattach [closed]

After detaching and reattaching a database to do a copy operation, all of the user objects are now missing from the database (I should add that the copy failed; according to the logs, there was an ...
0
votes
1answer
96 views

Will Partitions and Indexes on the same table help in performace of Inserts and Selects?

I have a table containing the list of visitors and this table has the following information. Visitor Browser Information Visitor Location Information Visitor Time Information No of Visits I have a ...
6
votes
2answers
4k views

How to design indexes for columns with NULL values in MySQL?

I have a database with 40 million entries and want to run queries with the following WHERE clause ... WHERE `POP1` IS NOT NULL && `VT`='ABC' && (`SOURCE`='HOME') && ...
1
vote
1answer
259 views

How often should MySQL (stock, Percona, etc.) be upgraded?

My organization runs several data-driven web applications backed by various flavors of MySQL on RHEL (i.e. we're just like everyone else!) Some of our web apps use the standard build of MySQL, and we ...
-1
votes
0answers
105 views

Unable to restore cpanel database backup [closed]

I recently created a complete backup of my cpanel to move it into another server. Now the insert queries generated by cpanel for wp-posts table (corresponding to WordPress posts) are too big since ...
2
votes
1answer
644 views

Can you grant an Active Directory Group rights on a linked server?

I am trying to grant rights to an Active Directory Group on a Linked Server. I am unable to do it; it only allows me to grant rights to individual active directory users. Does anyone know how to ...
2
votes
1answer
3k views

Is shrink a safe online operation?

We are planning to run the following space management command: alter table XXX shrink space cascade on a production database (Oracle 10g). The XXX table is a transactional table heavily used for ...
2
votes
1answer
143 views

Backup on an empty SSAS database hangs

I created an SSIS package to iterate through all databases on an SSAS instance. It grabs the DatabaseId using AMO in a vbscript, then generates the XMLA to backup each database. Most databases ...
2
votes
1answer
80 views

Debugging SSAS Timeouts

I have a drill-through problem apparently related to security. Users in one role are seeing timeout failures when trying to invoke a drill-through action. They have permission on the action through ...
1
vote
1answer
658 views

Remove specific duplicates (all but latest)

When removing duplicate rows, using the below query from this tutorial, how would I go about forcing which of the found duplicates to remove? DELETE FROM dbo.ATTENDANCE WHERE AUTOID NOT IN ...
6
votes
1answer
2k views

How can I request a flush of the postgresql transaction logs?

I have the following problem: a "vertical" Linux distribution (Sophos UMT) comes with PostgreSQL 9.2 to store its configuration. Unfortunately, since the last update, it seems that the transaction ...
10
votes
3answers
1k views

Updating a table with millions of records, its been 4 days

I am currently updating a table with millions of records, its been 4 days and query is still executing. I checked the activity monitor its shows that query is running. In event log there is no ...
1
vote
0answers
2k views

Troubleshooting a SQL Server instance that won't start

I've had a problem with one instance of SQL Server 2008 (the free version) not starting automatically. I always have to right click on the icon in the task bar and start it manually. It is set to ...
7
votes
3answers
5k views

Are individual queries faster than joins?

Conceptual question: Are individual queries faster than joins, or: Should I try to squeeze every info I want on the client side into one SELECT statement or just use as many as seems convenient? ...
2
votes
1answer
321 views

Longest prefix search in Oracle

I have a list of phone number prefixes defined for large number of zones (in query defined by gvcode and cgi). I need to efficiently find a longest prefix that matches given number PHONE_NR. I use ...
6
votes
2answers
314 views

Exporting database Oracle 7.3 on Windows NT 3.51

How to take dump files on Oracle7.3 running on Windows NT 3.51? Should you stand in the Orant/bin folder and run one of the programs there like> exp73 SYSTEM/password@[dbinstance] FULL=Y ...
1
vote
1answer
281 views

Trigger not Working

I created trigger on table PENDING. Pending table has 3 columns uniqueId duration maxDuration I have another table COUNT with 2 columns req_id total Here is my trigger-- CREATE TRIGGER ...
1
vote
1answer
1k views

Mysql settings for query_cache_min_res_unit

What is the best setting for query_cache_min_res_unit for these results: +-------------------------+-----------+ | Variable_name | Value | +-------------------------+-----------+ | ...
1
vote
2answers
596 views

Innodb table is taking randomly long time to execute the insert query and in show processlist showing as queryend/updating

Innodb table is taking randomly long time to execute the insert query and in show processlist showing as queryend/updating and it happens for the similar queries for the same table and the queries got ...
4
votes
1answer
1k views

Running total to the previous row

I need some help with windowing functions. I know you can calculate the sum within a window and the running total within a window. But is it possible to calculate the previous running total i.e. the ...
1
vote
0answers
56 views

Which database could handle storage of billions/trillions of records in sql? [duplicate]

We are looking at developing a tool to capture and analyze netflow data, of which we gather tremendous amounts of. Each day we capture about ~1.4 billion flow records which would look like this in ...
1
vote
2answers
231 views

Join on different types

In a database I have two tables: The first has a field named taxonomy_id that is an integer The latter has a field named ID that is a character varying The two tables are related: if it exists a ...
1
vote
2answers
591 views

Remove scientific notation from an XML column

I have a XML column as shown below: <Root> <Row> <Rowid>1</Rowid> <date>2013-05-06</date> <Balance>1.0002E7</Balance> </Row> ...
0
votes
2answers
1k views

How can I add a column to multiple tables at once in MySQL Workbench?

I have a MySQL Workbench model (diagram) that belongs to a Ruby on Rails application. I now need to add the created_at and updated_at timestamp columns to each of the tables. What is a quick and easy ...
1
vote
2answers
252 views

Is it possible to define package procedure/function outside of package body block (for Oracle)?

Is it possible to define package procedure/function outside of package body block (for Oracle)? Simplified syntax for defining package body is: create or replace package body <package_name> IS ...
0
votes
2answers
2k views

Backup SQL Server To NAS

I have seen that there are similar questions like this but I tried all of them and my problem still exist. I want to backup a db. I created a shared folder on NAS I can reach this shared folder ...
2
votes
1answer
1k views

Trigger for updating a count of rows from a table into another table

I have these two tables: mysql> select * from orders; +-------------+---------+ | Customer_ID | Item | +-------------+---------+ | A01 | CPU | | A01 | Monitor | | A02 ...
1
vote
1answer
558 views

Role audit in Oracle 10g

Is it possible with Oracle auditing to find out if the role can be revoked from particular user without loosing any privileges that he actually uses? Something like AUDIT webadmin_role BY webapp_user ...
0
votes
1answer
200 views

Check if bit is set in mysql

I have a field which stores the days of the week in binary representation. For example, Mon-Wed-Fri would be represented as b'0101010' with the 1st digit as Sunday and the last as Saturday. What I ...
3
votes
4answers
7k views

Query without having to specify table's schema

I imported a bunch of tables from SQL Server 2000 to my 2008 database. All the imported tables are prefixed with my username eg: erpadmin.tablename. In the table properties it lists 'erpadmin' as the ...
2
votes
2answers
154 views

Record versioning and promotion

Let's say we have this hierarchy: -World --USA ---WA ----Seattle -----Downtown ------1st Ave -------945 1st ave ------3rd Ave ...
2
votes
2answers
643 views

Partial rollback doesn't decrement trancount

Suppose I have an open SQL Server session, and do the following: begin tran insert into People (Id) values (1) select @@TRANCOUNT -- Prints 1 save transaction tt begin tran select @@TRANCOUNT ...
0
votes
0answers
30 views

SQL 2008R2 Trial [duplicate]

I currently have a small db running on SQL Server 2008R2 Express. I'm considering moving to SQL 2008R2 Small Business or Standard to use all the sever is capable of. I have a Dell T610 - 2xQuad Core ...
2
votes
2answers
90 views

Delete SQL Server logins on replicated server

We have a production database which is replicated on another server at a remote location. The local database users (not logins) are also replicated in this database. However, the SQL logins are not ...
1
vote
2answers
460 views

Where should I look for details about 'access denied' errors?

This question derives from Deploying a new database on a new server, an msbuild ssdt rookie issue. Since I have a permission denied error, I expect to find which user is failing to access so I can ...
-1
votes
0answers
83 views

script to startup oracle database [closed]

I found out below script that helps me to start up a Oracle database: set serveroutput on; WHENEVER SQLERROR EXIT SQL.SQLCODE STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "MY_DB" NORESETLOGS ...
2
votes
1answer
221 views

BLOBs storage in a dedicated table

I have a database that has several BLOB columns scattered across multiple tables. Since I am a developer and am looking at making application code writing easier, I wanted to turn these columns into ...
2
votes
1answer
2k views

where is oracle session timezone set?

I have a logging table CREATE TABLE EMAIL_LOGGING ( ID NUMBER(9) NOT NULL, SEND_DATE TIMESTAMP(6) DEFAULT LOCALTIMESTAMP NOT NULL, ...
2
votes
3answers
2k views

How to automate Oracle DB installation (like a 'hands-free' install)?

I installed the Oracle 11g2 'standard' edition using the following zip-files: linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip I used the installation guide by Oracle which I ...
4
votes
2answers
1k views

Postgresql function to create table

I want to create a function in order to create a table with a specific structure pasing part of the name of the table as an argument so the name of the table is t_ . Similar to this: CREATE OR ...
1
vote
2answers
409 views

How can I run a T-SQL Script using SQL Credentials?

I need to develop a T-SQL insert script for use on a remote SQL 2005 Express instance but I would like the script to include the necessary SQL credentials so all the user has to do is execute the ...
3
votes
2answers
126 views

MySql is not optimizing the query properly

I have a table structure as follows : CREATE TABLE `sale_product_inventories` ( `id` int(11) NOT NULL AUTO_INCREMENT, `sale_id` int(11) NOT NULL, `product_id` int(11) NOT NULL, `size` ...
3
votes
1answer
74 views

Workaround the snapshot isolation in a writable CTE

The postgres docs say: The sub-statements in WITH are executed concurrently with each other and with the main query. Therefore, when using data-modifying statements in WITH, the order in which the ...
2
votes
1answer
191 views

Filter on a window function without writing an outer SELECT statement

Since window functions cannot be included in the WHERE clause of the inner SELECT, is there another method that could be used to write this query without the outer SELECT statement? I'm using Oracle. ...
0
votes
0answers
982 views

Server doesn't listen

I try in Win7 by means of PGAdmin 3 to be connected to a host 192.168.1.8 with the virtual machine with linux. Already which time I receive the message Server doesn't listen The server doesn't accept ...

15 30 50 per page