1
vote
1answer
1k views

mysql error log issue

I have mysql server running successfully. The error log location is as.. mysql> show variables like '%log_erro%'; +---------------+------------------------+ | Variable_name | Value ...
2
votes
1answer
4k views

when to use embedded PL/SQL gateway with Oracle APEX?

Oracle Application Express (APEX) requires one of the following three options for an HTTP server: (1) Oracle HTTP Server (with mod_plsql), (2) Oracle Application Express Listener, or (3) an embedded ...
2
votes
2answers
2k views

SET LOCK_TIMEOUT, is it session or statement based?

For what period does the LOCK_TIMEOUT LAST? I do a "SET LOCK_TIMEOUT 10" and a "SELECT @@LOCK_TIMEOUT" in one command after a login and get 10 returned. Immediately after this I do a "SELECT ...
70
votes
4answers
9k views

Why are numbers tables “invaluable”?

Our resident database expert is telling us that numbers tables are invaluable. I don't quite understand why. Here's a numbers table: USE Model GO CREATE TABLE Numbers ( Number INT NOT NULL, ...
3
votes
2answers
318 views

Is it important to release memory back to the server?

I have a SQL Server 2008 R2 instance running on a production system. I'm not a DBA; I'm more a developer, but my client is currently asking me: How important is it to release memory from SQL Server ...
3
votes
3answers
717 views

t-sql - combinatorics

I'm trying to find all possible character combinations in a variable length string. For example: '--' would have 2^n = 2^2 = 4 possibilities, 'x-', '-x', 'xx', '--' I think that essentially I need ...
6
votes
4answers
1k views

What is the fastest way to reset SQL Server database if you can not use RESTORE?

I have integration tests that require test database to function. Since tests should generally be independent, I reset the database in the beginning of each test. I can not use RESTORE, since some ...
1
vote
1answer
151 views

Is it possible to allow write-through computed columns for legacy code that expects a column to be read/write?

I have this existing table for IP storage: CREATE TABLE [dbo].[IPAddresses]( [ID] [int] IDENTITY(1,1) NOT NULL, [IPv4Address] [varchar](15) NULL, [IPv6Address] [varchar](45) NULL, ...
2
votes
1answer
428 views

How to retrieve / read SQL Image Data which is stored in the database?

From one application, we are storing all images in SQL database in the Image datatype. From another application, i need to retrieve the images and display it on User Interface. I am able to store the ...
2
votes
1answer
524 views

SQL Drive getting full delete millions of rows

I'm looking for the easiest way to accomplish this in the limited hard drive space that I have. I have a SQL drive that is dangerously close to getting full. We have about 15 tables that have over ...
2
votes
2answers
857 views

SQL Joins Order of Operations

I'm new to SQL but happen to be dealing with a couple of rather larger table (on the order of a billion rows each). I want to do an inner join like the following: SELECT * FROM XTABLE X INNER ...
3
votes
1answer
6k views

Mysql master-master replication auto flush old logs

I have mysql-5.1.41 master-master setup running on ubuntu machines and below is the configuration of a master: skip-host-cache skip-name-resolve event_scheduler = ON max_connections = 500 ...
8
votes
1answer
6k views

Is it possible to change ENUM() lists?

I wasn't sure if changing ENUM() list isn't possible so I made a test. In MySQL v5.1.58 I made a test InnoDB table that contains one field called 'bool' of type ENUM('yes', 'no'). Then I executed... ...
7
votes
5answers
15k views

PL/SQL: best way to count elements in an array?

Given this: DECLARE TYPE T_ARRAY IS TABLE OF VARCHAR2(2000) INDEX BY BINARY_INTEGER; MY_ARRAY T_ARRAY; V_COUNT INTEGER; I would like to do: BEGIN -- ... some code filling the MY_ARRAY ...
10
votes
2answers
3k views

Do SQL Server Express Editions support CLR procedures?

Do SQL Server Express Editions (2005, and 2008) have support for installing, enabling and running CLR Stored procedures and functions.
3
votes
1answer
2k views

Found important issue with SQL Server 2008 R2. Need Advice

Recently while installing my copy of SQL Server 2008 R2; the power went OFF. So now it does say the some features are installed and some are not but when I run SQL server detection manager it says ...
1
vote
2answers
9k views

Select multiple rows from one row based on column values

I have a product table where the value of two columns can imply either one or two actual product results. If column X = 1 AND Y = 0 return one result, if X = 0 and Y = 1 return one result, if X = 1 ...
2
votes
3answers
302 views

What affects the speed of a count(*) besides the number of records

I have a query like SELECT COUNT(*) FROM Foo Where Bar = 1 AND Baz = 2 the table has 12934600 records of which 1000001 match that predicate Looking at the query statistics I see (1 row(s) ...
0
votes
1answer
1k views

SQL Server 2008 R2 SQL Server Profiler and “exec sp_reset_connection”

Yesterday i ran the "SQL Server Profiler" tool and outputted the data to a table, now when i look in it i find many "exec sp_reset_connection" rows and thats expected with our data access layer! But ...
5
votes
2answers
2k views

Query execution showing error as login failed

I want to retrive the table values from other server Query EXEC sp_addlinkedserver @server = 'OPSERVER', @srvproduct = 'SQL Server' EXEC sp_addlinkedsrvlogin @rmtsrvname = 'OPSERVER', @rmtuser = ...
2
votes
1answer
2k views

SQL Server 2008 R2 sys.dm_exec_sql_text question

If i run the following query on our production server: SELECT DISTINCT TOP 10 t.TEXT QueryName, s.execution_count AS ExecutionCount, s.max_elapsed_time / 100000 AS MaxElapsedTime, ...
2
votes
3answers
15k views

Exporting table records to an INSERT script

I'm setting up a test environment for development and need to export some static data from tables in Production. Ideally the exported product would take the form of a script with all the required ...
7
votes
3answers
283 views

Using Replication for Scale-Out

Having read Using Replication for Scale-Out, how can I route different queries to different servers, for example, SELECTI want to route to slaves and NON-SELECT to master. I assume as loadbalancer I ...
2
votes
2answers
2k views

Update column by comparing date and string values together

I have problem in updating table. I need to update table by comparing date and name with another table. I have two tables: table 1 : dim_sesid name(varchar) role ...
1
vote
1answer
1k views

Looking for a tool to convert between MySql, Sql Server CE, Sql Server and SQLite [closed]

Our old product supports 4 different database types for storing data: SQLite MySql Sql Server CE Sql Server There is also an export feature, which allows to export some data and here is the ...
0
votes
2answers
2k views

Oracle 11g setting for backwards compatibility? [closed]

Edit: Please close this topic. Unfortunately, this issue can't be resolved as it turned out the question is very off-base to begin with. The actual issue was completely unrelated to the question I ...
1
vote
2answers
131 views

Improving MySQL efficiency

I have a table now containing over 43 million records. To execute SELECT, I usually select records with the same field, say A. Will it be more efficient to divide the table into several tables by ...
2
votes
2answers
2k views

Can I add “Included Columns” to an index without affecting performance?

I have a non-clustered index with 63 Million leaf level rows. Currently it does not have any included columns. I would like to add one included column while the site is online. Will this significantly ...
1
vote
1answer
466 views

Can a maintenance workload after a SQL Server reboot cause SQL outage or issue when application load resumes?

Configuration: Hardware: HP ProLiant DL980 G7 CPU: 4 Xeon X6550 @ 2.00GHz Memory: 393,206 MB SQL Version/Ed, OS: SQL Server 2008 Enterprise Ed (SP1) - 10.0.2757.0 (X64) Windows: Microsoft ...
0
votes
1answer
2k views

PostgreSQL Query and/or Session CPU Usage

Is there any way in PostgreSQL to know how much the cpu cost was per a query and/or by session. It doesn't have to be the exact system cpu usage more of a relative cost like we get with disk I/O. For ...
1
vote
1answer
562 views

Implementing Pub/Sub initiated from the database

I have a number of state-full Windows Services that currently poll the database looking for new or changed records in specific Tables and/or Views. For obvious reasons this limits scalability and is ...
0
votes
2answers
206 views

MOM and EOM in SQL Server 2005

What is the most sample and practical way to know the MOM (middle of month) and EOM (end of month) in an store procedure on SQL Server 2005? (without doing a select case / switch) EOM is the last day ...
6
votes
2answers
5k views

What is the difference between ALTER INDEX and DBCC DBREINDEX?

Is the only difference between ALTER INDEX [index_name] on [object_name] REBUILD with (ONLINE=OFF, FILLFACTOR=90) and DBCC DBREINDEX([dbname], 90) just that the DBCC command will reindex all ...
-1
votes
2answers
1k views

How database users see their objects in sql server

I have a large SQL Server 2008 database that has many tables, stored procedures, and functions. This database also has several users. How can I make it so that each user, after connecting to the ...
2
votes
3answers
4k views

Easy or Schedulable way to move data from Production to Test

What I am looking to do, is schedule a copy of data from my production database to my dev/test database. The dev/test database will be newer than the production database in terms of schema, but the ...
8
votes
3answers
22k views

How do I find my current SCN?

Given any version of Oracle: How do I find my current SCN? What is the maximum possible SCN?
4
votes
1answer
206 views

Filtered index statistics refresh threshold

We have filtered indexes in our production environment. While doing some research about them, I came across this article "Filtered indexes and filtered stats might become seriously out-of-date" ...
4
votes
1answer
642 views

2NF and 3NF How to do it

Given E(ABCDE) ABC are candidate keys Normalize into 2NF and 3NF As far as 2NF is concerned the solution is quite easy: E1(BD), E2(DE), E3(ABC) But with regard to 3NF I think I'm wrong if I say ...
3
votes
1answer
465 views

Online Re-Indexing In SQL Server 2005/2008 Standard

The Story: Once a week, we run a special Maintenance Plan that involves re-indexing 2 critical tables that have ~6 Million records between the two of them. We use SQL Server 2005 Standard Edition. ...
3
votes
1answer
92 views

PostgreSQL + query planner + amount of entities

I'm working on college work about how query planner uses statistics and makes the most optimal query. I have read the 57.1. Row Estimation Examples article and I know how's the PostgreSQL calculates ...
16
votes
2answers
18k views

What is the recommended way to backup a MySQL/Amazon RDS database to S3?

I have two purposes for this: To have an offsite backup in case of a region wide problem with Amazon Web Services. To copy production data from a production billing account to a beta billing ...
3
votes
1answer
7k views

MySql - ERROR 1071 Specified key was too long; max key length is 1000 bytes while restoring dump

while trying to restore a MySql Dump, i get the following error: ERROR 1071 (42000) at line 25: Specified key was too long; max key length is 1000 bytes any ideas?
2
votes
1answer
451 views

Is staggering reindexing jobs a good strategy?

I have inherited a server with 35 databases and a job that reindexes all tables on all databases (using sp_MSForEachTable). It's taking over 14 hours to complete and is now blocking other processes. ...
1
vote
1answer
273 views

How to execute some script when database starts up

I want to execute some T-sql code, when a database starts up. the objective is to resume a session of mirroring in case the session is "suspended" when the database comes "back to life". So I've ...
2
votes
1answer
646 views

high 'total_worker_time' for stored proc using OPENQUERY in SQL Server 2005

I have a stored procedure in SQL Server 2005 (SP2) which contains a single query like the following (simplified for clarity) SELECT * FROM OPENQUERY(MYODBC, 'SELECT * FROM MyTable WHERE Option = ...
2
votes
4answers
4k views

Cannot connect to MS SQL 2008 R2 by DBVisualizer. “Native SSPI library not loaded” error

I try to connect to MS SQL 2008R2 database by DBVisualizer. I use jTDS driver, but following error occurs An error occurred while establishing the connection: Long Message: I/O Error: SSO Failed: ...
2
votes
1answer
733 views

Reducing sort time for querying aspnet_users table in Sql Server

I've recently taken over software development for a small company. My mandate includes managing our SQL stuff, which is something I don't really know much about, and I don't think the guy before me ...
1
vote
1answer
1k views

How do you monitor specific SQL statement of a specific user ?

We have a few standalone users here which cause high server loads for several 11.1.0.7 Oracle's. I spoke with them a few times but it seems that their queries are causing high loads and probably ...
3
votes
1answer
370 views

Is there a generic framework/design pattern/library for real time replication of MySQL database onto other servers?

Summary I need to backup in real time updates/inserts to a MySQL database. Cron/batch jobs appear to be unsuitable for this particular requirement due to the time interval meaning that the data would ...
1
vote
2answers
385 views

Is it good practice to assign a system account for database owner?

I can see the owners of my databases usign this query SELECT name , SUSER_SNAME(owner_sid) FROM sys.databases What are the things I should consider when choosing an account for database ...

15 30 50 per page