Wednesday, March 28, 2012
help on SQL server backup!
I have a problem right now. We got a production server running. Now we want
to setup an another identical database at a remote office. The problem is
that replication can't be done between the two offices. To make sure the
remote office will have as much data as the production server. What shall I
do?
Help!!!!Hi
backup/restore commands. (see in BOL)
"big tony" <bigtony@.discussions.microsoft.com> wrote in message
news:C9CD538F-05AD-4CE4-8A87-45EAFEAEE024@.microsoft.com...
> Dear all,
> I have a problem right now. We got a production server running. Now we
want
> to setup an another identical database at a remote office. The problem is
> that replication can't be done between the two offices. To make sure the
> remote office will have as much data as the production server. What shall
I
> do?
> Help!!!!
help on SQL server backup!
I have a problem right now. We got a production server running. Now we want
to setup an another identical database at a remote office. The problem is
that replication can't be done between the two offices. To make sure the
remote office will have as much data as the production server. What shall I
do?
Help!!!!Hi
backup/restore commands. (see in BOL)
"big tony" <bigtony@.discussions.microsoft.com> wrote in message
news:C9CD538F-05AD-4CE4-8A87-45EAFEAEE024@.microsoft.com...
> Dear all,
> I have a problem right now. We got a production server running. Now we
want
> to setup an another identical database at a remote office. The problem is
> that replication can't be done between the two offices. To make sure the
> remote office will have as much data as the production server. What shall
I
> do?
> Help!!!!
help on SQL server backup!
I have a problem right now. We got a production server running. Now we want
to setup an another identical database at a remote office. The problem is
that replication can't be done between the two offices. To make sure the
remote office will have as much data as the production server. What shall I
do?
Help!!!!
Hi
backup/restore commands. (see in BOL)
"big tony" <bigtony@.discussions.microsoft.com> wrote in message
news:C9CD538F-05AD-4CE4-8A87-45EAFEAEE024@.microsoft.com...
> Dear all,
> I have a problem right now. We got a production server running. Now we
want
> to setup an another identical database at a remote office. The problem is
> that replication can't be done between the two offices. To make sure the
> remote office will have as much data as the production server. What shall
I
> do?
> Help!!!!
sql
Monday, March 19, 2012
Help needed! DBCC CHECKDB - consistency errors
After restoring the SQL Server 2000 user database backup into one of the SQL
Server 2000 instances I get database consistency errors. I restored this
database a couple of times and every time I get the errors; however they are
not consistent - different types of errors, different tables and indexes get
affected. I restored the same database backup into a different server and
ran dbcc checkdb over it - no errors occurred. Something causes corruption
in the database on one particular server.
Here are the errors:
DBCC results for 'tTREE_COMPONENTS'.
Server: Msg 8928, Level 16, State 1, Line 1
Object ID 1467308437, index ID 0: Page (1:251481) could not be processed.
See other errors for details.
Server: Msg 8944, Level 16, State 1, Line 1
Table error: Object ID 1467308437, index ID 0, page (1:251481), row 44. Test
(ColumnOffsets <= (nextRec - pRec)) failed. Values are 87 and 57.
There are 663 rows in 16 pages for object 'tTREE_COMPONENTS'.
DBCC results for 'tACCUMULATORS'.
There are 10234724 rows in 97149 pages for object 'tACCUMULATORS'.
CHECKDB found 0 allocation errors and 2 consistency errors in table
'tACCUMULATORS' (object ID 1467308437).
DBCC results for 'WATSTARTDATETP'.
Server: Msg 8928, Level 16, State 1, Line 1
Object ID 1905493917, index ID 4: Page (3:224866) could not be processed.
See other errors for details.
Server: Msg 8941, Level 16, State 1, Line 1
Table error: Object ID 1905493917, index ID 4, page (3:224866). Test (sorted
[i].offset >= PAGEHEADSIZE) failed. Slot 159, offset 0x1 is invalid.
Server: Msg 8942, Level 16, State 1, Line 1
Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
(sorted[i].offset >= max) failed. Slot 0, offset 0x9f overlaps with the prior
row.
There are 4 rows in 1 pages for object 'WATSTARTDATETP'.
DBCC results for 'ACCRUALTRAN'.
There are 5919148 rows in 150538 pages for object 'ACCRUALTRAN'.
CHECKDB found 0 allocation errors and 3 consistency errors in table
'ACCRUALTRAN' (object ID 1905493917).
Could it be that our IO subsystem is causing corruption? I am thinking
about running SQLIOSim and SQLIOStress..
If you could please take a look at the errors and give me your thoughts it
would be greatly appreciated.
Thank you in advance,
JuliaJulia,
My only suspicion, after reading your description, is that you are probably
running into a bad disk or array. And, if so, you need to determine if that
is true and fix it right now.
RLF
"DBCC CHECKDB - consistency errors"
<DBCCCHECKDBconsistencyerrors@.discussions.microsoft.com> wrote in message
news:94E38ACE-9F29-4B76-8B3A-2CF1467AC9B2@.microsoft.com...
> Hello All,
> After restoring the SQL Server 2000 user database backup into one of the
> SQL
> Server 2000 instances I get database consistency errors. I restored this
> database a couple of times and every time I get the errors; however they
> are
> not consistent - different types of errors, different tables and indexes
> get
> affected. I restored the same database backup into a different server and
> ran dbcc checkdb over it - no errors occurred. Something causes
> corruption
> in the database on one particular server.
> Here are the errors:
> DBCC results for 'tTREE_COMPONENTS'.
> Server: Msg 8928, Level 16, State 1, Line 1
> Object ID 1467308437, index ID 0: Page (1:251481) could not be processed.
> See other errors for details.
> Server: Msg 8944, Level 16, State 1, Line 1
> Table error: Object ID 1467308437, index ID 0, page (1:251481), row 44.
> Test
> (ColumnOffsets <= (nextRec - pRec)) failed. Values are 87 and 57.
> There are 663 rows in 16 pages for object 'tTREE_COMPONENTS'.
> DBCC results for 'tACCUMULATORS'.
> There are 10234724 rows in 97149 pages for object 'tACCUMULATORS'.
> CHECKDB found 0 allocation errors and 2 consistency errors in table
> 'tACCUMULATORS' (object ID 1467308437).
> DBCC results for 'WATSTARTDATETP'.
> Server: Msg 8928, Level 16, State 1, Line 1
> Object ID 1905493917, index ID 4: Page (3:224866) could not be processed.
> See other errors for details.
> Server: Msg 8941, Level 16, State 1, Line 1
> Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
> (sorted
> [i].offset >= PAGEHEADSIZE) failed. Slot 159, offset 0x1 is invalid.
> Server: Msg 8942, Level 16, State 1, Line 1
> Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
> (sorted[i].offset >= max) failed. Slot 0, offset 0x9f overlaps with the
> prior
> row.
> There are 4 rows in 1 pages for object 'WATSTARTDATETP'.
> DBCC results for 'ACCRUALTRAN'.
> There are 5919148 rows in 150538 pages for object 'ACCRUALTRAN'.
> CHECKDB found 0 allocation errors and 3 consistency errors in table
> 'ACCRUALTRAN' (object ID 1905493917).
> Could it be that our IO subsystem is causing corruption? I am thinking
> about running SQLIOSim and SQLIOStress..
> If you could please take a look at the errors and give me your thoughts it
> would be greatly appreciated.
> Thank you in advance,
> Julia
>
>|||Russell, thank you so much for such a quick response. In my company in order
to make the server administrators to run Dell hardware diagnostics I
basically need to prove that itâ's a bad disk issue, but there are no errors
in the Event Viewer log and I donâ't think we have the smoking gun in SQL
Server 2000 that would point to the cause of the consistency error?
"Russell Fields" wrote:
> Julia,
> My only suspicion, after reading your description, is that you are probably
> running into a bad disk or array. And, if so, you need to determine if that
> is true and fix it right now.
> RLF
> "DBCC CHECKDB - consistency errors"
> <DBCCCHECKDBconsistencyerrors@.discussions.microsoft.com> wrote in message
> news:94E38ACE-9F29-4B76-8B3A-2CF1467AC9B2@.microsoft.com...
> > Hello All,
> >
> > After restoring the SQL Server 2000 user database backup into one of the
> > SQL
> > Server 2000 instances I get database consistency errors. I restored this
> > database a couple of times and every time I get the errors; however they
> > are
> > not consistent - different types of errors, different tables and indexes
> > get
> > affected. I restored the same database backup into a different server and
> > ran dbcc checkdb over it - no errors occurred. Something causes
> > corruption
> > in the database on one particular server.
> >
> > Here are the errors:
> >
> > DBCC results for 'tTREE_COMPONENTS'.
> > Server: Msg 8928, Level 16, State 1, Line 1
> > Object ID 1467308437, index ID 0: Page (1:251481) could not be processed.
> > See other errors for details.
> > Server: Msg 8944, Level 16, State 1, Line 1
> > Table error: Object ID 1467308437, index ID 0, page (1:251481), row 44.
> > Test
> > (ColumnOffsets <= (nextRec - pRec)) failed. Values are 87 and 57.
> > There are 663 rows in 16 pages for object 'tTREE_COMPONENTS'.
> >
> > DBCC results for 'tACCUMULATORS'.
> > There are 10234724 rows in 97149 pages for object 'tACCUMULATORS'.
> > CHECKDB found 0 allocation errors and 2 consistency errors in table
> > 'tACCUMULATORS' (object ID 1467308437).
> >
> > DBCC results for 'WATSTARTDATETP'.
> > Server: Msg 8928, Level 16, State 1, Line 1
> > Object ID 1905493917, index ID 4: Page (3:224866) could not be processed.
> > See other errors for details.
> >
> > Server: Msg 8941, Level 16, State 1, Line 1
> > Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
> > (sorted
> > [i].offset >= PAGEHEADSIZE) failed. Slot 159, offset 0x1 is invalid.
> >
> > Server: Msg 8942, Level 16, State 1, Line 1
> > Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
> > (sorted[i].offset >= max) failed. Slot 0, offset 0x9f overlaps with the
> > prior
> > row.
> > There are 4 rows in 1 pages for object 'WATSTARTDATETP'.
> >
> > DBCC results for 'ACCRUALTRAN'.
> > There are 5919148 rows in 150538 pages for object 'ACCRUALTRAN'.
> > CHECKDB found 0 allocation errors and 3 consistency errors in table
> > 'ACCRUALTRAN' (object ID 1905493917).
> >
> > Could it be that our IO subsystem is causing corruption? I am thinking
> > about running SQLIOSim and SQLIOStress..
> >
> > If you could please take a look at the errors and give me your thoughts it
> > would be greatly appreciated.
> >
> > Thank you in advance,
> >
> > Julia
> >
> >
> >
>
>|||Julia,
Last time I had a similar problem, I finally proved it by running:
CHKDSK D:
It spat out errors that none of the monitoring tools had found. In my case,
it was not the disk, but the RAID array that had gone bad. There were no
Event log errors, no (for us) HP / Compaq warning messages, etc. But the
array was still bad.
Of course, I could be wrong, but this is my best guess based on the
symptoms.
RLF
(Going home now, so I cannot follow up any more tonight.)
"DBCC CHECKDB - consistency errors"
<DBCCCHECKDBconsistencyerrors@.discussions.microsoft.com> wrote in message
news:064B60C9-080E-4B5D-9657-23FDBD6B0C1A@.microsoft.com...
> Russell, thank you so much for such a quick response. In my company in
> order
> to make the server administrators to run Dell hardware diagnostics I
> basically need to prove that it's a bad disk issue, but there are no
> errors
> in the Event Viewer log and I don't think we have the smoking gun in SQL
> Server 2000 that would point to the cause of the consistency error?
> "Russell Fields" wrote:
>> Julia,
>> My only suspicion, after reading your description, is that you are
>> probably
>> running into a bad disk or array. And, if so, you need to determine if
>> that
>> is true and fix it right now.
>> RLF
>> "DBCC CHECKDB - consistency errors"
>> <DBCCCHECKDBconsistencyerrors@.discussions.microsoft.com> wrote in message
>> news:94E38ACE-9F29-4B76-8B3A-2CF1467AC9B2@.microsoft.com...
>> > Hello All,
>> >
>> > After restoring the SQL Server 2000 user database backup into one of
>> > the
>> > SQL
>> > Server 2000 instances I get database consistency errors. I restored
>> > this
>> > database a couple of times and every time I get the errors; however
>> > they
>> > are
>> > not consistent - different types of errors, different tables and
>> > indexes
>> > get
>> > affected. I restored the same database backup into a different server
>> > and
>> > ran dbcc checkdb over it - no errors occurred. Something causes
>> > corruption
>> > in the database on one particular server.
>> >
>> > Here are the errors:
>> >
>> > DBCC results for 'tTREE_COMPONENTS'.
>> > Server: Msg 8928, Level 16, State 1, Line 1
>> > Object ID 1467308437, index ID 0: Page (1:251481) could not be
>> > processed.
>> > See other errors for details.
>> > Server: Msg 8944, Level 16, State 1, Line 1
>> > Table error: Object ID 1467308437, index ID 0, page (1:251481), row 44.
>> > Test
>> > (ColumnOffsets <= (nextRec - pRec)) failed. Values are 87 and 57.
>> > There are 663 rows in 16 pages for object 'tTREE_COMPONENTS'.
>> >
>> > DBCC results for 'tACCUMULATORS'.
>> > There are 10234724 rows in 97149 pages for object 'tACCUMULATORS'.
>> > CHECKDB found 0 allocation errors and 2 consistency errors in table
>> > 'tACCUMULATORS' (object ID 1467308437).
>> >
>> > DBCC results for 'WATSTARTDATETP'.
>> > Server: Msg 8928, Level 16, State 1, Line 1
>> > Object ID 1905493917, index ID 4: Page (3:224866) could not be
>> > processed.
>> > See other errors for details.
>> >
>> > Server: Msg 8941, Level 16, State 1, Line 1
>> > Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
>> > (sorted
>> > [i].offset >= PAGEHEADSIZE) failed. Slot 159, offset 0x1 is invalid.
>> >
>> > Server: Msg 8942, Level 16, State 1, Line 1
>> > Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
>> > (sorted[i].offset >= max) failed. Slot 0, offset 0x9f overlaps with the
>> > prior
>> > row.
>> > There are 4 rows in 1 pages for object 'WATSTARTDATETP'.
>> >
>> > DBCC results for 'ACCRUALTRAN'.
>> > There are 5919148 rows in 150538 pages for object 'ACCRUALTRAN'.
>> > CHECKDB found 0 allocation errors and 3 consistency errors in table
>> > 'ACCRUALTRAN' (object ID 1905493917).
>> >
>> > Could it be that our IO subsystem is causing corruption? I am thinking
>> > about running SQLIOSim and SQLIOStress..
>> >
>> > If you could please take a look at the errors and give me your thoughts
>> > it
>> > would be greatly appreciated.
>> >
>> > Thank you in advance,
>> >
>> > Julia
>> >
>> >
>> >
>>|||> I restored the same database backup into a different server and
> ran dbcc checkdb over it - no errors occurred. Something causes
> corruption
> in the database on one particular server.
I agree with Russell's analysis. I think the facts that the corruption only
occurs on one server and manifests itself in different ways ought be enough
proof for the server admins to run hardware diagnostics.
--
Hope this helps.
Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/
"DBCC CHECKDB - consistency errors"
<DBCCCHECKDBconsistencyerrors@.discussions.microsoft.com> wrote in message
news:064B60C9-080E-4B5D-9657-23FDBD6B0C1A@.microsoft.com...
> Russell, thank you so much for such a quick response. In my company in
> order
> to make the server administrators to run Dell hardware diagnostics I
> basically need to prove that itâ's a bad disk issue, but there are no
> errors
> in the Event Viewer log and I donâ't think we have the smoking gun in SQL
> Server 2000 that would point to the cause of the consistency error?
> "Russell Fields" wrote:
>> Julia,
>> My only suspicion, after reading your description, is that you are
>> probably
>> running into a bad disk or array. And, if so, you need to determine if
>> that
>> is true and fix it right now.
>> RLF
>> "DBCC CHECKDB - consistency errors"
>> <DBCCCHECKDBconsistencyerrors@.discussions.microsoft.com> wrote in message
>> news:94E38ACE-9F29-4B76-8B3A-2CF1467AC9B2@.microsoft.com...
>> > Hello All,
>> >
>> > After restoring the SQL Server 2000 user database backup into one of
>> > the
>> > SQL
>> > Server 2000 instances I get database consistency errors. I restored
>> > this
>> > database a couple of times and every time I get the errors; however
>> > they
>> > are
>> > not consistent - different types of errors, different tables and
>> > indexes
>> > get
>> > affected. I restored the same database backup into a different server
>> > and
>> > ran dbcc checkdb over it - no errors occurred. Something causes
>> > corruption
>> > in the database on one particular server.
>> >
>> > Here are the errors:
>> >
>> > DBCC results for 'tTREE_COMPONENTS'.
>> > Server: Msg 8928, Level 16, State 1, Line 1
>> > Object ID 1467308437, index ID 0: Page (1:251481) could not be
>> > processed.
>> > See other errors for details.
>> > Server: Msg 8944, Level 16, State 1, Line 1
>> > Table error: Object ID 1467308437, index ID 0, page (1:251481), row 44.
>> > Test
>> > (ColumnOffsets <= (nextRec - pRec)) failed. Values are 87 and 57.
>> > There are 663 rows in 16 pages for object 'tTREE_COMPONENTS'.
>> >
>> > DBCC results for 'tACCUMULATORS'.
>> > There are 10234724 rows in 97149 pages for object 'tACCUMULATORS'.
>> > CHECKDB found 0 allocation errors and 2 consistency errors in table
>> > 'tACCUMULATORS' (object ID 1467308437).
>> >
>> > DBCC results for 'WATSTARTDATETP'.
>> > Server: Msg 8928, Level 16, State 1, Line 1
>> > Object ID 1905493917, index ID 4: Page (3:224866) could not be
>> > processed.
>> > See other errors for details.
>> >
>> > Server: Msg 8941, Level 16, State 1, Line 1
>> > Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
>> > (sorted
>> > [i].offset >= PAGEHEADSIZE) failed. Slot 159, offset 0x1 is invalid.
>> >
>> > Server: Msg 8942, Level 16, State 1, Line 1
>> > Table error: Object ID 1905493917, index ID 4, page (3:224866). Test
>> > (sorted[i].offset >= max) failed. Slot 0, offset 0x9f overlaps with the
>> > prior
>> > row.
>> > There are 4 rows in 1 pages for object 'WATSTARTDATETP'.
>> >
>> > DBCC results for 'ACCRUALTRAN'.
>> > There are 5919148 rows in 150538 pages for object 'ACCRUALTRAN'.
>> > CHECKDB found 0 allocation errors and 3 consistency errors in table
>> > 'ACCRUALTRAN' (object ID 1905493917).
>> >
>> > Could it be that our IO subsystem is causing corruption? I am thinking
>> > about running SQLIOSim and SQLIOStress..
>> >
>> > If you could please take a look at the errors and give me your thoughts
>> > it
>> > would be greatly appreciated.
>> >
>> > Thank you in advance,
>> >
>> > Julia
>> >
>> >
>> >
>>
Help needed with Backup and Restore
to another server with the same "everything"
What do I need to do in order to automate this if it is possible
Vincento"Vincento Harris" <wumutek@.yahoo.com> wrote in message
news:2fa13ee7.0410121038.777ed048@.posting.google.c om...
> If I decide to backup my transaction logs on one server and move them
> to another server with the same "everything"
> What do I need to do in order to automate this if it is possible
>
> Vincento
It sounds like you're looking for log shipping - if you have SQL 2000
Enterprise Edition, then check out the information in Books Online. If you
don't, then it's still relatively easy to implement something yourself:
http://www.winnetmag.com/Article/Ar...3231/23231.html
http://sqlguy.home.comcast.net/logship.htm
http://www.sql-server-performance.c...og_shipping.asp
Also search Google for "log shipping" and you should get plenty of hits.
Simon
Friday, March 9, 2012
Help needed in restoring the document library
I am working in the SQL Server 2000 and Share Point Portal Server; we are
maintaining the SQL Backup for all the sites,
one of the users has deleted accidentally a document library from a
particular site. Can you please help me in restoring the particular document
library from the SQL Backup File?
Here are details of how to do this through the dedicated backup/restore
tool:
http://office.microsoft.com/en-us/sharepointportaladmin/HA011603461033.aspx
As this is not really a replication issue I'd recommend posting this in the
Sharepoint newsgroup.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
Help Needed Disadter Recovery!
We are going to have to re-install Windows and SQL Server.
Our backup failed last night.
When we re-install Windows we going to be able to see the drives in with our .mdf and .ldf file on them.
After we re-install sql server 2000 will we be able to run sp_dbattach to re-connect the mdf and ldf files?
Please help!
SimonYou will be able to atach database but if you had replication going on it will fail.
Wednesday, March 7, 2012
Help Needed - How Can I Set Up a Backup SQL Server Machine as an Exact Copy of My Producti
My problem is that I need to set up a backup SQL Server 2000 machine
which can be used in case of a failure to my primary. All databases
(30 as of now) must be an up to the minute exact copy of production
and include most recent changes in data as well as any structure
changes (Tables, Views, SP's, Triggers, Users . . etc).
When I tried this using Transactional Replication, the replication
process gets fouled up once I introduce any kind of structure changes
to the DB. I've considered the idea of doing periodic backups and
restoring it to my backup SQL server, but this does not give me the
concurrency needed with 0 latency.
I've seen articles that recommend using Transaction Replication with
'Scheduled Table Refresh', and also doing database dumps to restore on
the backup machine, but I have not been able to find any documentation
regarding this to try out. How can I implement this type of backup
strategy in SQL 2000?"Michael Orlando" <mjorlando@.campsystems.com> wrote in message
news:354e82fa.0310301256.12671603@.posting.google.c om...
> Any help would be greatly appreciated.
> My problem is that I need to set up a backup SQL Server 2000 machine
> which can be used in case of a failure to my primary. All databases
> (30 as of now) must be an up to the minute exact copy of production
> and include most recent changes in data as well as any structure
> changes (Tables, Views, SP's, Triggers, Users . . etc).
Clustering.
Though technically that's not a copy.
> When I tried this using Transactional Replication, the replication
> process gets fouled up once I introduce any kind of structure changes
> to the DB. I've considered the idea of doing periodic backups and
> restoring it to my backup SQL server, but this does not give me the
> concurrency needed with 0 latency.
If you use transactional replication you have to use sp_repladdcolumn and
sp_repldropcolumn for adding dropping columns. All other schema changes
generally have to be run against both copies.
Note also there's no guarantee as to the latency that Transactional
replication will introduce.
Log shipping will allow exact copies, but again with a built in latency.
I'd recommend picking up "SQL Server 2000 High Availability " from MS Press
and reading that.
> I've seen articles that recommend using Transaction Replication with
> 'Scheduled Table Refresh', and also doing database dumps to restore on
> the backup machine, but I have not been able to find any documentation
> regarding this to try out. How can I implement this type of backup
> strategy in SQL 2000?|||mjorlando@.campsystems.com (Michael Orlando) wrote in message news:<354e82fa.0310301256.12671603@.posting.google.com>...
> Any help would be greatly appreciated.
> My problem is that I need to set up a backup SQL Server 2000 machine
> which can be used in case of a failure to my primary. All databases
> (30 as of now) must be an up to the minute exact copy of production
> and include most recent changes in data as well as any structure
> changes (Tables, Views, SP's, Triggers, Users . . etc).
> When I tried this using Transactional Replication, the replication
> process gets fouled up once I introduce any kind of structure changes
> to the DB. I've considered the idea of doing periodic backups and
> restoring it to my backup SQL server, but this does not give me the
> concurrency needed with 0 latency.
> I've seen articles that recommend using Transaction Replication with
> 'Scheduled Table Refresh', and also doing database dumps to restore on
> the backup machine, but I have not been able to find any documentation
> regarding this to try out. How can I implement this type of backup
> strategy in SQL 2000?
What exactly do you mean by 'up to the minute'? The only other
'instant' alternative to transactional replication is clustering,
which would also avoid your schema change issues.
I don't know much about replication myself, so you might want to post
to microsoft.public.sqlserver.replication with your backup question.
Also, have a look at the October 2003 issue of SQL Server Magazine,
which had a number of articles on various high-availability solutions.
Simon
Friday, February 24, 2012
Help me understand/engineer a backup strategy.
Some of you know my other posts.. pleading for help with a problem (that's really sort of fixed itself/not remanifested itself).
Upon this whole ordeal I decided to re-evaluate my nonchelant backup strategy. Which currently is:
Backup our DB daily w/ transaction logs. (overwrite the backup daily on the tape).
Backup our DB weekly w/ transaction logs.
I rotate the tape weekly, on Monday morning. So there is a weekly backup and the last backup from monday morning on each tape.
Along with that I have some optimizations and shrinks I run.
Reading through the SQL BOL. It seems my strategy is ok, however if we lost the db at the end of the day, we'd lose a full days worth of work.
So. Here in lay the questions.
The BOL states to possibly back up twice a week, with differential daily backups and 4 hour transaction logs (example).
So, I sorta get that..
I make a device, "COMPANY.BAK", which writes to my external 'tape' unit.
I make a job to back up the complete DB on sunday. to "COMPANY.BAK". (Not sure if I tell it to truncate the transaction log?).
I make another job to make nightly differential backups to "COMPANY.BAK" with the 'append to media' switch on.
I make yet ANOTHER job to make a transaction log backup. Here's what I don't get. If I set this thing to run every 4 hours, since it's not a differential backup.. rather incremental.. doesn't it just overwrite itself each time? It doesn't append itself to the backup right? So how much data could be missing if the log is overwriting itself rather than appending to itself? Also, if I turn on truncate log on backup, aren't I missing possibly critical transactions from the log for a sucessful restore?
I guess I'm a bit befuddled here.How big are your backup files?
My default strategy is a nightly full backup and hourly transaction log dumps between 6:00 am and 8:00 pm (working hours). All backups and log dumps are to disk, but the new files are immediately copied to a network location.
That way, I have point in time recovery for database corruption using the local files, and hourly recovery from the network file copies should the server accidently get smashed by a loose gorrilla or fall into the vat of KY Jelly (perhaps I'm giving away too much about my workplace...).|||Ok. but how do you set the log file to backup every "X" hours? When I set it up, it seems like it'll overwrite the previous log backup?
My DB is in the 7GB range, right now my logfile is 1GB (dunno how to trim it, necessarily).
How do I keep a sane size log but not run into problems with restoring a broken DB (If this should ever happen?)
I'm lost, trying to be a dba when in fact I'm not.
Don't you also need to do database differentials? If you have a backup and 6AM, but crash at 7:45 am... and have no db diffs, dont you lose 1 3/4 hours of work? or can you roll that back with the logs?|||No, you do not need to do differentials. You can restore a database to any point in time using only the most recent full backup, the log dumps that have occured since then, and whatever can be recovered from the current transaction log.
Using the maintenance plan wizard you can create a job that runs the sqlmaint utility. This utility will create database backups and log backups, each with a unique name so that they are never overwritten, and can be set to delete files older than X days so that your disk doesn't fill up. My backup job command looks like this:
[EXECUTE xp_sqlmaint N'-PlanName AllDatabases -Rpt e:\SQLBackup\BackupDatabases.rpt -WriteHistory -BkUpDB e:\SQLBackup -BkUpMedia DISK -DelBkUps 5Days -CrBkSubDir'[/code]
You absolutely MUST read (or re-read) the BOL section on database and log backups so that you understand the difference between the two, and know what a differential backup is for. Then read the section on xp_sqlmaint. Then come back to the forum for any additional help.|||Ok.
I'm grasping this a bit better. Thank you.
What I guess I *STILL* don't get is the role of the transaction log. Say I back up at 6, crash at 7:45. If I have logs every 2 hours, I've lost everything from 6 - 7:45, right?
Ok, so, say I had logs in 15 minute intervals. So I could restore up to 7:30. But how does a "LOG" (to me a log is just a log of what's happened, like when I fish through my apache logs on my FreeBSD server). So how does a "LOG", restore data that wasn't in the database at the backup at 6am?
Does the LOG basically log every insert, delete etc query, with the data being changed?
So say my users add a new client to the DB at 7... when does it actually get written to the MDF, as opposed to sitting around in the LDF? At the next DB backup? At the next Transaction Log Backup?
When is it safe to get rid of logs? I'm assuming after a full or differential backup is done? Since everything that's been 'committed' is now backed up to a .BAK?
FWIW I have been reading the BOL administrators pocket consultant. Is this not the right one to use for backup references?|||Does the LOG basically log every insert, delete etc query, with the data being changed?
Yep. Every change made to a database is first written into the log. Only after the write to the log has been reported successful by the O/S will SQL Server (Or any other RDBMS worth getting) will write the change to the data files.
When to get rid of the logs is up to you. You >could< keep them for years, but they will only be as good as the full backup(s) before them. It all depends on what your users are willing to live with as far as data loss. Point in time recovery is also useful when the DBA (Database Arsonist) comes along and wipes out a table or two. He will usually not let you know about this, until he has tried to cover up his mistake with a few tries that usually only make things worse. This could take a couple hours depending on how many users there are, how many tricks the DBA knows, and how long it takes him to finally own up to making a mistake.
Since you only have a 1GB log, it probably does not take up a lot of space on the tape. Too many backups is a better ptoblem than too few, in my opinionated opinion ;-).|||Point in time recovery is also useful when the DBA (Database Arsonist) comes along and wipes out a table or two. He will usually not let you know about this, until he has tried to cover up his mistake with a few tries that usually only make things worse. This could take a couple hours depending on how many users there are, how many tricks the DBA knows, and how long it takes him to finally own up to making a mistake.Did we used to work together?|||Alright, thanks again folks.
This is my current strategy.
1) Backup db nightly at midnight to tape
2) Backup tlogs from 7a-7p in 1 hr increments (I dont need to backup the t-log right after the nightly db backup, right?)
3) Backup the system db's weekly (midnight on Sunday)
4) Run a reoganize optimization weekly (Sunday morning) on our primary db
5) Run a DB shrink on Sunday morning (weekly) on our primary db.|||Looks fine. I generally backup the system dbs nightly as well. Not necessary, but it costs practically nothing and I believe the simplicity increases reliability.
Now, have you ever TRIED restoring a database?
Do it (not on your production system).
Restore a backup.
Restore a backup and the first three or four transaction logs.
Try a point-in-time restore.
The time to learn how to restore databases is BEFORE you have to restore a database, and no un-tested backup strategy is a safe backup strategy.
Like it or not, you are the DBA for your group, and you are going to have to set aside a couple hours each week for admin.|||I don't see testing the restore part of your strategy. Make sure you have confidence that you can recover your databases by implementing disaster recovery drills ... or you might find that your tape has unrecoverable errors that prevent restores.
Lots of folks prefer backup first to disk, then save that file to either tape or another disk storage device. Also to disk and hold for a couple of days helps when you get the inevitable call "... I screwed up a table and need help restoring x number of rows or the business will go down the tubes in the next y hours"
And it will happen ... remember ... Murphy was an optimist! That's my creedo and guiding light!|||I would take out the shrink step, unless you are really hurting for disk space. Growing database files is a somewhat expensive in disk activity, so it should be avoided if possible.
The only other thing to mention is that backups of a database block each other, so if you try to run a full and a log backup at the same time, one of the backups will have to wait for the other to finish. Probably not a problem in your case, but good to know.
Did we used to work together?
Nope. But the same "DBA" has probably worked for both our companies.|||Ok. Thanks again.
I'll remove the shrink step, although the db seems rather swollen at this time (12gb, as opposed to 7 when it's shrunken).
As far as testing a restore. I have not. This is the only SQL server in the whole building. Does that mean I cannot test it?
Can I not try and restore the DB to another db name? such as foo-restore-test or something?
I was originally backing up to disk, and then running a nightly NTBACKUP job to move those to my tape(redundancy, yah?) but I found myself sort of hunting and pecking for time in the morning for the db to backup, and then yet another job to run (after I am SURE the backup was complete (usually hours later) .|||Backing up to disk, and then letting the filesystem backup collect the file is actually pretty common. A lot of DBA (The real sort) like to have the latest copy of the database handy, so they don't have to go sorting through tapes to find the one with the latest backup. Some places even send their tapes off site for storage, in case the whole building burns down.
You can restore the database with a new name, but you will also need to move the datafiles, or you will get "File Exists" errors when you try the restore. Hunt around in the backup/restore software for anything that looks like "move datafile".|||Alright. I'll look into backing up to disk and try and find an easy way to backup to my tape setup too. I'd like to the tape to get the hourly tlog backups too. Just in case, ya never know, right?
The NTBACKUP way just seems a bit... rudamentary. Since it'll put everything in a large backup archive, which I'd have to restore (ie let the system extract the data from the archive), and then run a sql restore.
I'd rather just have the tape mirror my disk backup on some sort of schedule. I'm not aware of a way to do that in SBS2k3 Premium without using NTBACKUP.|||Now that I think of it, wouldn't there be a way to have the SQL Maintenance manager duplicate the data? Or would that do the actual backing up part twice?
I see I can do it with the non wizarded backup, I can tell it to go to LOCAL and TAPE (just make two backup 'devices'). It seems to work... I tested it on the master db.
My only problem with that is I see no logging option there or way to tell it how many days to keep.|||Alright. So far everything is going O.K here. Except my backup failed this morning because the SQLMAINT isn't deleting backups older than "X" days, and my tape had 4 daily backups on it (instead of two). So, then my tran log this morning failed for the same reason because it tried to make an 8GB log (since the backup failed it couldn't mark to truncate everything before the backup, which included a dbreindex).
So, I moved the backups back to the local drive.. so the space problem wont occur anymore, but I need a way to 'mirror' the backups to my tape as they happen... both for creation and deletion.
What can I do for that?|||There should be some sort of setting for how long data remains protected on the tape, before something can overwrite it. If not, you can probably do the poor-man's version of this, and keep a set of tapes that you rotate through. When one set of backups is old enough, you just put that tape in and overwrite it all.|||Yeah I've got it set to keep daily backups for 2 days, tran logs for 2 days etc. I rotate tapes out weekly. But for some reason it's not deleting the backups... (if the drive is set to my tape, versus the hdd).
On top of that, watching the log files before I started backing up soley to tape. It creates the new .BAK before deleting the older .BAK's (this is when I had them storing to the hdd full time). Shouldn't it delete .bak's before adding them? Shrugs.
I'll fix that problem by telling SQLEM to write backups to the hdd again, no problems there. I just need a way to replicate it to my tape without actually running another backup process. It seems telling SQLEM to write to two devices stripes the backup, rather than duplicates.|||I believe the only way SQL Server can "delete" a file on tape is to overwrite it. Do you have any way to see the contents of the tape?|||Yeah, I can browse to it like it's a drive letter. It's not a 'tape' in the true essence. But SQLEM seems to treat it as such.|||The maintenance plan will probably try to delete the file from tape in the same way that the command line delete command works. Try to delete a file using the delete command. You may want to try this with an old tape, or a tape from a test system, if available. ;-)|||That's just it. SQLEM will deleted from C:\Backups\daily\bleh.bak just fine. But E:\backups\daily it just seems to ignore it.. It's sort of futile anyway, since I'd rather have it back up to the C: drive and replicate to the tape (thus once the SQLEM deletes 2 day old backups, the replication does the same). I just cant find a way to do it without using NTBACKUP. (yuck).|||[quote=Mindflux]
On top of that, watching the log files before I started backing up soley to tape. It creates the new .BAK before deleting the older .BAK's (this is when I had them storing to the hdd full time). Shouldn't it delete .bak's before adding them? Shrugs.
[\quote]
Not in this space-time continum. If you delete a previous backup, and the current backup fails, you would have no backup. This is microsoft's way of preventing you from shooting yourself in the foot!|||Ah, yeah. I get your point there.
Hadn't though microsoft would ever do something to help the user ;)
Help me to restore this database!!!
Hi,
I have a database named 'ePos' and i want to make
a copy from it by backup this database then restore
it as a new one with another name.
I use this commands:
sp_addumpdevice 'disk',
'ePosTest1',
'c:\test1.bak'
BACKUP DATABASE ePos TO ePosTest1 WITH INIT
GO
RESTORE DATABASE ePos_new FROM ePosTest1
GO
I have this error when restoring :
Server: Msg 1834, Level 16, State 1, Line 7
The file 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\ePos2006.mdf' cannot be overwritten. It is being used by database 'ePos2006'.
How can i restore the database with new filesys? how i can fix this problem?
PLZ help.
Regards.
For best results, try posting this in a different forum more related to your issue. At the top of the screen, you will see the forum hierarchy. (MSDN Forums >> SQL Server >> SQL Server Integration Services...) Click on the SQL Server part of that tree to see the full list of forums related to SQL Server.I'd suggest trying the disaster recovery forums.|||This thread was originally posted in SSIS forum...moved to Disaster Recovery and Availability|||
By default, SQL backups are restored to the same path as the original database.
In your case, you want to have the same content in different files, so you'll need to use the WITH MOVE clause:
RESTORE DATABASE ePosNew FROM ePosTest1
WITH MOVE 'ePos2006' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\ePosNew.mdf' ,
MOVE 'ePos2006_log' TO 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\ePosNew_log.ldf'
go
You'll have to verify the logical names of your data and log files, but this is the technique.