Database Administrators
Q&A for database professionals who wish to improve their database skills
Latest Questions
4
votes
1
answers
642
views
Revision Tracking & Source Control for Azure SQL Data Warehouse
What is a good approaching for tracking incremental changes to database tables, stored procedures, etc for Azure SQL Data Warehouse? I am in the process of moving a large database over to Azure SQL Data Warehouse. The prior approach for change tracking was using a 'Database Project' in Visual Studio...
What is a good approaching for tracking incremental changes to database tables, stored procedures, etc for Azure SQL Data Warehouse?
I am in the process of moving a large database over to Azure SQL Data Warehouse. The prior approach for change tracking was using a 'Database Project' in Visual Studio 2015. This allows easy source control integration with TFS or Git or whatever. When you want to publish, you just target the destination database and it generates a change script.
This functionality does not at all work for Azure SQL Data Warehouse. Visual Studio (and the latest SSDT) simply can't target SQL DW. This means the process of publishing is extremely tedious, entirely manual and extremely error prone.
Is there another comparable approach you are using for this type of project?
John Hargrove
(149 rep)
Oct 20, 2017, 05:10 AM
• Last activity: Apr 10, 2025, 01:08 PM
11
votes
5
answers
11170
views
Are there tools to perform data comparison between two different schemas?
We are migrating our database to a new schema but want to validate the data has been moved correctly. Traditional data comparison tools can compare two databases for differences if the schemas are the same. In our case there have been changes to the table designs but all the data from the old schema...
We are migrating our database to a new schema but want to validate the data has been moved correctly.
Traditional data comparison tools can compare two databases for differences if the schemas are the same. In our case there have been changes to the table designs but all the data from the old schema is in the new one, it's just been moved around a bit, and I need to make sure it is correct. We have tens of millions of rows so manual inspection is not an option.
Are there any tools which could aid in this type of comparison?
If not are there any libraries/frameworks which could help kick start the development of a custom solution?
I'm happy to use a database specific solution if necessary, in this case for SQL Server 2008.
**My soluton:** I'm comparing the two data sets by creating a
VIEW
of each table on the old database with the same fields as the new database table.
I then compare the data using the technique described here: The shortest, fastest, and easiest way to compare two tables in SQL Server: UNION !
I'm lucky in this migration as the overall table structure is similar to the old database, with fields moved from one table to another, dropped or added. In the case of the dropped and added there is nothing to compare, for the fields which have moved or been aggregated I do calculations in the view to provide the correct information for comparison.
The UNION
comparison shows me only the rows with differences, so as soon as the data is correct I get an empty result set.
Tony
(378 rep)
Jun 13, 2011, 03:02 PM
• Last activity: Jan 20, 2025, 08:56 AM
0
votes
0
answers
119
views
Launch DBeaver with custom configuration/connection
I am working in several projects where every one has its own database connections. So far, I have been using DBeaver, adding the connections by hand, but at the end, having the connections, data, SQL scripts, tabs, etc. for all the projects in the same place results in a chaotic environment. So, I a...
I am working in several projects where every one has its own database connections.
So far, I have been using DBeaver, adding the connections by hand, but at the end, having the connections, data, SQL scripts, tabs, etc. for all the projects in the same place results in a chaotic environment.
So, I am trying to create a tool able to launch DBeaver which the configuration (i.e. connections) specific to a project.
Looking at the [docs](https://dbeaver.com/docs/dbeaver/Command-Line/#command-line-parameters) , it should be an easy task, but I can not get it to work.
I have tried multiple combinations of parameters for the
-con
argument (create
, save
, connect
, openConsole
, url
, folder
, database
, etc.) but I am not able to open dbeaver UI with a new connection.
For instance:
dbeaver-ce \
-data . \
-con "driver=sqlite|database=one.sqlite|folder=/home/salva/projects/one|name=one|openConsole=true|connect=true|save=true|create=true" \
-f
I am unable to find the exact spell that would make it work and would appreciate any advice on the matter!
**Update**: It seems it was a PEBCAK, I had not noticed I already had a DBeaver instance open in another workspace, and because of that, nothing was apparently happening when I run the command with the new connection, I found that adding the -f
flag (without its required argument), would made DBeaver to appear but then, -con
was not handled, probably because of the broken -f
!
In any case, it is working now!
salva
(101 rep)
Nov 11, 2024, 03:41 PM
• Last activity: Nov 14, 2024, 11:58 AM
0
votes
1
answers
57
views
Which software OPEN Firebird 2.0 database into FREE db management Tool?
Need help in finding out Free Tool for firebird 2.0 database? Can anyone has idea for this tool availability and link? I have database in Windows Platform and I have few store procedure written there
Need help in finding out Free Tool for firebird 2.0 database?
Can anyone has idea for this tool availability and link?
I have database in Windows Platform and I have few store procedure written there
Atul Modi
(3 rep)
Sep 30, 2024, 01:00 PM
• Last activity: Nov 7, 2024, 04:47 PM
0
votes
2
answers
883
views
Finding tables & columns at risk of hitting max value of int
I just took over a medium-sized postgres database and the team has been surprised with many tables hitting their auto-incrementing `id` `int `max limits which triggered unscheduled downtime to fix. Does anyone know of a simple tool to help check all tables/columns and easily find which are at risk o...
I just took over a medium-sized postgres database and the team has been surprised with many tables hitting their auto-incrementing
id
int
max limits which triggered unscheduled downtime to fix.
Does anyone know of a simple tool to help check all tables/columns and easily find which are at risk of hitting the int
max limits? I'm sure we can come up with a script to check, but I remember reading somewhere of a tool to help me identify potential issues exhaustively.
leonsas
(233 rep)
Oct 13, 2020, 01:30 PM
• Last activity: Sep 18, 2024, 01:45 PM
49
votes
4
answers
31779
views
Is there a tool like Microsoft's "SQL Server Profiler" for MySQL?
While developing on MySQL I really miss being able to fire up a profiler. I find [SQLyog][1] is a good enough replacement for Query Analyzer but have not found a tool that works like SQL profiler. For the MySQL folk who have not seen Microsoft's [SQL Profiler][2], here is a screenshot 

Sam Saffron
(1114 rep)
Sep 24, 2008, 01:40 AM
• Last activity: Aug 12, 2024, 07:39 AM
11
votes
2
answers
3904
views
Are these tools still valid?
I was watching a 7 years old webinar done by Brent Ozar (https://youtu.be/U_Kle3gKaHc), and heard of several items being recommended at that time. 1. SQLDiag utility. 2. SQLNexus. 3. PAL tool. 4. Database Tuning Advisor/wizard. 5. BPA (Best Practices Analyzer). 6. SQL Server Policy Based Management....
I was watching a 7 years old webinar done by Brent Ozar (https://youtu.be/U_Kle3gKaHc) , and heard of several items being recommended at that time.
1. SQLDiag utility.
2. SQLNexus.
3. PAL tool.
4. Database Tuning Advisor/wizard.
5. BPA (Best Practices Analyzer).
6. SQL Server Policy Based Management.
Are all of them still to be used/considered or there is something newer that replaced them?
TheNixon
(371 rep)
Feb 14, 2017, 10:54 AM
• Last activity: Jul 25, 2024, 10:01 AM
1595
votes
9
answers
3352484
views
How do I list all databases and tables using psql?
When I log in with `psql --username=postgres`, how do I list all databases and tables? I have tried `\d`, `d` and `dS+` but nothing is listed. I have created two databases and a few tables with pgAdmin III, so I know they should be listed.
When I log in with
psql --username=postgres
, how do I list all databases and tables?
I have tried \d
, d
and dS+
but nothing is listed. I have created two databases and a few tables with pgAdmin III, so I know they should be listed.
Jonas
(33975 rep)
Feb 17, 2011, 08:45 AM
• Last activity: Sep 26, 2023, 01:02 PM
1
votes
1
answers
1419
views
Can someone explain in simple terms Cassandra nodetool commands like compact and cleanup?
**Hello Everyone** I am new in databases and i am trying to understand some Cassandra commands. I would like to know about the following commands : - nodetool compact - nodetool cleanup - nodetool repair - nodetool garbagecollect I would appreciate some simple and clear answers like -> nodetool help...
**Hello Everyone**
I am new in databases and i am trying to understand some Cassandra commands. I would like to know about the following commands :
- nodetool compact
- nodetool cleanup
- nodetool repair
- nodetool garbagecollect
I would appreciate some simple and clear answers like -> nodetool help : it shows all the commands and their usage.
>The problem i am trying to solve is that after i delete (a lot of data) the storage is still full. I change the gc_grace_seconds to 1 day and still nothing. So if i need to clear the space manualy right now which commands should i run and in what order?
*Thanks for your time*
Vasilis_Dimitrakopoulos
(23 rep)
Aug 25, 2022, 09:59 AM
• Last activity: Aug 25, 2022, 11:02 AM
3
votes
2
answers
671
views
Text-based interface for PostgreSQL?
I know that `psql` is an option, but I'm looking for an easier text-based interface for PostgreSQL. Something that's similar to what 'tig' is to 'git', or 'phpmyadmin' is to 'mysql' (but using the command line). does any one know something like this?
I know that
psql
is an option, but I'm looking for an easier text-based interface for PostgreSQL. Something that's similar to what 'tig' is to 'git', or 'phpmyadmin' is to 'mysql' (but using the command line). does any one know something like this?
TinyProton
(31 rep)
Sep 11, 2013, 04:31 PM
• Last activity: Jun 17, 2022, 10:08 AM
11
votes
3
answers
6856
views
How to control the order of servers listed in the SSMS connection dialog?
My current project involves a lot of database shuffling as we upgrade from SQL 2008 -> 2012, re-task hardware, repeat. One minor annoyance is the connection dialog in SSMS re-shuffling the server order to put the most recent on top. Given that on any particular day I'm connecting to 6-10 DB servers...
My current project involves a lot of database shuffling as we upgrade from SQL 2008 -> 2012, re-task hardware, repeat.
One minor annoyance is the connection dialog in SSMS re-shuffling the server order to put the most recent on top. Given that on any particular day I'm connecting to 6-10 DB servers and want to quickly find a specific one in the list, this behavior is much more of a hindrance than a help.
Is there a way to disable this behavior, having the servers listed alphabetically, or in the order they were added...or *anything* that doesn't change every time I connect to a server?
Barring that, is there an *entirely different* way to better manage connecting to a specific server from a list/farm of them?
I'm using SSMS for SQL 2012 (though I'm curious about 2008 solutions as well).
Nick Craver
(212 rep)
Aug 3, 2012, 02:03 PM
• Last activity: Oct 12, 2021, 09:05 AM
1
votes
0
answers
52
views
What data modelling tool is sufficient for a student learning database design?
Disclaimer: I do not intend this to be a question based on opinion and start data wars (I don't know if such things exist in this realm unlike software development and programming languages) What I want: I want a piece of software (hopefully free, I am a student) that does not necessarily have to co...
Disclaimer: I do not intend this to be a question based on opinion and start data wars (I don't know if such things exist in this realm unlike software development and programming languages)
What I want: I want a piece of software (hopefully free, I am a student) that does not necessarily have to come with all the bells and whistles of professional data suites, but one that will allow me to:
- create ERDs
- design my databases, tables, fields,
- create primary keys, link foreign keys
- visualize relations b/w tables
Most of what I have found such as erwin Data Modeler have free trials only. Once again, its not about the bells and whistles since I am what you could call a beginner.
I have a personal desktop app I am working on and I don't want to keep looking at the code to remember the tables nor keep opening SQLITE DB Browser.
Any sense of direction would be appreciated.
Attitude12136
(25 rep)
Sep 24, 2021, 02:40 PM
0
votes
1
answers
61
views
Looking for a tool for managing complex powershell automation processes with multiple scripts
Sysadmin here, I'm wondering what tools you all use to manage large scale automation tasks with powershell. I currently have several powershell scripts that are regularly used, but do not interact or call each other. I'm looking for a GUI interface to help make sense of it, and grab variables as out...
Sysadmin here,
I'm wondering what tools you all use to manage large scale automation tasks with powershell. I currently have several powershell scripts that are regularly used, but do not interact or call each other. I'm looking for a GUI interface to help make sense of it, and grab variables as outputs from one script into another.
I can do all this through powershell alone, but wondering if there's a more visual way to set up the complex interactions between scripts.
An example of a process that would need to be completed:
1. SQL backup taken on hosted client server
2. Backup uploaded to FTP Site
3. Backup loaded to data scrubbing server
4. Backup restored to local SQL Instance
5. Client sensitive info scrubbed
6. Backup taken and uploaded to NAS
7. NAS backup restored to local support environment
8. Database modified to add users for WinAuth
9. Various server config on support environment for our software
Austin
(93 rep)
May 5, 2021, 04:51 PM
• Last activity: May 6, 2021, 07:28 AM
42
votes
7
answers
13873
views
Why should I use Visual Studio 2010 over SSMS for my database development?
Visual Studio 2010 introduces [database projects][1] and a whole array of related features that supposedly facilitate database development. I've used SQL Server Management Studio (SSMS) for many years to do my database development without issue. - Why should I bother with VS2010 when SSMS works for...
Visual Studio 2010 introduces database projects and a whole array of related features that supposedly facilitate database development. I've used SQL Server Management Studio (SSMS) for many years to do my database development without issue.
- Why should I bother with VS2010 when SSMS works for me? What, specifically, does it do better than SSMS?
- But perhaps my premise is incorrect and SSMS still trumps VS for database development. If so, in what specific ways is that true?
Nick Chammas
(14810 rep)
Nov 4, 2011, 09:52 PM
• Last activity: Apr 9, 2021, 08:24 AM
0
votes
1
answers
842
views
Take a "slice" of a SQL Server database: for all tables, get only the rows that join (directly or indirectly) to a specific row
For audit purposes, I'm trying to obtain a copy/export of a DB but including only the rows from each table that have relevance to a small collection of rows in some table. So every row of every table that these rows point to; every row of every table that points to these rows; and so forth. (In alge...
For audit purposes, I'm trying to obtain a copy/export of a DB but including only the rows from each table that have relevance to a small collection of rows in some table. So every row of every table that these rows point to; every row of every table that points to these rows; and so forth. (In algebra terms this is the transitive-symmetric-reflexive closure of those rows with respect to the foreign key relation.)
I'm wondering if there exists some kind of tool to do this, or if this is scriptable somehow. I have ~400 tables with a tight network of foreign keys so I'd rather not do this by hand.
Carl Patenaude Poulin
(115 rep)
Apr 8, 2021, 02:40 PM
• Last activity: Apr 8, 2021, 05:02 PM
5
votes
1
answers
23669
views
What's a good workbench tool for sqlite similar to MySQLWorkbench for MySQL?
What's a good workbench tool for sqlite similar to MySQLWorkbench for MySQL? I'm used to MySQLWorkbench for working with MySQL databases. Now I have some sqlite databases to work with and would like to find a similar tool.
What's a good workbench tool for sqlite similar to MySQLWorkbench for MySQL? I'm used to MySQLWorkbench for working with MySQL databases. Now I have some sqlite databases to work with and would like to find a similar tool.
qazwsx
(3527 rep)
Aug 19, 2014, 11:12 PM
• Last activity: Sep 1, 2020, 05:52 PM
10
votes
4
answers
13434
views
Are there any free online collaboration database schema tools?
I am interested in a free and simple MySQL tool which can offer online collaboration functionality in creating database general schema. Do you know any?
I am interested in a free and simple MySQL tool which can offer online collaboration functionality in creating database general schema. Do you know any?
EKK
(295 rep)
Oct 31, 2011, 10:43 AM
• Last activity: Jul 3, 2020, 10:57 AM
0
votes
2
answers
175
views
Tools/Methods to investigate slow query
I have a query with a subquery, both are fast but when combined they take forever (meaning whatever time above what is acceptable in my application). I tried using 'explain' to see what's going on, it didn't help me much. What other ways are there to investigate slow queries? Below are the specific...
I have a query with a subquery, both are fast but when combined they take forever (meaning whatever time above what is acceptable in my application). I tried using 'explain' to see what's going on, it didn't help me much. What other ways are there to investigate slow queries?
Below are the specific details of my problem. I have a list of products, I want to find the date of the first vendor event for each product. If I get the list of event IDs, the query goes fast (each product might have multiple events, they are created in chronological order so min event ID is the earliest; ProdID is indexed); then I use this list of event IDs to get the date, this second query goes fast too (event ID is the primary key, therefore indexed). But if I use the first query as a subquery of the second, it takes forever.
Query 1:
mysql> select min(VendorEventID) from Vendor_Events where ProdID in (598446938, 598446984, 598447024, 598447054, 598447311, 598447523, 598447764, 598447778,
598448000, 598448048) and vendorid = 12 group by ProdID ;
+--------------------+
| min(VendorEventID) |
+--------------------+
| 11217790121 |
| 11217792453 |
| 11217793912 |
| 11217793894 |
| 11217794825 |
| 11217815018 |
| 11217813148 |
| 11217828936 |
| 11217830215 |
| 11217829202 |
+--------------------+
10 rows in set (0.00 sec)
Query 2:
mysql> select * from Vendor_Events where VendorEventID in ( 11217790121, 11217792453, 11217793912, 11217793894, 11217794825, 11217815018, 11217813148, 11217828936, 11217830215, 11217829202 ) ;
+---------------+----------+-----------+---------------------+------------+--------+
| VendorEventID | VendorID | ProdID | LoggedDate | VendorType | NameID |
+---------------+----------+-----------+---------------------+------------+--------+
| 11217790121 | 12 | 598446938 | 2016-12-07 16:33:58 | 2 | 32 |
| 11217792453 | 12 | 598446984 | 2016-12-07 16:34:14 | 2 | 32 |
| 11217793894 | 12 | 598447054 | 2016-12-07 16:34:29 | 2 | 32 |
| 11217793912 | 12 | 598447024 | 2016-12-07 16:34:29 | 2 | 32 |
| 11217794825 | 12 | 598447311 | 2016-12-07 16:34:33 | 2 | 32 |
| 11217813148 | 12 | 598447764 | 2016-12-07 16:37:10 | 2 | 32 |
| 11217815018 | 12 | 598447523 | 2016-12-07 16:37:24 | 2 | 32 |
| 11217828936 | 12 | 598447778 | 2016-12-07 16:39:54 | 2 | 32 |
| 11217829202 | 12 | 598448048 | 2016-12-07 16:39:55 | 2 | 32 |
| 11217830215 | 12 | 598448000 | 2016-12-07 16:40:04 | 2 | 32 |
+---------------+----------+-----------+---------------------+------------+--------+
10 rows in set (0.04 sec)
Explain them combined:
mysql> explain select * from Vendor_Events where VendorEventID in ( select min(VendorEventID) from Vendor_Events where ProdID in (598446938, 598446984, 598447024, 598447054, 598447311, 598447523, 598447764, 598447778, 598448000, 598448048) and vendorid = 12 group by ProdID ) ;
+----+--------------------+---------------+-------+-----------------+----------+---------+------+----------+--------------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+--------------------+---------------+-------+-----------------+----------+---------+------+----------+--------------------------+
| 1 | PRIMARY | Vendor_Events | ALL | NULL | NULL | NULL | NULL | 78536406 | Using where |
| 2 | DEPENDENT SUBQUERY | Vendor_Events | range | ProdID,ProdID_2 | ProdID_2 | 16 | NULL | 15 | Using where; Using index |
+----+--------------------+---------------+-------+-----------------+----------+---------+------+----------+--------------------------+
2 rows in set (0.00 sec)
Of course if anyone can help me figure out what's causing the query to be super slow, I'd appreciate. But if people want to tell me what other ways are there to investigate slow queries, I'd like that too, since we all face slow queries every now and then. ;-)
msb
(144 rep)
Dec 13, 2016, 02:00 AM
• Last activity: Dec 26, 2019, 07:16 PM
1
votes
1
answers
1241
views
Which PgBackRest policy for differential backups in PostgreSQL
I set up pgBackRest and PostgreSQL configuration in two different servers. I set up with crontab one full backup a week and one differential backup a day. ```none 0 1 * * 0 pgbackrest --type=full --stanza=stanzaname backup 0 1 * * 1-6 pgbackrest --type=diff --stanza=stanzaname backup ``` I set up re...
I set up pgBackRest and PostgreSQL configuration in two different servers.
I set up with crontab one full backup a week and one differential backup a day.
0 1 * * 0 pgbackrest --type=full --stanza=stanzaname backup
0 1 * * 1-6 pgbackrest --type=diff --stanza=stanzaname backup
I set up retention as below to save disk usage:
repo1-retention-full=2
repo1-retention-diff=1
repo1-retention-archive-type=full
Is it possible to ensure PITR to cover up to 2 weeks with this retention configuration?
If yes, is there a benefit to set a differential retention more than 1?
Because keeping more differential backups could consume a lot of disk space.
Mika
(361 rep)
May 17, 2019, 10:50 AM
• Last activity: Nov 3, 2019, 01:02 PM
1
votes
3
answers
1049
views
Is any tool for taking MySQL Dump Automatically with a particular time?
I am using VS2010 and MySQL for my project. My client wantw to take mysqldump every day like a daily backup. I want to give my client a tool for taking mysqldumps on a particular time schedule. Do you know any tool that can fulfill my requirement?
I am using VS2010 and MySQL for my project. My client wantw to take mysqldump every day like a daily backup. I want to give my client a tool for taking mysqldumps on a particular time schedule.
Do you know any tool that can fulfill my requirement?
Sagotharan
(111 rep)
Jan 31, 2012, 08:15 AM
• Last activity: Sep 11, 2019, 03:39 PM
Showing page 1 of 20 total questions