Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

I have been reading about live backups and I have a question that I can't find the answer to. I need to run dbbackup maybe once a day to get a snap shot of the production database - that can be scheduled using windows scheduling service. Dbbackup -l runs continuously but no where does the docs say how to schedule that. My first thought was to set the live instance up as a service but not sure if that is possible. So how should I setup dbbackup -l so it will run when the server is not logged into or is rebooted?

Thanks.

asked 04 Feb '12, 17:31

jimboidaho's gravatar image

jimboidaho
111141422
accept rate: 0%

edited 04 Feb '12, 20:44

Mark%20Culp's gravatar image

Mark Culp
24.9k10141297

You may want to read the section in the docs about backups - http://dcx.sybase.com/index.html#1201/en/dbadmin/da-new-backup.html - if you haven't already.

(04 Feb '12, 20:37) Mark Culp

Here's another helpful link with further hints from this forum.

(05 Feb '12, 15:26) Volker Barth

Live backups aren't scheduled, they run continuously. The only time a live backup process is NOT running is when it has lost its connection to the database, which probably means the database has crashed and it's time to recover.

One way to set up a live backup is to put a dbbackup command in a *.bat file, surrounded by a GOTO statement, and launch it from the Startup group:

:TRYAGAIN

"%ASANY9%\win32\dbbackup.exe" -c "ENG=ddd;DBN=ddd;UID=dba;PWD=sql;ASTART=NO;LINKS=TCPIP(HOST=localhost;DOBROAD=NONE)" -l livebkup\live_ddd.log -y livebkup

GOTO TRYAGAIN

As far as I can remember (it's been a long time) you can create a full backup at any time and the live log backup automatically suspends itself and then restarts the file... you don't have to stop and restart the dbbackup -l. See http://dcx.sybase.com/index.html#1201/en/dbadmin/da-backup-dbs-4977640.html

When it's time to recover, you start up the old backup you made earlier and apply the live log backup file. It's not for the faint of heart, and requires lots and lots of testing to make sure all the bases are covered. It's also not done very much these days, not after the introduction of high availability which is basically live log backup on 'roids: http://dcx.sybase.com/index.html#1201/en/dbadmin/da-highavailability.html*d5e64307

permanent link

answered 05 Feb '12, 09:21

Breck%20Carter's gravatar image

Breck Carter
32.5k5417261050
accept rate: 20%

edited 05 Feb '12, 09:28

Hi Breck,

I looked at the high availability before and it looked like a pain to setup. So what would be better, live backups or do the old fashioned way of backing up logs every 10 minutes? The database I want to backup is a mobilink consolidated database that does not have any users connected to it. Fail over would not help much because if I lost the consolidated computer, I would loose the remote database as well. I just wanted to make sure the consolidated was saved so I can extract new remote databases from it.

Thanks.

(05 Feb '12, 12:30) jimboidaho
Replies hidden
1

Why would loss of the consolidated computer imply loss of the remote database as well? Surely they are not on the same computer...

IMO HA is easier to set up than live backup; the complexities in the latter are not apparent from the syntax, but rear their ugly head when it comes time to recover. However... HA is not a substitute for regular backup, but a solution for continuous availability in the face of hardware outages. A regular backup is still required to deal with soft corruptions and so on.

FWIW this posting has had good reviews: http://sqlanywhere.blogspot.com/2009/04/demonstrating-high-availability.html

(05 Feb '12, 15:07) Breck Carter

Well, I would suspect that in case a consolidated is broken, and no current backup is available, you usually have to adapt your remotes, too - by re-extracting from the last working consolidated backup, by collecting "current remote data" and other stuff one prefers not to face... That's my guess.

I would recommend a simple regular automatically scheduled backup.

(05 Feb '12, 15:16) Volker Barth

The comment was addressing HA: "Fail over would not help much because if I lost the consolidated computer, I would loose the remote database as well."

My question was asking why, when the consolidated switched over to the secondary, there would be a problem with the remote... the remote isn't involved.

FWIW HA does work with MobiLink :)

(05 Feb '12, 15:47) Breck Carter

Yes the remote and the consolidated are on the same computer. There are two other remotes in different locations syncing to the consolidated as well. I do not let my user use the consolidated directly. If I setup a HA then it might make more sense to move the remote to a different server then the consolidated.

(05 Feb '12, 17:42) jimboidaho

OK. Answered one of my questions. The dbbackup runs from the production server and copies to the backup server. I will schedule that as you described from using the database scheduler. The main question, how to schedule backup -l so it always runds?

Thanks for the answer Vincent. Scheduling my daily backups to the backup computer is really not the question. Of course, I have another question now. Is it necessary to have sql anywhere running for the backups? The main question is about dbbackup -l which says in the docs that it runs continually which to me, means that scheduling will not work. So my question still stands, how to setup dbbackup so it is always running?

permanent link

answered 04 Feb '12, 18:48

jimboidaho's gravatar image

jimboidaho
111141422
accept rate: 0%

edited 04 Feb '12, 19:46

2

If the database is not running and you want to make a backup of it then just copy the database .db and .log files.

(04 Feb '12, 20:35) Mark Culp
1

I would think there are basically four ways to take a backup:

  1. Running a backup regularly (as database backup or just log backup) by a schedule - either scheduled by the OS or internally in the database with events.
  2. Running a backup manually (as database backup or just log backup)
  3. Running a live backup as a continuous process (just logging the log) - as you try to achieve
  4. Just copying the database and log file by OS means.

Options 1-3 work against a running database, option 4 (as Mark has suggested) against a non-running one.

(05 Feb '12, 13:32) Volker Barth
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×84
×6

question asked: 04 Feb '12, 17:31

question was seen: 3,757 times

last updated: 05 Feb '12, 17:42