December 14, 2009 at 9:56 am
I have a DB that gets updated throughout the day.
My users need the ability to go back in time and search on data say from the end of last month.
Problem is we don't store any old DB's. So, for example the balance field is updated throughout the day, and never gets archived.
Is there way using snapshots or some other methoed, that would let me users search thru an old copy of the DB?
December 14, 2009 at 10:14 am
There are lots of ways to archive data.
Backup & restore to different databases. "MyDatabase_20091130"
Save specific tables to a new name "MyTable_20091130"
Scheduled SSIS package, replication, log shipping .....
Idera's latest backup softwaqre allows you to run queries against the backup file without doing a restore, so if you have backups from the correct dates available, that's another option.
You would need to decide what timeframe will be needed then plan & schedule one of the many methods.
December 14, 2009 at 11:09 am
K....I know about those...
was hoping there was something I was missing
Thanks!
December 14, 2009 at 9:55 pm
krypto69 (12/14/2009)
I have a DB that gets updated throughout the day.My users need the ability to go back in time and search on data say from the end of last month.
Problem is we don't store any old DB's. So, for example the balance field is updated throughout the day, and never gets archived.
Is there way using snapshots or some other methoed, that would let me users search thru an old copy of the DB?
Do you have individual rows somewhere that is responsible for the current value of that "balance field"?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 14, 2009 at 10:00 pm
You could use snapshots if you have Enterprise edition, but if you need to restore or something happens you'll lose them.
A better solution would be calculate this stuff and store it in the db, or better, in a data warehouse. Maintain some point in time calculations that would be useful in reports.
December 15, 2009 at 6:30 am
Jeff Moden (12/14/2009)
krypto69 (12/14/2009)
I have a DB that gets updated throughout the day.My users need the ability to go back in time and search on data say from the end of last month.
Problem is we don't store any old DB's. So, for example the balance field is updated throughout the day, and never gets archived.
Is there way using snapshots or some other methoed, that would let me users search thru an old copy of the DB?
Do you have individual rows somewhere that is responsible for the current value of that "balance field"?
Most are individual fields, some are calculated fields (ie more then one column)
December 15, 2009 at 6:34 am
Steve Jones - Editor (12/14/2009)
You could use snapshots if you have Enterprise edition, but if you need to restore or something happens you'll lose them.A better solution would be calculate this stuff and store it in the db, or better, in a data warehouse. Maintain some point in time calculations that would be useful in reports.
Almost all of these balance fields are used in several reports.
Does it make more sense to just schedule a report to be saved to a disk, or to build out an entire data warehouse for these 10 -20 fields?
If the answer is data warehouse, then any tips advise appreciated.
I'm also intersted in why I couldn't or wouldn't want to use snapshots? Wouldn't that enable my users to serach historical data (prior balances)?
December 15, 2009 at 6:45 am
This may be too simple for your situatiion but you can archive data rows using a new table and an update trigger.
Basically, when an update is made to a table, the update trigger copies the existing row(s) in question to the new table. This way you can query when the rows were changed.
Hope this helps.
December 15, 2009 at 7:13 am
Without capturing the required data at specific points in time for reporting, about the only other suggestion I have is to back out of the data the transactions entered after the given point in time you are querying. It may be a bit complex, but it is all I can think of in this situation.
December 15, 2009 at 10:52 am
krypto69 (12/15/2009)
Jeff Moden (12/14/2009)
krypto69 (12/14/2009)
I have a DB that gets updated throughout the day.My users need the ability to go back in time and search on data say from the end of last month.
Problem is we don't store any old DB's. So, for example the balance field is updated throughout the day, and never gets archived.
Is there way using snapshots or some other methoed, that would let me users search thru an old copy of the DB?
Do you have individual rows somewhere that is responsible for the current value of that "balance field"?
Most are individual fields, some are calculated fields (ie more then one column)
Sorry.... I wasn't clear. Do you have the original data somewhere to recalculate all of these balances?
--Jeff Moden
Change is inevitable... Change for the better is not.
December 15, 2009 at 12:36 pm
No Jeff,
The balance data is updated throughout the day and is a rolling balance.
Do I don't really have a way..
December 15, 2009 at 12:48 pm
krypto69 (12/15/2009)
No Jeff,The balance data is updated throughout the day and is a rolling balance.
Do I don't really have a way..
The balance may be a rolling balance, but if you have the individual transactions available that affect the balance, you should be able to roll that information out back to the approriate date.
December 15, 2009 at 12:53 pm
I don't really have access to the individual transactions. I know that sounds odd, but this is a core system for us, they do not want it tampered with directly.
So, I was hoping to use snapshots for them to hit against, for the historical data they need. And actually it would only be one or two people that would need to access the snapshot data and report off of.
December 16, 2009 at 7:47 am
Really, without getting into backups, the easiest way I can see to do this is the capture the data in a table. If you need to know the value every time it changes, you need a trigger to populate a history table. If you just need a kind of survey of the data, you could schedule a job to select the current values into a history table that runs every x minutes (if once an hour is OK for your needs, that really wouldn't be much extra load on the system at all). A job populating a table is a little more convenient that a report sitting on a drive because you can manipulate the data more easily.
December 16, 2009 at 8:21 am
I agree. You need the detail with a time stamp on each record. Then you can filter based on the time stamp date. Do a SUM on the amount column to get your 'as of' balance. There would be no way to do this from a balances table.
Viewing 15 posts - 1 through 15 (of 16 total)
You must be logged in to reply to this topic. Login to reply