0
votes
0answers
12 views

Truncate log file mirrored database [duplicate]

In SQL Server 2008, I have a mirrored database with a log file that has increased to 80GB, which is not normal and I have serious problem. I would like to decrease the log file size by truncating it. ...
2
votes
1answer
512 views

Exclusively access a table and prevent other queries, even read queries

I'm stuck at setting transaction isolation level. Here's my scenario that happens in the application: Get unprocessed messages (using the IsProcessing flag) Set their IsProcessing to true (in RAM) ...
1
vote
0answers
128 views

SQL Server losts and shows error 26 after random time

I have a Windows Server 2012 as server, which have SQL Server 2008 R2 where our database is stored. We have another 5 PC's installed with Windows 7 64-bit, which are run under domain of above server, ...
1
vote
2answers
1k views

the cache hit rate using pg_statio_user_tables

I read from this blog that a small 20% of the data in your database is getting the vast 80% of reads. That means a small portion of the data in the database is frequented. Hence, you want to ensure ...
1
vote
1answer
190 views

SQL Server 2008 R2 Express Connection

I installed SQL Server 2008 R2 Express Edition. I opened the command prompt and typed sqlcmd -S server1\SQLExpress -U SqlUserAccount -P SqlPassword to connect to SQL Server. However, it ...
0
votes
1answer
1k views

TSQL Copy an existing database

I am learning how to administrate MS Sql server 2012, come cross a question and its suggested solution for copying an existing database for different name. Administer a windows azure sql database ...
0
votes
1answer
81 views

Getting Skewed Results from LEFT OUTER JOIN with 3 TABLES

I have 3 tables, users (user info), mghours (volunteer time), mgtraining (training time). I want a result that lists some user columns, sum of volunteer hours and sum of two types of training: uid ...
3
votes
3answers
466 views

How to prevent a PostgreSQL trigger from being fired by another trigger?

I have 2 triggers on one table; one works for INSERTs : CREATE TRIGGER "get_user_name" AFTER INSERT ON "field_data" FOR EACH ROW EXECUTE PROCEDURE "add_info"(); This updates some values in the ...
1
vote
1answer
237 views

Referral table structure

I need to make a simple referral system and I have a database table set out as follows: mem_id | date | refer_email | accepted And the meaning of such columns is the following: mem_id: The ...
0
votes
0answers
35 views

How mysql order data without order by clause? [duplicate]

Is there any way to order data without order by clause in MYSQL? select * from table table name order by col1 asc.
2
votes
1answer
457 views

Modify LISTAGG query for 10g

below mentioned code for cursor works only in Oracle 11g, as LISTAGG() function introduced starting version 11g. I need to adapt this code for Oracle 10g. Any help would be appreciated. SELECT ...
0
votes
0answers
284 views

How to find cause of SQL-Server Full-Text Index Auto-Population Error?

I have recently added a few full text indices to a database and AUTO populating is not working as I would have expected. Sample Table Definition CREATE TABLE [wrk].[WorkOrder] ( [id] ...
2
votes
1answer
429 views

Have foreign key constraint and index key for the same column(s)

I am creating a composite index key for 2 columns and then adding foreign keys to its appropriate table. Do I need to create a multiple index key reference and then create separate foreign keys? My ...
1
vote
1answer
93 views

MySQL Crashing every few days

Our website hasn't launched yet so we're gaining little to no traffic at the moment. For some strange reason MySQL seems to crash every 2-3 days unexpectedly. Here's the SQL log of the crash 2015-06-...
0
votes
2answers
123 views

Query syntax is checked at java level or Database Level?

If i used normal JDBC Connection for accessing database of Mysql, The syntax of query is checked at java level or Mysql level. Example String Query="Select * fromEMP" above wrong query syntax throw ...
0
votes
0answers
40 views

Get last updated date and group by in mysql

trans_id | item_id | price | last_updated 01 |001 | 100 | 2015-01-01 02 |002 | 200 | 2015-01-02 03 |001 | 150 | 2015-01-03 03 |003 | 200 | 2015-01-...
0
votes
2answers
35 views

MySQL security group view permission query

I have a table of records that are only viewable by users with the correct group permission. The records may be viewable by multiple groups. Users may also be in multiple groups. record +----+-------...
1
vote
1answer
31 views

Completely removing InnoDb tables

To cut a long story short, I deleted several .idb files and then tried to re-import them from a .sql file. I'd imagine there is some relic of the old tables somewhere. Does anyone know what to remove ...
1
vote
2answers
318 views

How to prevent a trigger from running on certain statements?

I'm looking for an answer that satisfies my need on both SQL Server and MySQL. I have a small, custom audit table that I will be writing to through triggers on various tables. There are situations ...
1
vote
0answers
135 views

BDR Replication issue

I am trying to setup 2-node BDR replication and i am getting the following error while running bdr_init_copy. /usr/pgsql-9.4/bin/bdr_init_copy -d "host=10.10.145.111 dbname=apimgtdb port=5432" -...
1
vote
3answers
528 views

Are TEXT fields stored separately from the row in MySQL-ISAM?

We have a "notes" table and some of the queries are getting very slow even though we're not searching on the note contents. We're wondering if moving the note content into a separate table would speed ...
1
vote
1answer
347 views

TempDB Autogrowth - Does SQL need a restart?

I have a case where i'm running into an issue with the tempdb not being large enough. Here is my error: Could not allocate a new page for database 'TEMPDB' because of insufficient disk space in ...
2
votes
1answer
91 views

Why do database servers have different time_source values

I have two SQL 2008 R2 Enterprise SP1 servers that have different values for sys.dm_os_sys_info.time_source. The time_source column of sys.dm_os_sys_info indicates the API that SQL Server is using to ...
2
votes
1answer
135 views

Controlling how tempdb activity is split across drives (tempdb on both solid state and spinning drives)

I'm seeing the following tempdb I/O behavior over a one hour period: There is a fair amount of disk I/O generated by multiple DW workloads executing on the machine, some of which cannot fit in the ~...
0
votes
1answer
320 views

Cannot rename database (the user in --username is the owner)

I connect with psql and list my databases: List of databases Name | Owner | Encoding | Collate | Ctype | Access ...
1
vote
1answer
173 views

MySQL Database Keeps Crashing

Our mysql instance is keep crashing after every 5-10 minutes very frequently. We have around 600 databases on that instance. I think 600 is not a big number of databases given the size of databases ...
0
votes
0answers
30 views

2012 Always on (AG only) Where should the Windows Cluster SIT?

2012 Always On and the Windows Cluster, shouldn't the Windows Cluster be on a separate server like the Domain controller/BackupDomainController? With Windows clustering Services on each node ...
0
votes
0answers
22 views

Login synchronization in 2012 AlwaysOn

I have a rather unique situation (or so it seems since there isn't anything I've found on the web about this). I have an AlwaysOn Availability Group configured without HA Failover, to an asynchronous ...
0
votes
1answer
38 views

Using * to enforce the need to update both tables together

I am a Java Programmer and definitely NOT a DBA. I am just an "accidental helper" to a DBA as we try to troubleshot an inherited VB.NET application situation. The guy that wrote this MS SQL got fired ...
1
vote
1answer
1k views

Dimensional Modeling and ETL in Redshift

I have been researching Amazon's Redshift database as a possible future replacement for our data warehouse. My experience has always been in using dimensional modeling and Ralph Kimball's methods, so ...
1
vote
1answer
213 views

Optimize slave .ibd tables, where slave has innodb_file_per_table and master does not

We are trying to reclaim file space on our replication server. The space we want to reduce are .ibd files on the slave. We have a simple Master -> Slave (read only) replication setup, for some reason, ...
5
votes
4answers
516 views

How to uniquely identify SQL instance

I need to find a way how to identify SQL Instance no matter what changes were done to SQL Server and\or Windows Server where it is running, because we're collecting remotely information about ...
0
votes
1answer
857 views

The statement has been terminated

I have a table for which a update stored procedure has been created. For this table I created an update trigger. But when I either execute the stored procedure or execute an update query I am getting ...
2
votes
3answers
172 views

LEFT OUTER JOIN-ing the same table, grouping, summing and finding 0 or NULL

I have a table where I record searches performed on my site, tbl_search. An id is automatically assigned to entries. If the searched phrase is more than one word, my system splits the words and ...
2
votes
1answer
74 views

Insert into a DB that was selected via other DB?

I have a table that stores what database should I use for a given device( specified by its IMEI), like this: imeiDB( IMEI VARCHAR(15), db VARCHAR(100)); Let's say I have the database device1(IMEI:...
1
vote
1answer
2k views

Permanent count of waiting tasks (2) in Activity monitor

Now I'm observing in Activity Monitor permanent count of waiting tasks: and at "Resource waits" tab I see next: so, my question is: How to find and resolve this wait tasks? I suspect that it ...
0
votes
0answers
98 views

Reduce SORT overhead / Improve order by performance

My business works like this: The client downloads the data from this table which contains roughly 33 millions rows holding one week worth of data (which is then moved to a historic table). The client ...
0
votes
1answer
40 views

Postgres - returning custom values ie. “true” rather than “t”

I am wondering if there is a way to show custom "values" in the output of a query purely for readability, similar to the AS statement for renaming column labels. Seems unlikely but would be useful ...
3
votes
1answer
735 views

Intellisense is not working since upgrade to SQL Server 2014

We recently upgraded our production server to SQL Server 2014. This server hosts ~2200 databases. When I connect to it as sa with SQL Server Management Studio 2014 and I type queries, Intellisense ...
0
votes
0answers
22 views

Mysql database name

My Mysql version is Server version: 5.6.19-0ubuntu0.14.04.1 (Ubuntu) I have two databases, with a test table in each database. I can run the following select statement in one db, but not the other. ...
0
votes
1answer
42 views

Feasibility of Automated and Continuous Performance Tuning in the future [closed]

First a quick background: I'm a software developer, not a DBA and have been developing for more than 10 years. Recently I had to optimize a stored procedure and had to run execution plans, create/...
0
votes
3answers
709 views

How can we get the table and the column name of known data value?

I have a value (like 'IT department'), based on this I want to get the table and column name in which this value exists/present.
0
votes
1answer
838 views

How to create scheduler for manually refresh Materialized View if the MV get need_compile stallness status

I've a problem to Automatically Refresh Materialized View, if the stallness condition is NEED_COMPILE / STALE / UNUSABLE OR NOT FRESH. I've MV with this PL/SQL : CREATE MATERIALIZED VIEW "...
0
votes
1answer
104 views

How can we drop a constraint without losing the automatically created index?

How can we drop a constraint without losing the automatically created index? If it's possible using a single query.
6
votes
1answer
170 views

Disk I/O and PAGEIOLATCH_XX

We have been having CPU issues with one of our servers lately and while we have been looking into this we have also noticed queries running slowly with waits of PAGEIOLATCH_XX. In particular, a ...
0
votes
1answer
161 views

Do I need to rebuild indexes when upgrading a DB from 2008 to 2012?

I can't find anything on BOL that indicates I need to rebuild indexes or statistics after the migration and compatibility level upgrade of a database. But I have read a few articles/answers around the ...
0
votes
1answer
73 views

Are there any risks on using 'single-transaction' and 'extended-insert' on mysqldump?

I'm new in db administration and I've looked for a faster import of a mysqldump. I had a db with about 1.1 million rows and mostly InnoDB tables and wanted this to import on a managed server. Before ...
1
vote
1answer
86 views

Fast query for value between 2 fields

I'm asking something very similar to this question. In the two options provided, one is SELECT * FROM your_table WHERE 1265631252 BETWEEN `IP FROM` AND `IP TO`; which another poster said is slower ...
2
votes
1answer
224 views

Is it ok to increase `innodb_stats_sample_pages` up to large number?

MySQL sometimes generates bad execution plan irregularly. 2 years ago, I have increased innodb_stats_sample_pages(default:8) up to 64 and recently changed into 128 because Data Volume has been ...
0
votes
2answers
1k views

How to grant access permision for multiple database and multiple tables to a user in MySQL?

I have two databases WORLD,TEST each one contain 3 Tables.I also created a new User test_grant now i want to give SELECT,DELETE,UPDATE permission to test_grant user.But here i want to give two tables ...

15 30 50 per page