New answers tagged

1

SQL server doesn't have any built-in capacity to merge multiple backups into a single database, you'll have to restore each backup with a different database name (like WellProductionInjection_2019 and WellProductionInjection_2020), then do the work yourself to combine them however you need. Once the databases are restored, you can combine them using a ...


3

Yes, you could do a point-in-time restore. You would need the last full backup and all log backups up to the point you need, as log backups do not contain all earlier logs (they are in one sense incremental, rather than differential). For a week's worth of logs on a busy database, it may take some time to restore. Therefore a better solution (if you want to ...


1

I think the answer is "it depends". In my experience, the thing it depends upon mostly is the amount of data you are restoring, bearing in mind that the amount of data is the base backup plus all of the WALs since that base backup. This means that: if you have a large database (base backup) with few UPDATEs/INSERTs, then there will be very little ...


0

The preferred way of getting passwords into any Postgres utility is to use the Postgres Password File.


1

You could certainly script it with a nested stored procedure: To be called as something like EXEC recursive_shaped_query @StartTable='SomeTable', @KeyColumn='Id', @ValuesSQL='SELECT Id FROM (VALUES (1),(6),(4576),(42)) AS Ids(Id)' This then runs via ad-hoc SQL SELECT * FROM SomeTable WHERE Id IN (SELECT Id FROM (VALUES (1),(6),(4576),(42)) AS Ids(Id)) It ...


0

In mongoshell you can connect to several databases and use them at the same time. A plain simple copy would be this one: var db_A = Mongo("mongodb://user:password@host-A").getDB("data") var db_B = Mongo("mongodb://user:password@host-B").getDB("data") var docs = db_A.getCollection("collection_name").find()....


2

Just succeeded to clone the Database, using on local: In the SSMS, right click on the database to export, then Tasks => Export Data-tier Application it creates a bacpac file. Copy the backpac to the distant server, and there in SSMS, right click on the "Databases" folder and then Import Data-tier Application, use the copied backpac file. It ...


0

Why not just add a MonthOf and YearOf column (likely as integer types) to your Leaderboard table? Then you'll only need one table to store all the leaderboards. Whenever you need to show the Leaderboard for a particular month and year, you just add those fields as predicates in your WHERE clause of your query. E.g. WHERE MonthOf = 1 AND YearOf = 2021 to get ...


1

It's not safe to copy data files unless mysqld is stopped. I would suggest Percona XtraBackup for a physical backup of the database. This should be close to preserving the exact pages, including any fragmentation. Another alternative is filesystem snapshots. You could revert to the snapshot after each of your tests.


6

The archive redo log is roughly equivalent to a transaction log backup in SQL Server, and there are options within SQL Server to take multiple copies of the transaction log backup simultaneously. When performing your BACKUP LOG operation, you can specify MIRROR TO to take multiple copies of the same backup at different locations, providing protection against ...


2

Since J.D. has already given you some good advice on what could be the alternatives, I'm gonna just add how you could achieve specifically what you asked and if you still think it's a good approach for your problem, you can use it. Here's a database with two filegroups for this example: USE [master] GO CREATE DATABASE [Lab] ON PRIMARY ( NAME = N'Lab', ...


2

I know you mentioned it's a little bit out of your control, but if you don't need the data at all and just the schema itself, doing a backup and restore on a 2 TB database is going to be the least efficient way to accomplish your goal, by far, among probably 10 different options. (You should familiarize yourself with the alternatives and bring this to the ...


0

@DavidBrowne has mentioned the option of SIMPLE recovery mode if you don't need point-in-time recovery. But if you do need FULL recovery, you can and should still simplify your scripts: Your transaction file would be tiny if not for steps 2, 3 and 4, which should be removed. There is no need to shrink the DB, it clearly needs to be the size it is. Shrinking ...


Top 50 recent answers are included