Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.bak file DataProvider task [Chris] #1421

Open
tznind opened this issue Sep 16, 2022 · 0 comments
Open

.bak file DataProvider task [Chris] #1421

tznind opened this issue Sep 16, 2022 · 0 comments

Comments

@tznind
Copy link
Contributor

tznind commented Sep 16, 2022

User Story
I want to load a .bak data file with RDMP dle

Is your feature request related to a problem? Please describe.

  1. File copy
  2. Run attach task SQL

Generating .bak file for testing
For testing to generate a .bak file use something like:

BACKUP DATABASE RDMP_Catalogue
TO DISK = 'd:\temp\RDMP_Catalogue.bak'

Restoring
First user must know the name of the database(s) and log files contained in the .bak archive. Archive can have multiple databases.

RESTORE FILELISTONLY FROM DISK = 'd:\temp\RDMP_Catalogue.bak'

This will output something like:

┌──────────────────┬─────────────────────────────────────┬────┬─────────────┬────────┬──────────────┬──────────────┐
│LogicalName       │PhysicalName                         │Type│FileGroupName│Size    │MaxSize       │FileId        │
├──────────────────┼─────────────────────────────────────┼────┼─────────────┼────────┼──────────────┼──────────────►
│RDMP_Catalogue    │C:\Users\44777\RDMP_Catalogue.mdf    │D   │PRIMARY      │75497472│35184372080640│1             │
│RDMP_Catalogue_log│C:\Users\44777\RDMP_Catalogue_log.ldf│L   │-            │75497472│2199023255552 │2             │

Then to actually restore it run:

RESTORE DATABASE RDMP_Catalogue2

 FROM DISK = 'd:\temp\RDMP_Catalogue.bak' 

 WITH MOVE 'RDMP_Catalogue' TO 'C:\Users\44777\RDMP_Catalogue2.mdf',

MOVE 'RDMP_Catalogue_log' TO 'C:\Users\44777\RDMP_Catalogue2_log.ldf' ,  NOUNLOAD,  REPLACE,  STATS = 5
@tznind tznind changed the title .bak file DataProvider task .bak file DataProvider task [Chris] Oct 31, 2022
@JFriel JFriel self-assigned this Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants