on 2014 Mar 05 4:32 AM
I have defined a Mainenance Plan using the wizard in Sybase Central (SQLA 12) to execute a daily full image online backup (while de db is running).
I have "instructed" the plan to execute command "CHECKPOINT;" before it starts. Is that necessary? (or is the plan implicitly doing this before starting)
I have included a validation of database pages (Checksum check) at which point I realized that I had better check both "Disconnect all users when maintenance plans runs" and "Disallow logins while the maintenance plan is running" in order not to get false-positives about corruption.
Now, in a case of a failure during the execution of the plan, will that leave the db engine in an unusable state (meaning no client can connect to it anymore because of having both previously mentioned checks on)?
In such a case, will the engine have to be restarted in order to become operational?
I know this is more than one question but please bear with me since I really need some help here. Thank you.
Request clarification before answering.
Ok, following the general consensus here, I have decided to ditch the Wizard in favor of my own script (actually Breck's) to backup an validate.
I have also created a scheduled task (running Windows Server 2008 here) to run the batch and send me a status email.
The most interesting part by far is the script. Here are the main steps (disregarding the boilerplate work to create working directories and send results to a log file):
First make the backup (while DB is running):
dbbackup -c "connstring" -o "log" C:\\backup
Then, copy the backup file to another folder. Then, apply the tran log because while backing up, stuff might have happened to the DB:
dbeng12 -o "log" C:\\PathToDBFile -ad "C:\\PathToOriginalTranLog"
(So -ad "Path" specifies where to go get the tran logs to be applied to the DB)
Then, start a read-only copy of the DB backup because we want to validate it:
dbspawn -f dbeng12 -n readonlycopy -o "log" -r -gf "C:\\PathToCopyOfDBFile"
( -f force start of DB even if one is already running, how cool is that? -r means open DB in readonly, -gf means to disable firing of triggers, if you need it)
Then validate:
dbvalid -c "connstring-to-readonlycopy" -o "log" -q
(-q don't log to client output, 'cause we already do that to a log file)
Then stop the read-only copy
dbstop -c "connstring-to-readonlycopy" -y
(-y stop even with active connections to the server)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Why would you apply the current translog to the backup database? Changes during the backup will be contained in the backup translog automatically.
I would think it would be better to copy both the backup database file and the backup log file to the other folder, and then to simply start the database there via DBVALID (so any required recovery will be done automatically). As it is a copy of the backup, you would not need to start it in read-only mode... I would think that this would really simplify the script, i.e. you would just have 3 (or 4 steps):
Just my 2 cents, apparently:)
User | Count |
---|---|
75 | |
30 | |
9 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.