1
vote
0answers
429 views

SQL Error 3183 on SQL Server 2012

I have a backup of database version SQL Server 2008 R2. While restoring it to SQL Server 2012 I am getting error: msg 3183 RESTORE detected an error on page (6100:1886858449) in database ... . ...
2
votes
0answers
201 views

plan_generation_num keeps incrementing, why?

I have a query that is executed using sp_executesql code is as follows DECLARE @rsk NVARCHAR(1) = '1', @ppCityID NVARCHAR(3); SET @ppCityID = CAST(@cityID AS NVARCHAR(3)); exec sp_executesql ...
0
votes
1answer
89 views

SQL - Referential integrity

seems like my problem pretty much describes GC (Garbage Collector) but I don't want to make a procedure to run every X time. so this is my question: I have three tables or more, refer to those as ...
0
votes
1answer
114 views

How to check how the table structure effects the performance of my query

I want to check how the table structure of a certain table effects the performance of a delete query. This is not a generalised question, I have a table, with currently 2.2 million records ...
6
votes
3answers
3k views

Creating a read only replica of SQL Server database for reports

I've faced a problem when my .Net web application is running slow, even when I've optimized all queries. As it turned out another developer, who is making reports runs a bunch of non optimized queries ...
2
votes
2answers
417 views

Oracle upgrade, v$version what is it actually doing?

There are 42 threads tagged as oracle8i, none of them answer my question... This is Oracle 8i (8.1.5.0.0) SQL> select * from v$version; BANNER ...
2
votes
1answer
713 views

Recover corrupted blocks in Oracle 10g XE

I am using Oracle 10g XE. I've noticed corrupted block error in datafile 1 in alert log. As I've found Oracle XE doesn't support Block Media Recovery(needs to be Enterprise Edition). So I did the ...
0
votes
2answers
3k views

ORA-00338: log # of thread # is more recent than control file

We are facing the following error on our production database: ORA-00338: log # of thread # is more recent than control file The database crashed and there was no recovery action. What could I ...
0
votes
2answers
5k views

How to unlock a table in IBM DB2 Data Studio 3.1?

I know the process to unlock a table through IBM DB2 Control Center using activity monitor, but I am completely new to IBM DB2 Data Studio 3.1 Administrative Tool. Whenever i am right clicking on that ...
1
vote
2answers
2k views

Why can I select multiple columns from dual?

When I execute this query: select 2+2, 2+2, 2+2 from dual; I get multiple columns but, as per definition, dual only has one row and one column. So what is the reason behind it?
5
votes
2answers
3k views

Postgres log files not rotating

I have a postgres system with a hot standby server. They use the same config file. I've setup the log rotation to use log_rotation_size and log_rotation_age so that the master server is rotated every ...
10
votes
4answers
31k views

Is there a way to generate table create script in TSQL?

Is there a way to generate a create script from an existing table purely in T-SQL (that is without using SMO, since T-SQL does not have access to SMO). Let's say a stored procedure that receives a ...
2
votes
0answers
561 views

Postgres: PANIC: WAL contains references to invalid pages

I have a slave database that is being replicated from a Master DB. All of a sudden, my slave DB just exited and wasn't able to restart. Here are the error messages when it exits. Similar ones appear ...
2
votes
1answer
11k views

How to transfer the ownership of the dbo schema in SQL Server 2012

I've accidentally given a user the ownership of the db_owner schema (using the check box in the UI as below) and now I cannot: Transfer ownership to another user Drop the user from DB (though I can ...
2
votes
1answer
68 views

Can SQL Server WebAdmin degrade the performance of my site?

Once upon a time a had to use the Parallels WebAdmin interface. After contacting the support team that hosts my website and informing them that I must use the Webadmin, they informed me that: MS ...
2
votes
3answers
1k views

Getting the top count of records from a table for each month and user

I have a table where translations are stored along with the user_id and when the translation was added. I want to create a query that shows the 'Translator of the month' (the person who did the most ...
2
votes
1answer
25k views

How to extract the last inserted row in SQL Server?

When an insert statement is executed one or more rows is inserted into the table, is there any way to extract the last inserted row in SQL Server?
4
votes
3answers
1k views

Why is SQL Server 2012 Recommending This Index Be Created?

I have the following query: Select SubId, Max(ReadTimeLocal) From dbo.PanelWorkflow Where ProcessNumber IN ...
1
vote
0answers
21 views

Why is SQL Server Recommending I Create this Index? [duplicate]

I have the following query: Select SubId, Max(ReadTimeLocal) From dbo.PanelWorkflow Where ProcessNumber IN ...
1
vote
1answer
60 views

Creating an index on table A but with reference to table B

Our company uses a 3rd party application for numerous aspects of the business. One aspect is dealing with customer payments and when selecting a window within the app to list all the payments ever ...
0
votes
1answer
79 views

Are databases only growing in size?

Databases use the file system to store the data. As far as I know it is not possible to delete a record from a random access file. So does that mean that when we do a DELETE FROM TABLE the size of the ...
1
vote
0answers
727 views

SQL Server: Batch Requests/sec showed increase in performance, but performance actually decreased

We are currently on SQL Server 2005, with a plan to move to SQL 2012. To make this move we have to test new database drivers for the application (Java). We performed 2 load tests using the 2 different ...
1
vote
1answer
84 views

Mount mdf file to sql server desktop edition

I'm trying to attach a .mdf file to a SQL Server Desktop Edition. After reading this I connected to the database using the osql -E -S servername\instancename command. I tried to attach the ...
4
votes
2answers
146 views

Update old database with SQL dump

I had to recover a database with a some months old full backup. I have however in my possession a most recent but unfortunately incomplete SQL dump for this same database done with mysqldump. Is ...
0
votes
1answer
1k views

Oracle 11g install problem on Ubuntu

I ran the runInstaller script in the root dir of the extracted zip files. After some pages of the graphical installer it sent me to run /tmp/CVU_11.2.0.1.0_macbook/runfixup.sh as root. It gave me ...
5
votes
1answer
11k views

Why aren't unsigned integer types available in the top database platforms?

Databases are usually very customizable with varying data types and custom lengths. It surprises me, as I try to look for the syntax to use unsigned int types that they are not available from neither ...
1
vote
1answer
414 views

Cannot grant execute to stored procedure [closed]

When I try to GRANT EXECUTE ON SP_NAME TO [DOMAIN\USER_NAME] on my database, I'm getting the error message below: Msg 8115, Level 16, State 1, Procedure grant_safety, Line 5 Arithmetic overflow error ...
3
votes
2answers
715 views

Make MySQL server terminate when shell exits or on ctrl-c

If I run mysqld, ie invoke it directly on the command-line, it survives the shell being closed or hitting ctrl-c. Is there any way to run it "interactively", ie so that it will shut down if either of ...
3
votes
1answer
5k views

Are there other ways to select a dynamic list of columns?

I need to let my users specify the list of columns they want to select. So far I know two ways of accomplishing that. 1. Using refcursors CREATE OR REPLACE FUNCTION selecttestwithcolumnlist( ticker ...
0
votes
1answer
91 views

Namespacing database names on my server in order to test multiple different SSIS packages

An SSIS package that I'm building has two OLE DB connections, to databases named "core" and "staging". I created test versions of these two databases on my local SQL Server installation. I named them ...
4
votes
2answers
2k views

sqlpackage.exe ignoring BlockOnPossibleDataLoss?

I have a dacpac that has set the BlockOnPossibleDataLoss set to false, however the deployment is blocked when I run it with sqlpackage.exe, telling me "The column [a] is being dropped, data loss could ...
0
votes
0answers
44 views

MySql Report Using CASE THEN WHEN

I am getting a syntax error on the code below. I wish to substitute the report text for each column clarifying the its meaning. SELECT CONCAT(LastName, ', ', FirstName) AS "System Administrator", ...
4
votes
1answer
502 views

Stored procedure deadlocking itself

I have a strange situation, seen from the log: Process 37278 waits for ExclusiveLock on advisory lock [16421,999999,12864385,2]; blocked by process 53807. Process 53807 waits for ExclusiveLock on ...
1
vote
2answers
1k views

Metric to standard unit conversion in SQL Server

I am giving simplified version of my two table which are as follow. tblRecords ID unit val --- --- --- 1 KV 3 1 BAR 4 2 KV 7 2 KG 5 3 C 37 tblUnit unit ...
2
votes
2answers
2k views

T-SQL - How to filter data from table

I'm new in DB world, so if you can help me it would be great. My problem: I have filtered some data and got a table with data, but need to filter them again. Picture might help you. For me, it is ...
1
vote
1answer
478 views

SQL Server 2008-R2/2012 with Failover Cluster - minimizing downtime of program updates

I have SQL Server 2008-R2 with Failover Cluster like this. Planning to upgrade to SQL Server 2012. Problem - The downtime of my program updates (not Microsoft updates/patches). Both of my cluster ...
2
votes
1answer
289 views

Logging errors with extended events excluding some users

I use extended events to store database errors, like this: CREATE EVENT SESSION [ErrorCapture] ON SERVER ADD EVENT sqlserver.error_reported ( ACTION ( sqlserver.client_hostname, ...
0
votes
2answers
562 views

Queries hang when accessing Oracle via ODBC and Python

I have Python scripts running on a Windows 2003 server that access an Oracle 11g database in the US via VPN. I am in the UK. We have recently moved offices and upgraded our broadband speed. Some of ...
0
votes
1answer
54 views

What all to start for oracle database server

I am a Db guy familiar with Postgresql and Mysql. I have just started with Oracle and I have installed oracle 11g R2 on a RHEL-6 server. The installation was successful (the runInstaller script). ...
2
votes
2answers
415 views

How to establish a Two-to-One table relationship (PK-FK-CK)?

My question is about DB design and its principles. I am working on a Python application where objects are mapped to database tables. I have Projects and People objects, mapped to their respective ...
4
votes
2answers
13k views

DBCC SHRINKDATABASE TRUNCATEONLY 2008R2 vs 2012

Im a bit confused was the TRUNCATEONLY parameter changed in 2012 or is the documentation wrong in 2008R2? 2008R2 Releases all free space at the end of the file to the operating system but does ...
-1
votes
2answers
109 views

Create Automated Indexing for huge SQL Server Table [closed]

i have Huge SQL table like 800mil record. it takes about 30gig of disk space without any indexing on it. what is the best method to apply index in it? also this table gets about 50,000 record ...
1
vote
2answers
120 views

Stored Procedure - MySQL

I am developing a database for an application. I have to create stored procedure to tables, so that programmers can simply call the stored procedure to implement the functions. I have a doubt to ...
0
votes
0answers
444 views

Oracle Installation issue on Oracle Linux 6.4

I am trying to install Oracle 11g(11.2.0.1.0) on Oracle Linux 6.4(Remote Server). I get the following error(s) when Database Configuration Assistant is running ORA-01092: ORACLE instance terminated ...
1
vote
1answer
353 views

Starting up sql server after hard-drive recovery

So I'm in a bit of a pickle. My primary work computer has recently crashed and some of the windows files were corrupted I tried repairing but did not work. This computer was running a program that ...
2
votes
2answers
9k views

How to read “CPU (ms/sec)” in the “Recent Expensive Queries” of Activity Monitor?

Is CPU (ms/sec) the cpu time in ms in previous second? If it reaches 1000, does it means that it uses 100% CPU? However, on my 8 cores server, the % Processor Time is usually very low like several ...
2
votes
2answers
725 views

Creating a partition on my soft-delete indicator column

In SQL Server 2008 R2 I am exploring the use of partitioning tables. We have a soft-delete scheme which is sometimes an IsDeleted bit NOT NULL and sometimes a DateDeleted date NULL I want to focus ...
1
vote
1answer
594 views

how do I check the last time dbreindex or an index defrag was executed

Is there a quick tsql I can use to check when was the last time a dbreindex, index defrag and update stats was executed on the database? Appreciate everyone's quick response.
0
votes
1answer
790 views

Update the host field in Grant privileges in mysql

I have an existing table and I want to update host part in privileges using Grant command mysql> show grants -> ; ...
-1
votes
2answers
563 views

Insert into an empty table with or without clustered primary key? [closed]

I will need to insert some rows in an empty temp table. The table has PK of (month date, id char(10)). The source table is partitioned by month. Which of the following is faster? 1a) the target table ...

15 30 50 per page