1
vote
1answer
4k views

Can I delete SQL Server 2008 R2 “audittrace” (.trc) files

This is precaution question :) When I was configuring SQL Server 2008 R2 database engine, I checked "Enable C2 audits" which I don't really need. From that time it created a lot of files like ...
0
votes
1answer
57 views

Mapping and Inserting Values into a Specialized table

For a system i'm designing,i have one parent entity,Computer Computer(computer_id,computer_processor,computer_hddrive,computer_memory); A computer can be of two types,Desktop and Laptop,each having ...
1
vote
2answers
908 views

How can I return column names in dot notation in MySQL?

I want to return column names into a table. But I also want to avoid redundancies like 'id' and 'id'. I did: INSERT INTO columns(name) SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE ...
1
vote
2answers
710 views

How to create root user after running mysql_install_db?

I'm installing MySQL on ubuntu and I changed the data directory. I created new data files using mysql_install_db command. So now I need to access my database using root but it won't let me in. I ...
16
votes
1answer
24k views

Upgrade SQL Server 2000 database to 2008 R2 and enable new features

I have recently upgraded SQL Server 2000 database to 2008 R2. What I did was: Shutdown SQL Server 2000 (express) service on old machine, Move datafiles (mydatabase.mdf and mydatabase.ldf) to new ...
0
votes
1answer
656 views

Column 'Comments.Text' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause

They have explained the root of the problem very well and even advised to use max aggregate as a solution. But, lets take the example group_id item_id comment -------------------------------- ...
1
vote
1answer
5k views

Nested with - Incorrect syntax near the keyword 'WITH'

With inside with This is ok WITH CS AS ( SELECT 'ab' as a ) SELECT * from cs http://data.stackexchange.com/mathematics/revision/138658/170321/comment-partition-by-question ...
0
votes
1answer
2k views

AdventureWorks2012: “The FILE SIZE property is incorrect” error while trying to attach sample database “Adventure Works for SQL Server 2012”

I am trying to attach the sample databases, for example, AdventureWorks2012_Data.mdf from codeplex "Adventure Works for SQL Server 2012" into a MS SQL Server 2012 (default) instances on a a virtual ...
0
votes
1answer
186 views

Multiple filters with joins

I just read this qestion: SQL Multiple Filter - Optimal Way I tried this with Northwind. I filter like this: declare @supplier int = 1 declare @category int = 1 select * from products p WHERE (@...
2
votes
0answers
177 views

How to give permissions to 90+ SQL Servers without tweaking in each of them?

There are over 90+ MS SQL Servers (SQL Server 2005, 2008 and 2012). All in the same Windows domain (but physically all over the world). How to give a domain user (administrative, or other) access/...
0
votes
1answer
130 views

How to reduce table duplication, while ensuring integrity of the database?

For example, in my app I have some class called Contact: case class Contact(name: String, email: String, phone: String) And several other classes have one-to-many relation to that contact (for ...
4
votes
1answer
4k views

How can I find and clean up unused database files?

How can I find and clean up unused (i.e. not used by any attached database) SQL Server database files (.mdf, .ldf, .ndf) that take up extra space on my server?
3
votes
1answer
2k views

query cache hit value is not changing in my database

The query cache hit value is not changing in my database only for some queries.If I write select * from drugs_info limit 1000; the query cache hit has changed, but if I execute the following ...
0
votes
2answers
5k views

Custom Auto-Generated Sequences with SQL Server [closed]

I have Employee table with Empolyee ID column EmpID (nvarchar(5)) , and I want to make EmpID's value to 00001 00002 00003 00004 .... .... How can I make Custom Auto-Generated ...
-1
votes
1answer
162 views

How to Recover corrupt SQL Sever database? [duplicate]

I am running Windows 2000 OS and while using my SQL application a message popped-up, can anyone figure it out, the message is like that. Msg 5172, Level 16, State 15, Line 1
2
votes
1answer
2k views

postgresql replication - pg_stat_replication is showing empty columns

I've a postgresql 9.2 streaming replication setup. It appears that the slave is getting the updates from master and is in sync. I've verified it by looking at pg_xlog dir and process list. $ ps aux |...
3
votes
1answer
214 views

Help with Cybernetics SAN Configuration

There are tons of articles out there recommending RAID/ LUN/ drive configurations for SQL Servers, but most leave me still questioning as they usually state "it depends" and for this reason I'd like ...
3
votes
1answer
2k views

Should snapshot agent continue to run in transactional replication?

We have transactional replication running for a large number of publications on sql server 2008 R2 2 node active/active cluster. I have noticed that the snapshot agent job runs hourly and it looks ...
2
votes
1answer
6k views

Error: Unable to write inside TEMP environment variable path

I am installing PostgreSQL 9.2.4-1-windows.exe on Windows 7 64 with Service Pack 1. I get the following, rather famous it seems, error: There has been an error. Unable to write inside TEMP ...
4
votes
1answer
331 views

filtered index null and > 0 disparity — need explanation

I'm getting behavior in a query plan I cannot explain. The difference is between two filtered indexes I'm testing with. One uses a where id is not null and the other uses where id > 0. In my ...
0
votes
1answer
672 views

SQL Server 2008 Convert String to Datetime question

I have a string column in a table that display data as "CXL P/D 08/15/13" I'm trying to convert this column to datetime, but I can't figure out how to extract only date and change the data type. ...
2
votes
1answer
2k views

How can I find out which tables use reference partitioning from the Oracle data dictionary?

I'm writing a generic drop-all-objects script for our Oracle databases. It generates drop table TABLE_NAME cascade constraints purge lines for all tables, amongst other object types, by looping ...
-1
votes
1answer
40 views

Would This Work? [closed]

This is just a basic script for updating my database from form data. I don't have much experience with databases and this might be a bad question but I have read online that you should use UPDATE ...
2
votes
1answer
1k views

SQL Server 2012 Page Compression - Determine compression ratio?

We're using SQL Server 2012 and have page compression turned on for a number of our larger tables. Is there a way we can determine the compression ratio we're getting? We'd like to be able to ...
1
vote
1answer
3k views

Allow self-referential foreign keys to be null from an alter-table

I am trying to establish a hierarchical relationship between rows in an existing table. There are two fields of interest: a not-nullable primary key field id, and a second nullable field parentId. ...
0
votes
2answers
3k views

how to join table from different database with different Users of database?

I have Two database called. Database1: host: 127.0.0.1 user: root1 pass: root1 dbname: db1 Table 1: Category ID INT(11) Primary Key Name VARCHAR(255) Database2: host: 127.0.0.2 ...
0
votes
2answers
56 views

What should we call a table that stores changes to another table? [closed]

At the moment, we have a Persons Table. But we also need another table to store changes made to that Persons Table. But, my question is, what naming convention is used for tables that store changes ...
3
votes
2answers
17k views

What is difference between primary index, secondary index, unique index and normal index?

I work on Oracle systems where I two type of indices exists in any table: Unique index (Based on any search key which is unique key). Normal index (Index made on any search key which is not ...
1
vote
1answer
165 views

Database Tuning Advisor Index Recommendations

How does DTA make an index recommendation? What is the technology behind that? If we can use same on our side then we can shorten the whole process of Tuning recommendation: creating trace file ...
3
votes
3answers
27k views

How to automatically execute a stored procedure every day at a particular time?

Can you please help me how to execute a stored procedure automatically in SQL database without any transaction in SQL? I want to execute on particular fix time.
2
votes
3answers
580 views

Oracle Equivalent of PostgreSQL CLUSTER

PostgreSQL has the CLUSTER command to group rows physically on disk. By grouping on information where "neighboring" rows (for lack of a better term) are often accessed together, performance improves ...
0
votes
1answer
117 views

What does maintenanceMode -7 mean on a mongo primary?

I've recently promoted a new member to primary of a mongo replicaset. Things seem to be running smoothly for several days and am not seeing any application symptoms of any problems. However peeking ...
0
votes
1answer
381 views

Updating a local table with a per-row count(*) which is an aggregate of inner joins on remote server

I have a table of around 350m rows on a linked server in which I added an additional INT column to serve as a count(external_identification) of records as the result of a join on PACKAGE and DOC2. ...
0
votes
1answer
715 views

Index for ORDER BY on aggregate in MySQL

I'm working with the following query: SELECT *, SUM(entries_count) AS entries_count FROM leads WHERE promo_id IN (1, 2, 3) GROUP BY user_id ORDER BY entries_count DESC LIMIT 25 OFFSET 100; It's ...
3
votes
2answers
1k views

Can I move the undo log outside of ibdata1 in MySQL 5.6 on an existing server?

I've been growing concerned about the large size of ibdata1 that can never shrink even when using file-per-table on innodb Moving the undo log files outside seemed logical but this procedure seems ...
1
vote
1answer
597 views

one node in cluster got crashed ,how to recover it?

we are using percona galera cluster with 3 nodes. In my cluster one node got crashed due to low disk space ,we have cleared some log files and provided sufficient disk space.Now we are trying to start ...
1
vote
1answer
406 views

Paging and grouping using CTE?

Given the following code, from the answer to this question, how can I adapt it for paging? I've read that Common Table Expression is a good way to do paging, but since I implemented CTE to solve a ...
2
votes
2answers
643 views

Dynamic Joining Across Databases

I have a multi-database architecture with a single database for each client and a separate database to handle system-wide data. In this separate database, I have an 'Updates' table where a row is ...
0
votes
1answer
11k views

RegEx with update query my sql

i need to use a mysql update query with regex so my example is update table_name set coulmn_name = replace(coulmn_name, 'regex', ''); i will explain a specified thing i need to do. my column is ...
4
votes
1answer
6k views

Can I reset the ibdata1 and ib_logfile files when innodb_file_per_table is already in place

I am running into an issue where sensitive data was not encrypted properly at the application level of our production system. Even though the guilty records have been removed or corrected, scanning ...
1
vote
0answers
103 views

Displaying SSIS variabe values in Integration Services Dashboard

I have an SSIS package that executes stored procedures which return output parameters into ssis variables. How can I easily display these variables content in the Integration Services Dashboard ? ...
0
votes
1answer
277 views

Partitioning table with billion row

I have a big table referenced by other tables and need to split the table on several parts. I create table by CREATE TABLE product_part0 () INHERITS (product); Move some rows to product_part0 by ...
2
votes
0answers
1k views

Mysql slow writes

i have a strange problem with mysql. My selects goes fast. My insert/create/delete/drop/update go very slow. I have done some tests on 2 machines. My old machine and my new machine. Old is worst ...
4
votes
2answers
215 views

How can I integrate a new system to a design scheme I previously created?

This is a follow-up to a question I wrote a while ago, for reference, you can look it up here. I've developed a curriculum based database scheme that looks like this(Thanks Joel Brown) Now that a ...
2
votes
2answers
544 views

Scheduling duplication of two tables across instances

In my SQL Server 2012 database I have two tables: [tbl_Customers] - about 30 rows [tbl_Users] - about 10,000 rows I need to schedule the two tables above to be copied to a new instance, say every ...
3
votes
1answer
591 views

SQL Server WHERE clause on CLR method (spatial) peformance

I have a query that joins to a table containing 2 million rows and need to filter on its geometry column by its geometry type (using geom.STGeometryType()). The query takes less than a second to run ...
1
vote
0answers
670 views

kerberos authentication in sybase

we are setting up Kerberos authentication in Sybase (linux). DB version is 15.7. We are using Active directory for kerberos. We have done the configuration settings on the DB side and kerberos is ...
3
votes
2answers
2k views

Excessive replication snapshot size causing failure

I am searching for an explanation of a replication snapshot being in excess of 5 times what we're predicting Following a replication failure we are attempting to reinitialise subscriptions with a new ...
2
votes
1answer
83 views

Fixing a MySQL query that miscounts cases where count is 0

I have the following SQL code: SELECT widgets.campaign_name, widgets.enddate, widgets.active, widgets.id_widget,COUNT(*) AS entries FROM widgets LEFT JOIN entries ON widgets.id_widget = ...
-1
votes
1answer
1k views

Importing only one user data from a Dump file

I am using oracle 11gr1 SingleByte Database, I am trying to import a Dump file. but strangely the dump file contains multiple user objects(i.e, Import(IMPDP) is not done properly). example: . . "...

15 30 50 per page