SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


No Data in a table when database is restored


No Data in a table when database is restored

Author
Message
Sydknee
Sydknee
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 46
Got a bit of an unusual one that's got me scratching my head.

I'm covering a colleague while they are on holiday and as per the law of sod, his BI system decides to go wrong on the first day.
After picking my way through it all, I discovered the issue lies with a database that is restored onto a different server daily is failing to copy the data in one table (again sods law it just happens to be the most important table).
There are no errors on all his procedures and tasks so this has proved hard to find.
I've ran the whole process manually and still doesn't bring the data through.
Checked all the standard things, even restored the backup to a different server.
Has anyone else ever had this happen.

Thanks in advance.

Chris
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)

Group: General Forum Members
Points: 340061 Visits: 42625
Sydknee - Wednesday, September 13, 2017 7:59 AM
Got a bit of an unusual one that's got me scratching my head.

I'm covering a colleague while they are on holiday and as per the law of sod, his BI system decides to go wrong on the first day.
After picking my way through it all, I discovered the issue lies with a database that is restored onto a different server daily is failing to copy the data in one table (again sods law it just happens to be the most important table).
There are no errors on all his procedures and tasks so this has proved hard to find.
I've ran the whole process manually and still doesn't bring the data through.
Checked all the standard things, even restored the backup to a different server.
Has anyone else ever had this happen.

Thanks in advance.

Chris


Did you check to make sure that the table in the source database has data?

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Lowell
Lowell
SSC Guru
SSC Guru (123K reputation)SSC Guru (123K reputation)SSC Guru (123K reputation)SSC Guru (123K reputation)SSC Guru (123K reputation)SSC Guru (123K reputation)SSC Guru (123K reputation)SSC Guru (123K reputation)

Group: General Forum Members
Points: 123450 Visits: 41464
it is not possible that a database restore skips a table.
that means the table was empty at the time of the backup.
you most likely need to go to a previous backup and find one where the table was not yet truncated/deleted.

Lowell
--help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!
Sydknee
Sydknee
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 46
The original table has data in it and still has, that was one of the first things I checked once I had tracked down what was happening.
I've tried all the basic stuff and can not find any reason for this, technically its impossible.
Backed up and restored a number of times both manually and running his processes.
Data is in the table at the time of the backup and In Theory should be in the restore but for some unknown reason its not.
The automated processes that run this were not changed and it suddenly started a couple of days ago, no errors or anything to let me know what happened.
As I said its a real head scratcher.
Joe Torre
Joe Torre
SSCommitted
SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)SSCommitted (2K reputation)

Group: General Forum Members
Points: 1972 Visits: 575
Can you describe the process in more detail?
Jeff Moden
Jeff Moden
SSC Guru
SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)SSC Guru (340K reputation)

Group: General Forum Members
Points: 340061 Visits: 42625
Sydknee - Wednesday, September 13, 2017 8:42 AM
The original table has data in it and still has, that was one of the first things I checked once I had tracked down what was happening.
I've tried all the basic stuff and can not find any reason for this, technically its impossible.
Backed up and restored a number of times both manually and running his processes.
Data is in the table at the time of the backup and In Theory should be in the restore but for some unknown reason its not.
The automated processes that run this were not changed and it suddenly started a couple of days ago, no errors or anything to let me know what happened.
As I said its a real head scratcher.


Check to see how many actual backup sets there are in the file. You might be restoring from an earlier set in the same file. Check your backup code/GUI selection to see if you're appending to the media or not. If you are, that could certainly be the problem.

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
If you think its expensive to hire a professional to do the job, wait until you hire an amateur. -- Red Adair

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Sydknee
Sydknee
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 46
Joe Torre - Wednesday, September 13, 2017 10:27 AM
Can you describe the process in more detail?

Its a standard backup and restore procedure. Nothing more than this process has been doing for a couple of years without issues.



Jeff Moden - Wednesday, September 13, 2017 10:30 AM
Sydknee - Wednesday, September 13, 2017 8:42 AM
The original table has data in it and still has, that was one of the first things I checked once I had tracked down what was happening.
I've tried all the basic stuff and can not find any reason for this, technically its impossible.
Backed up and restored a number of times both manually and running his processes.
Data is in the table at the time of the backup and In Theory should be in the restore but for some unknown reason its not.
The automated processes that run this were not changed and it suddenly started a couple of days ago, no errors or anything to let me know what happened.
As I said its a real head scratcher.


Check to see how many actual backup sets there are in the file. You might be restoring from an earlier set in the same file. Check your backup code/GUI selection to see if you're appending to the media or not. If you are, that could certainly be the problem.

There are no other backup sets, just a single full backup.
Data in the original database has date / time stamp of when it was created, the last entries in the restored database correspond with the time the backup was taken.
I've managed to narrow it down to the restore on the other server as it restores perfectly on the server with the original database.

New Marketing slogan for SQL Server - "Making the Impossible, Possible"

Thomas Rushton
Thomas Rushton
SSCrazy Eights
SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)SSCrazy Eights (8.5K reputation)

Group: Moderators
Points: 8455 Visits: 4741
Is it actually a table, or is it an alias for a table elsewhere on the server?

do you see any error messages when you try to query the table from the other server, or does it return an empty dataset with all the right columns?
Sydknee
Sydknee
Grasshopper
Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)Grasshopper (12 reputation)

Group: General Forum Members
Points: 12 Visits: 46
ThomasRushton - Thursday, September 14, 2017 4:02 AM
Is it actually a table, or is it an alias for a table elsewhere on the server?

do you see any error messages when you try to query the table from the other server, or does it return an empty dataset with all the right columns?


It is actually a table, when you query the table it returns nothing, no errors.
Arsh
Arsh
Ten Centuries
Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)Ten Centuries (1K reputation)

Group: General Forum Members
Points: 1034 Visits: 483
Can you query the data in other tables in the target database and let know if they have the latest data (in accordance with backup timestamp at source) ?

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search