- When you copy database files all of them need to be from exactly the same time, and it will be very complicated/impossible to copy hundrets of Gigabytes in the same moment
- All the transactions should be hold in the time when the external backup is run
That is why in Sybase there is a command allowing to freeze all the transactions, so that the files can be easily copied using the external tool. Sybase has found a way this conditions can be met - just all the transactions should be frozen for the time of external copy process. In the same time data can be read, however if you decide to initiate the transaction, that this transaction will hang until the freeze will be finished. Unfortunately since that time also all read operations will hang waiting for the freeze end.
Take a look at this example:
QUIESCE DATABASE Maintenance1 HOLD MyDb GO USE MyDb GO SELECT * FROM TEST GO INSERT TEST VALUES('A new value')
Here administrator plans to make a copy of MyDb files. So he initiates quiesceing of that database. Such operation needs to have a name, that is here Maintenance1. After this operation INSERT will stop working. The first SELECT will be executed with no additional delay, but the INSERT will hang.
In the same time in a second session similar activities can be initiated:
USE MyDb GO SELECT * FROM TEST GO
In this example, the SELECT will hang as well!. That is caused by a still not executed insert from the first session:
However, when the maintenance will be finished with a command like:
QUIESCE DATABASE Maintenance1 RELEASE GO
All the other frozen INSERTs or SELECTs will be executed in the correct order:
- restore them
- or
- leave as "in restore" and with time apply additional log dumps, making the second server up-to-date.
No comments:
Post a Comment