0
votes
0answers
75 views

How to efficiently model this simple data structure?

catId(INT) | userId(INT) | catName(VARCHAR) 0 1 Cat1 1 1 Cat2 2 2 U2Cat1 3 2 ...
2
votes
2answers
238 views

Why one database is so much slower than other?

The same query on postgresql takes 9 min on one database, on other only 5 sec. I use the same postmaser, the same user. I connect directly with psql. There seems to be no differences in database ...
3
votes
1answer
5k views

Error 9001, Severity: 21, State: 1 The log for database 'DB_NAME' is not available [closed]

I have a SQL Server 2008 R2. I got a mail that the backup had failed, I opened the SQL log viewer and started browsing. And i found these two errors a bunch of times. error 1: Date ...
-1
votes
1answer
4k views

how to sum column values with same id [closed]

with this query : SELECT a.nid, a.stock, b.qty FROM uc_product_stock a INNER JOIN uc_order_products b ON a.nid = b.nid I have the following result: nid stock qty 11 256 4 11 256 ...
5
votes
1answer
505 views

Query in procedure occasionally does not finish

I have a question about how to debug very strange behavior (nested query getting stuck) in SQL Server 2008 R2 (Standard Edition) running a query. Sometimes (unfortunately not always) when I run a ...
-1
votes
2answers
5k views

how to insert data from one table to another [closed]

SELECT a.nid, a.stock, b.qty, sum( b.qty ) FROM uc_product_stock a INNER JOIN uc_order_products b ON a.nid = b.nid GROUP BY a.nid the above query give me the following result: nid stock qty ...
3
votes
1answer
164 views

How to avoid Repetition in the Database Design?

I have currently the following database structure, Retailers ----------------------------------------------------------------- ID Name XXX XXXX XXXX XXXX XXXX XXXX ...
6
votes
2answers
883 views

SSRS appears to be ignoring Permissions set using Report Manager

I have setup SSRS on SQL Server 2008 in native mode. As an administrator I can login to report manager, upload reports and run them, and also use the Web Service URL to generate reports. I have also ...
1
vote
1answer
59 views

The size of the tablespace doesn't change when I import a smaller dump or deleting old data

i wanna free some disc space used by an oracle database , I tried deleting old data and importing smaller dump but the size of tablespace/datafile remain unchanged.
2
votes
2answers
157 views

Using data from other database to populate a new database

I have a SQL Server database DB1 and want to move data from DB1 to DB2. But only want some of the data to be moved. I want all the rows from DB1 that have a catParent that is the same as I Id from ...
18
votes
1answer
865 views

Cast to date is sargable but is it a good idea?

In SQL Server 2008 the date datatype was added. In this Connect item you can see that casting a datetime column to date is sargable and may use an index on the datetime column. select * from T where ...
0
votes
1answer
131 views

Master Slave Replication in Mysql

I have generated a dump from Master and I have to construct slave and give privileges and binary log position and file name of master for it to obsorb from master. Master is a high transaction OLTP ...
2
votes
6answers
1k views

MySQL join two table if second table is not empty

I have 2 tables like below table 1: users id name 1 John 2 Jane 3 Mery 4 Alpha table 2 : notes id note owner created 1 alpha alpha 1 2013-02-03 10:30 2 yeah ...
3
votes
1answer
340 views

Cannot delete publication

When attempting to delete a publication, I am getting the error cannot drop publication 'XX' cannot drop article 'XX'. The subscription has been deleted at the subscriber. Any ideas on how I can ...
5
votes
1answer
1k views

Many to Many and Weak Entities

I have an entity that cannot exist without being defined by another, and I want this entity to participate in a many to many relationship. Example: An artist has an album (the album cannot exist ...
1
vote
1answer
280 views

Something wrong in pg_hba.conf

this my configuration: #postgres.conf: listen_addresses = 'localhost' #pg_hba.conf: local all postgres md5 local all appuser trust local all devuser trust local all all peer i'm connecting in ...
3
votes
1answer
395 views

Can't understand results of pg_stat_statements view

I configured my postgresql.conf (my version is 9.1) with the normal persistent configuration: shared_preload_libraries = 'pg_stat_statements,plperl' custom_variable_classes = ...
3
votes
1answer
409 views

SQL Server Troubleshooting Replication and Long-Running fn_dblog query

I am trying to get (pull) Transactional Replication working again for a subscriber. Currently, in Replication Monitor I am seeing messages in the Publisher to Distributor tab and the Distributor to ...
2
votes
1answer
498 views

SQL Server - storing ulong as primary key

I need to store ulong values as a primary key in SQL Server. Since SQL Server doesn't have a ulong datatype (or for that matter anything unsigned), the only way to go is to have column as ...
0
votes
1answer
193 views

Does a standby slow down Oracle imp?

I have Oracle 10gR2 installed on Redhat Linux 5.4 on two servers (primary and physical standby). When I import data into the primary server while the standby is started it takes too long to complete ...
1
vote
1answer
129 views

With MyISAM is there any index size savings when using INT vs BIGINT?

There is obviously a four byte per row space savings in a data column when using INT vs a BIGINT type. But I have been trying to figure out if there is also any space savings for myisam indexes on ...
2
votes
1answer
187 views

Configuration options for relational algebra evaluator “ra.jar”

I am participating in the Stanford Database Class, and there are some problem sets to be solved in "mathy" relational algebra syntax. The course instructors demand from students to use this ...
2
votes
2answers
117 views

SQL Server: reset all database tables

I have a SQL Server 2008 R2 database with about 60 tables and around 300 columns. I want to reset all the data and auto increments, I found a question somehow similar but the answer there is to ...
2
votes
2answers
8k views

Server requested authentication method unknown to the client [mysql_old_password]

Warning: PDO::__construct(): The server requested authentication method unknown to the client [mysql_old_password] SQLSTATE[HY000] [2054] The server requested authentication method unknown to the ...
1
vote
2answers
75 views

How do I add/remove tables to a Windows Azure database?

I have a Windows Azure database which I wish to add/remove tables to, and yesterday I witnessed a colleague do this online, on what looked like a web based SQL management studio, but I can't find it ...
4
votes
1answer
2k views

Using Solr/Lucene for searching non-text tables?

I am creating a web application to retrieve subsets of one large (4m rows) table. The 4m rows only change once a year. The table has 200+ columns of types boolean and numeric. It has no text columns. ...
3
votes
1answer
108 views

Dissecting Joins

Recently I asked a question in dba.stackexchange the question was about data hierarchy in sql and a guy named chris allen answered the question and I really loved it but when I try to understand that ...
2
votes
2answers
977 views

12c Grid Agent installation issues - Shell path is incorrect or not defined

I am installing 12c Grid Control agent on my server via Enterprise manager. The targer server is a UNIX server with AIX OS on it. I add target host manually, enter authentication information, host ...
1
vote
2answers
240 views

Select Into a table on server1 from server2 without using 'Linked Servers'

I am trying to get all the records from one table into another table but these tables (which are identical) are on separate servers. Any help would be appreciated. Thanks
1
vote
1answer
2k views

Which is better: many join conditions or many where conditions?

I am trying to compare two queries: Query 1: SELECT a,b,c,d,e FROM tableA LEFT JOIN tableB ON tableA.a=tableB.a WHERE tableA.b=tableB.b AND tableA.c=tableB.c AND tableA.d=tableB.d AND ...
0
votes
1answer
109 views

mysqlslap running very slow on a specific computer

I've recently discovered the tool mysqlslap and have run some simple tests with it. I currently have three test environments (2 Win 7, 1 Linux Ubuntu) where I can run these tests. However, running a ...
1
vote
0answers
693 views

How to return all values from a stored procedure casted as varchar(max) in sql server due to PHP mssql_query() ntext issue?

This is more of a concept/how-to question rather than about actual code. I can do the programming but I just need to know what direction to head... I was going to post this on StackOverflow but it's ...
7
votes
2answers
466 views

Capturing datetime of change in SQL Server CDC

So we've started exploring using change data capture on one of our production databases. We'd like to know the datetime of each change. Reading through walkthrough's and tutorials etc it seems that ...
1
vote
2answers
1k 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
56 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
488 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
980 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
237 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
4k 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
201 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
60 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
244 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
546 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
78 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
151 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
2k 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
171 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
595 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
168 views

Renaming the system generated partitions during interval partitioning

I am trying to rename the system genrated 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 ...
5
votes
3answers
14k 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 ...

15 30 50 per page