Most Popular
1500 questions
24
votes
3 answers
What's the minimum privilege needed to alter a foreign key constraint?
What's the minimum privilege needed to alter a foreign key constraint?
My migration script stopped working after MySQL 5.5.41 fixed this bug:
InnoDB permitted a foreign key to be created which referenced a parent table for which the user did not…
mtmacdonald
- 421
- 2
- 4
- 6
24
votes
3 answers
Change existing column in PG to auto-incremental primary key
I have a database in Postgresql, which was migrated from SQL Server (only data).
On SQL Server, a table from this database has these columns:
measure_id
datum
measure
where measure_id is auto-incremental primary key, datum is datetime and measure…
zetah
- 345
- 1
- 2
- 5
24
votes
1 answer
Limits of SQLite
How far can one take the sqlite database from a single-user , embedded , prototype oriented db engine ?
mumtaz
- 767
- 1
- 7
- 10
24
votes
3 answers
Find out what queries are causing the biggest amount of network traffic
On a production SQL server I am seeing intermittent enormous spikes in data traffic. Up to 200Mbit/s which is causing NETWORK IO waits which in turn cause query timeouts. How can I find out what queries are returning big result sets?
olle
- 1,027
- 3
- 13
- 23
24
votes
1 answer
Where is SQLCMD.EXE in SQL Server 2014 Express?
Using "SQLCMD.EXE" to back up my SQL Server Express databases for years I just discovered that after installing the 2014 version, I found no SQLCMD.EXE anymore.
In previous versions it was located at
C:\Program Files\Microsoft SQL…
Uwe Keim
- 887
- 2
- 13
- 24
24
votes
1 answer
How do I decompose ctid into page and row numbers?
Each row in a table has a system column ctid of type tid that represents the physical location of the row:
create table t(id serial);
insert into t default values;
insert into t default values;
select ctid
, id
from t;
ctid | id
:---- |…
Jack Douglas
- 39,869
- 15
- 101
- 176
24
votes
7 answers
How to get rid of ORA-28002 message the password will expire within 6 days?
I have a user getting an ORA-28002 indicating that the password will expire within six days. I ran the following:
ALTER PROFILE DEFAULT LIMIT PASSWORD_LIFE_TIME UNLIMITED;
But when I try to log in as the user, the message is still there.…
bernd_k
- 12,211
- 23
- 75
- 111
24
votes
1 answer
Insert with OUTPUT correlated to sub query table
I am modifying the structure of a database. The content of several columns of the table FinancialInstitution has to be transferred into the table Person. FinancialInstitution is linked to Person with a foreign key. Each FinancialInstitution needs…
Yugo Amaryl
- 433
- 2
- 6
- 9
24
votes
3 answers
Get WAL files from AWS RDS PostgreSQL instance
We have a Postgres RDS instance on Amazon Web Services. We have automatic backups enabled, and we take snapshots on a daily basis. We would like to generate a local 'up-to-date' backup of the RDS instance that we can manage ourselves. Running…
jason.zissman
- 343
- 1
- 2
- 6
24
votes
5 answers
Making sense of INNODB buffer pool stats
After having read this page in the mysql documentation, I tried to make sense of our current InnoDB usage. Currently, we allocate 6GB of RAM for the buffer pool. Our database size is about the same. Here's the output from show engine innodb status\G…
Safado
- 469
- 1
- 5
- 17
24
votes
2 answers
Can I create index on a table in a MySQL database while in use
And if I can, any reason (performance/stability) why I shouldn't?
Nifle
- 1,472
- 7
- 17
- 30
24
votes
5 answers
What permissions are necessary for truncating a table?
I have a SQL account with the following permissions on a database:
The db_executor role you see this account being a member of was created by this script:
CREATE ROLE [db_executor] AUTHORIZATION [dbo]
GO
GRANT EXECUTE TO [db_executor]
GO
When I…
Mansfield
- 1,021
- 8
- 16
- 33
24
votes
7 answers
How do I force one record to have a true value for a boolean column, and all others a false value?
I want to enforce that only one record in a table is considered the "default" value for other queries or views that might access that table.
Basically, I want to guarantee that this query will always return exactly one row:
SELECT ID, Zip
FROM…
emaynard
- 343
- 1
- 2
- 4
24
votes
1 answer
When is a Dynamic Port "dynamic"?
I was having a discussion today about Dynamic Ports with one of my co-workers and could use some help clarifying how they work.
First question: If the IPALL TCP Dynmaic Ports setting is a specific number (say 1971) does that signify that you have a…
Kenneth Fisher
- 24,127
- 12
- 61
- 114
24
votes
2 answers
How do you reset the sa password?
I lost the sa password on a machine, and when I log in to the machine directly using an account in the admin group, SQL Server Management Studio will not allow me to log in using Windows authentication.
My plan was to simply log into the server,…
Daniel Williams
- 936
- 4
- 11
- 19