5
votes
4answers
582 views

Group data by non-unique keys by distinct time range

I have data in my table like following... PROJ_NBR STATUS START_DT AL20 AC 1/14/2010 4:31 AL20 AC 1/14/2010 4:32 AL20 AC ...
5
votes
2answers
5k views

The SELECT permission was denied on the (View) object after explicit grant select on view to user

I have a database with a View Named '1098Statement' We are doing testing for an application with user name 'appuser'. I have tried the following solutions to granting select on the view and keep ...
7
votes
3answers
2k views

What Mechanism does MySQL use to schedule Backups on Windows Server 2008?

When scheduling database backups on MySQL Server (v5.1.45-community) running on Windows Server 2008, what mechanism is used to trigger the backups to run? I think it's using the Windows Task ...
13
votes
3answers
5k views

Why does importing a 12 GB .sql file take more than 36 hours?

I've been waiting now for 36 hours for a 12 GB .sql file to be imported with a simple type site.sql | mysql command. I can see the ibdata1 is growing still, currently nearly 40 GB. Considering the ...
7
votes
2answers
32k views

SQL Server shows database in recovery

Today, after a power failure, one database (with Recovery: full) shows "In Recovery" in SSMS. So: myDatabase (In recovery) (database status: recovery, Shutdown) After finish, the "recovery ...
7
votes
1answer
483 views

How can I rewrite for SQL Server a trigger that writing for Oracle?

How can I rewrite for SQL Server a trigger that was originally written for Oracle ? Here is my Oracle trigger code: CREATE OR REPLACE TRIGGER P000KUL_TEST BEFORE INSERT ON P000KUL REFERENCING NEW AS ...
8
votes
5answers
210 views

What is the best way to find out how many records do not have a proper phone number in SQL Server?

I have a field that people historically could use to freely supply a value. I need to identify the records which do not have an appropriate value so I can clean them. I've been looking around in SSIS ...
2
votes
3answers
3k views

Script to Monitor MySQL Replication

G'Day, I am looking for a bash script (using Perl - As that is already installed on the machine and I don't want to have to install Ruby, Python etc. just for this requirement) that will perform some ...
6
votes
1answer
2k views

Is it safe to change the Recovery Model of SSRS database ReportServer to SIMPLE?

I'm changing the recovery model of ReportServer database from FULL to SIMPLE. Is there any reason why i would not want to do this? Besides the obvious answer of losing point-in-time recovery? (i am ...
4
votes
1answer
789 views

SQL 2005 Full Recovery Mode Point in Time Restore w/out Backup

We have a database that is in full recovery mode. The database is not in production yet so does not have a backup plan in place and is thus not being backed up. In other words, there is no existing ...
1
vote
1answer
1k views

SQL Server 2005: Integration Services Stored Packages is empty. Why?

I am trying to import, export SSIS packages. I know they are there. When I query msdb.dbo.sysdtspackages90 I get 22 packages. But when I connect to Integration Services on the server, the stored ...
8
votes
2answers
2k views

What is the difference between terminating an Oracle sql statement with semicolon or with a slash on the next line?

The following two queries seem to be equivalent when executed in sql*plus: 1. select * from user_tables; 2. select * from user_tables / Is there any difference between both versions?
16
votes
3answers
16k views

What is the difference between Oracle's VARCHAR and VARCHAR2 datatypes?

When migrating tables coming from other DBMSs to Oracle, one of the standard tasks is to replace all VARCHAR(n) fields with VARCHAR2(n) fields (provided n <= 4000). Why does Oracle call this ...
3
votes
3answers
887 views

Migrating from ntext to NVARCHAR(MAX)

I have table with the columns of type ntext.And for some peculiar reasons, client want to migrate the column type to NVARCHAR(MAX). While doing so , what all potential threat should i be careful ...
5
votes
2answers
16k views

How do I allow users to see grants, view definitions, PL/SQL, etc in a database without granting them access to change those objects

As a developer, I need to be able to access the design of the database/database objects from production so I can ensure I'm working with the latest and greatest version of the objects I'm developing ...
5
votes
2answers
2k views

BULK INSERT - best usage

I need to export 150 million rows of only int/bigint columns from one SQL instance to another. I am using BCP queryout to export the rows and BULK INSERT to import the rows to another table. I split ...
1
vote
1answer
7k views

How to take undo datafile offline ,which is in recovery mode?

I am trying to take undo datafile in offline mode using following command alter database datafile '<datafile path>' offline; this datafile is in recovery mode. Oracle shows message as ...
297
votes
7answers
549k views

How do I list all databases and tables using psql?

I am trying to learn PostgreSQL administration and have started learning how to use the psql command line tool. When I log in with psql --username=postgres, how do I list all databases and tables? I ...
14
votes
6answers
9k views

Are there any good and free tools for managing a PostgreSQL database? [closed]

Before, I have used phpmyadmin to manage an MySQL database, but now I would like to manage a PostgreSQL database. The PostgreSQL database is on a server, but not a webserver, so I don't use PHP. Are ...
2
votes
3answers
1k views

How do I get % progress for “type db.sql | mysql”

I am doing: type db.sql | mysql and the console output is nothing. I see the ibdata1 file growing, but I don't know how many GB it will grow to. I would like to see a % progress indicator of some ...
2
votes
1answer
13k views

How do I specify that a column should be auto-incremented in pgAdmin?

I have started to learn pgAdmin III to manage a PostgreSQL database. But it wasn't an easy to use application. If I create or have created a table with pgAdmin III, how can I add ...
3
votes
1answer
366 views

MySQL Config on Mac

I have a MacBook pro with 2.53 GHz Intel Core 2 Duo and 4GB DDR3 ram. I am running a huge database on my laptop with over 100 million records. I want to know : Which of the .cnf files is suitable ...
2
votes
2answers
4k views

In Oracle, how to globally enable parallel execution?

In Oracle 11g, is there a way to tell the database to use parallel execution whenever possible by setting a flag etc, rather than using PARALLEL hints with every SQL statement?
4
votes
2answers
750 views

Best Setup for Database Cluster

I need to set up a good database clustering solution for a system that I am putting into production. I was hoping to get some advice from the experts as I am a primarily a developer and not a database ...
1
vote
1answer
13k views

Where all can the /*+ PARALLEL */ hint be used?

It works with SELECT and UPDATE statements. Are there some more statements with which it works? I was able to use it with create, but am not sure if the hint was actually considered. SQL> create ...
3
votes
4answers
507 views

Regnerating an execution plan - is this a valid approach?

If I am optimizing a query, in order to ensure that this query does NOT uses cached execution plan I use OPTION (RECOMPILE) with the query. Is it a good approach?
48
votes
4answers
63k views

How to safely change MySQL innodb variable 'innodb_log_file_size'?

So I'm fairly new to tuning InnoDB. I'm slowly changing tables (where necessary) from MyIsam to InnoDB. I've got about 100MB in innodb, so I increased the innodb_buffer_pool_size variable to 128MB: ...
3
votes
2answers
2k views

Keeping “SQL Trace was started” and “SQL Trace stopped” from filling up my SQL logs

I have a SQL2008 server that runs a custom application that starts and then stops a SQL trace every 60 seconds (it does some reporting and summarization on the trace data). The problem is that my SQL ...
2
votes
2answers
6k views

Execute PL/SQL script block in C#

I am trying to execute a PL/Sql block by using the OracleClientProvider in .Net . The language I am using is c#, the DB is oracle10g What I am actually doing is the following : //ConnectionSting ...
4
votes
1answer
539 views

What can be done, if anything, to tune a SharePoint database?

SharePoint uses a single table (i.e. dbo.AllUserData) with columns like nvarchar1, nvarchar2, ..., nvarchar64 or int1, int2, ..., int16 (193 columns altogether) to store all items from all lists in ...
3
votes
1answer
431 views

MySQL Database Schema for Volleyball

I am developing a database for the recording of Volleyball results. I have a fixture database that tells me who plays who in each round. Teams Table, say IDs 1,2,3,4 Fixtures Table, Round No.1, Team ...
5
votes
3answers
1k views

Is the ADO.NET Entity Framework known for generating poorly performing queries?

This question is inspired by the comment posted to the latest ServerFault blog post: Are you guys still using LINQ to SQL? I know I can use SQL Server Profiler and/or the ToTraceString method to ...
4
votes
4answers
1k views

Best method to give two Oracle databases on the same server access to common data

With a production and a test database on the same server, how should access be provided to some common quarterly update tables for both databases? It is possible to put these tables into a third ...
6
votes
3answers
1k views

How do I rename my local SQL development server?

I'm a dev who inherited a mostly functioning box doing most of what I need. Except for the machine name is still that of the old dev (we name it "{username}-dt" or "{username}-lt" for ease of id on ...
21
votes
3answers
16k views

How do you calculate mysql max_connections variable?

How do you calculate mysql max_connections ? What do you take into consideration ?
0
votes
1answer
2k views

detaching database results in error “SQL Server detected a logical consistency-based I/O error”

I'm trying to detach a database and I'm getting this error : SQL Server detected a logical consistency-based I/O error: incorrect pageid (expected 1:234; actual 0:0). It occurred during a read ...
1
vote
2answers
3k views

SSMS: Show execution plan for a stored procedure as a single tree

I execute a stored procedure with an option "Include Actual Execution Plan". The execution plan always is represented by multiple statements each of which has its own execution plan. MSDN states the ...
3
votes
3answers
150 views

Is it possible to install Developer Edition of SQL Server as the primary development server?

Is it possible to install Developer edition of SQL Server on a Windows server environment as development server? Each developer will have a local copies of same SQL Server edition and will connect to ...
3
votes
3answers
5k views

AWR Report - Tuning Database

We have an OLTP system, following are our AWR reports taken during peak hour window for three days once each day. We see a lot of direct path reads; we want to add more PGA in-order to reduce wait ...
5
votes
1answer
361 views

Why can't I call my UDF directly? Why do I need to qualify it 3 levels deep?

I just created a UDF and testing it I found only works when I use this syntax SELECT [PMIS].[dbo].[fnIsReportingTo] (50,1132) I was expecting it to work like this: select * from fnIsReportingTo ...
5
votes
2answers
1k views

How do I replace this where clause with a join?

Typically when I see SQL that uses something like select * from employees where epmloyeeTypeId in (select id from type where name = 'emp') I replace the where with this: select e.* from ...
4
votes
2answers
5k views

Help solving a Clustering Issue: [sqsrvres] ODBC sqldriverconnect failed

I have a 2 node cluster (NODE-A & NODE-B) with 2 SQL instances spread between them. INST1 prefers NODE-A, INST2 prefers NODE-B. INST1 started generating errors then, failed over to NODE-B. ...
7
votes
3answers
560 views

Data Warehouse Creation

I'm fairly green when it comes to this field. I'm a data analyst at a small hospital 8 months now, out of a 2 year degree in a new career field for me. Situation We have a Cobol "database" (I ...
4
votes
4answers
385 views

Where can I find good literature for beginners?

I am trying to find some database tutorials,books and similar, since I have started this course in college, and received some material, but it is really hard to manage through all the info on the net. ...
9
votes
3answers
389 views

How-to implement an entity with an unknown maximum number of attributes?

I am designing a baseball simulation program and I have run into a problem with designing the boxscore schema. The problem I have is that I want to track how many runs are scored in each inning. The ...
4
votes
2answers
476 views

How can I disable async IO or isolate one session that slows or freezes other sessions?

Each day I have a session that produces Avg.Disk Queue Length > 800 (5min interval). I have found that just before this moment Sql Server optimizer have made an error: it decides to use a ...
5
votes
2answers
8k views

Why do we need to backup Oracle archive logs along with datafiles

Oracle® Database Backup and Recovery Basics 10g Release 2 (10.2) says that Archived redo logs are the key to successful media recovery. Back them up regularly. But, I wonder, why backups of ...
2
votes
1answer
575 views

truncate table for all db in sql server 2000

i need a script that will go to every db in server and if exsistes a table named "table1" will do truncate table table1
5
votes
2answers
1k views

After I kill my clients, MySQL continues to process queries for hours

Hi I have a MySQL db with 10 million rows with lots of triggers. A php client connects to mysql and INSERT's hundreds of rows per second. When the client has been running for hours, and I terminate ...
2
votes
1answer
647 views

Question on Design for User + User Groups + User Types + Subscriptions Model

I am redeveloping an existing web application with both weak source code and a weak underlying database design. I'm trying to develop things in a way that future expansion will be much easier, ...

15 30 50 per page