Skip to main content
12 votes

Accidentally overwrote mysql database with empty data

No, you can't. You have overwritten the database so your best course of action is to restore from the latest backup. If that is 4 months old, that's it, you lost 4 months of data. You should take ...
ypercubeᵀᴹ's user avatar
10 votes
Accepted

Always On FCI vs Always On Availability Groups

What is the advantage of Always On Failover Clustering vs Always On Availability Groups? The main advantages given 2012->2017 for an FCI is: No instance level metadata or objects required to be ...
Gavin Belson's user avatar
10 votes
Accepted

Is there a way to back up agent jobs?

SQL agent jobs are stored in the system msdb database, so backing up that database will do what you need. In a disaster, you can restore the entire msdb database, or, if necessary, recover individual ...
BradC's user avatar
  • 9,994
10 votes

What is the best option for High availability on a data warehouse?

Most data warehouses are in Simple recovery model, and most true HA solutions require Full recovery (AGs, Mirroring). The minimum for Log Shipping is Bulk Logged, but that's not really true HA since ...
Erik Darling's user avatar
  • 41.7k
8 votes

Is there a way to back up agent jobs?

Another way is to just export to file using dbatools Get-DbaAgentJob -SqlInstance workstation\sql2016 | Export-DbaScript you can even script out your entire instance or subset including agent jobs,...
Kin Shah's user avatar
  • 62.3k
8 votes
Accepted

PostgreSQL ANALYZE execution time over 24h (still running)

After several hours of research and examining the current situation I think I managed to solve the issue. (Many thanks to fellow user ypercube for the inspiration and for Erwin Brandstetter who in ...
wjozsi's user avatar
  • 171
8 votes
Accepted

How do I recover data from the postgres data directory on my hard drive?

If you need a method to restore the database but do not have an Intel/AMD-based system available, then a virtual machine on Amazon, DigitalOcean, or elsewhere may give you what you need. If you’ve ...
matigo's user avatar
  • 2,028
7 votes
Accepted

What is a good way to get a time for the data freshness when the source is log shipped to another server?

You don't need to rely on backup history: you can just check the restore history! In addition to having backup history, msdb also saves the restore history. Here's a sample query you might use to find ...
AMtwo's user avatar
  • 16.2k
7 votes

SQL Server Connection String - MultiSubnetFailover True or Yes?

Are both "Yes" and "True" supported? Or does it vary by driver? If the latter, is there a list of which drivers support which syntax? Every driver has their syntax. In the first ...
Sean Gallardy's user avatar
6 votes

Why is Full Recovery model a requirement for an Availability Group?

Suppose I run the following query on a database with a recovery model of full: INSERT INTO dbo.MY_FAVORITE_MSFT_EMPLOYEES WITH (TABLOCK) SELECT 'SEAN GALLARDY' UNION ALL SELECT 'JOE SACK'; Under the ...
Joe Obbish's user avatar
  • 32.5k
6 votes

Why do I need witness in WSFC with two nodes?

Straight from the docs, with a two-node cluster without a witness: One node's vote is zeroed, so the majority vote is determined out of a total of 1 vote. If the non-voting node goes down ...
David Browne - Microsoft's user avatar
5 votes
Accepted

SQL Snapshot Redirect

One approach is to create a database containing only synonyms referencing the objects in the snapshot you need for reporting. Clients can then connect to the synonym database and run queries just as ...
Dan Guzman's user avatar
  • 28.3k
4 votes
Accepted

Business Continuity Plan -- How can I connect to DR Server if PROD site is completely Down

If you have: 2 Datacenters 1 Server in Each DC Using SQL Server AlwaysOn Availability Groups Then the following happens: The Primary Datacenter Goes Down, Completely How do you continue business ...
Sean Gallardy's user avatar
4 votes

SQL Server AlwaysOn Error:35250

This is login and permission related error. What kind of account are you using to connect when you build the AOA features? If you are using a domain account you can fix this error it in two ways. ...
Hailegziabher Dechassa's user avatar
4 votes

Is there a way to back up agent jobs?

I know this is an old question already answered but you can press F7 with the folder JOBS selected. then you can select all jobs and right click them, script jobs as > create. It will create the ...
Racer SQL's user avatar
  • 7,386
4 votes

Attach ldf more current than mdf

You should always produce a log backup before restoring a database. Call it a tail log backup if you wish. I call it "the last log backup before a restore". If you can't start your SQL server, ...
Tibor Karaszi's user avatar
4 votes

How to maintain a query that runs forever?

It would be easier to mod the script so that it writes out either the last value, or a value every n times so that you can restart the script with the last known value in case of failure. Linux ...
pixiemops's user avatar
  • 134
4 votes
Accepted

How to maintain a query that runs forever?

1st thought You have an XY Problem. You need to use an algorithm that allows you to restart from a specific point. Code Review Dividend.num <=@endnum exists in two places. Get rid of the 2nd one ...
Michael Kutz's user avatar
  • 4,829
4 votes

Log files in Always on Disaster Recovery Situation

Is there any way I can handle it better than just letting the log files grow? I believe you have the ideal options covered already. You either Let the log files grow for the duration of the outage, ...
Josh Darnell's user avatar
  • 29.4k
4 votes
Accepted

SQL Server Connection String - MultiSubnetFailover True or Yes?

Connection string keywords are driver/API dependent so the documentation is not conflicting. The OLE DB Driver for SQL Server IDBInitialize::Initialize connection keywords section: Possible values ...
Dan Guzman's user avatar
  • 28.3k
3 votes
Accepted

Business Continuity Plan for web application and database

Business Continuity can be a complicated beast and you'll need to involve affected departments/users to make sure everyone knows the 'plan'. The main two things you'll tend to see over and over are: ...
Scott Hodgin - Retired's user avatar
3 votes

Problem installing SQL Failover cluster

I think what you're wanting is to instance stack. You have one instance on Server A, let's call it Instance 1. Instance 1 primarily lives on Server A, but can fail over to Server B. Now you want to ...
Arthur D's user avatar
  • 932
3 votes

Problem installing SQL Failover cluster

You can but Instance B will not be passive any longer which may require additional licensing costs to operate two active instances.
nkdbajoe's user avatar
  • 194
3 votes

Problem installing SQL Failover cluster

Yes you can do that with Failover Clustering. But you will need to license this second instance. If one node fails and can't be brought up quickly, you need to consider whether or not the hardware ...
Tara Kizer's user avatar
  • 5,966
3 votes
Accepted

Rebuild system databases to a different location

I believe all of your questions can be answered here :) The link covers: Planned relocation of system databases Failure recovery of system databases Moving Master Moving Resource Other ...
Sean Gallardy's user avatar
3 votes
Accepted

New SQL Server from backup; application has successful login on 1 database, but fails on another: 0x80040e4d

Here is a summarization of our efforts to make this work: We set up a new SQL Server using SQL Server Express 2014 and attached the .MDF files from the most recent backup. We created a user and gave ...
Levi's user avatar
  • 360
3 votes

SQL Server rollback schema update

There are many good schema comparison tools out there. Redgate Schema Compare and SQL Server Data Tools for Visual Studio are two that come to mind (I'm not affiliated with either). In a development ...
Michael Green's user avatar
3 votes

all of the databases recovery models changed

Recovery model is changed by a specific ALTER DATABASE statement, and as far as I've seen, there's never been a bug that would change it. Some common sources of that statement include: Backup ...
Brent Ozar's user avatar
3 votes
Accepted

Problems of having DR as Synchronous Commit

If i want to change the DR to Synchronous Commit will there be any performance issues ? Well, it will take longer to commit transactions, as the primary will wait for the log records to be saved on ...
David Browne - Microsoft's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible