Trying to understand backup

I'm trying to figure out how a database backup works.  Suppose I back up
the database and transaction log, and truncate the log.  The next day I
back up just the log.  A couple of days later I want to restore to the
second backed-up version.  I restore the first backup database and log,
then run the engine with '-a' to apply changes from the second log.

First, is that the correct procedure?  Second, did I really need the
first backup log to do that?  In other words, if I back up a database
and truncate the log, is there anything in the pre-truncate log that I
need to restart that database?  Or would I have done as well to restore
the database, delete the log, and run the engine with '-f'?  (To get
back to the first backup, in this case, not the second.)

-- 
"Oh, shootings.  Yes, but that doesn't mean Americans are more violent
than other people.  We're just better shots."
0
drifkind
7/9/1999 7:08:02 PM
sybase.sqlanywhere.general 32637 articles. 4 followers. Follow

11 Replies
253 Views

Similar Articles

[PageSpeed] 6

The procedure you outlined in the first paragraph was mostly right, with one
little tidbit of information to add.  When you take an on-line backup (ie.
the database is running when you run dbbackup), we back up the database file
and then the log file.  This means that there might be transaction in the
backed up log file that don't exist in the backed up database.  So, in a
recovery situation, you should always apply the log file that was backed up
with your database before applying an subsequant log files.  I think that
answered the first two questions in your second paragraph.

You should NEVER NEVER NEVER NEVER NEVER NEVER (you get the idea) use the -f
switch on your database unless your database won't start and you do not have
a valid backup.  Using the -f switch will prevent subsequant log files from
applying to the database, because when the engine shuts down on recovery, it
will checkpoint and modify the log offset of the database.

NEVER run the -f switch in a normal recovery situation.  NEVER.

Reg Domaratzki
Sybase Tech Support


David Rifkind wrote in message <3787484c.99456170@forums.sybase.com>...
>I'm trying to figure out how a database backup works.  Suppose I back up
>the database and transaction log, and truncate the log.  The next day I
>back up just the log.  A couple of days later I want to restore to the
>second backed-up version.  I restore the first backup database and log,
>then run the engine with '-a' to apply changes from the second log.
>
>First, is that the correct procedure?  Second, did I really need the
>first backup log to do that?  In other words, if I back up a database
>and truncate the log, is there anything in the pre-truncate log that I
>need to restart that database?  Or would I have done as well to restore
>the database, delete the log, and run the engine with '-f'?  (To get
>back to the first backup, in this case, not the second.)
>
>--
>"Oh, shootings.  Yes, but that doesn't mean Americans are more violent
>than other people.  We're just better shots."

NEVER.


0
Reg
7/9/1999 7:49:17 PM
"Reg Domaratzki" <rdomarat@sybase.com> wrote:


>NEVER.

Tell us how you *really* feel!

Breck
0
NOSPAM__bcarter
7/10/1999 12:40:07 AM
There was an EXCELLENT newsletter that the Mobile and Embedded Computing 
staff put together that covers backups.

Here is a URL to the page that lists all the newsletters:
http://sdn.sybase.com/sdn/mec/mec_docs_news.stm
-- 
Jim Egan [TeamSybase]
Dynamic Data Solutions, Inc. http://www.dyn-data.com
Houston, TX
0
jegan
7/10/1999 4:48:47 AM
On Fri, 9 Jul 1999 15:49:17 -0400, "Reg Domaratzki"
<rdomarat@sybase.com> wrote:
>The procedure you outlined in the first paragraph was mostly right, with one
>little tidbit of information to add.  When you take an on-line backup (ie.
>the database is running when you run dbbackup), we back up the database file
>and then the log file.  This means that there might be transaction in the
>backed up log file that don't exist in the backed up database.  So, in a
>recovery situation, you should always apply the log file that was backed up
>with your database before applying an subsequant log files.  I think that
>answered the first two questions in your second paragraph.

Let's say I have the running database and log files in one directory and
the backup files in another.  I copy the database file from the backup
directory to the working directory.  When I apply the first backup log,
should there be a log file (another copy of the backup log) in the
working directory?  Or will the engine get everything it needs from the
log file it's applying?

>You should NEVER NEVER NEVER NEVER NEVER NEVER (you get the idea) use the -f
>switch on your database unless your database won't start and you do not have
>a valid backup.  Using the -f switch will prevent subsequant log files from
>applying to the database, because when the engine shuts down on recovery, it
>will checkpoint and modify the log offset of the database.
>
>NEVER run the -f switch in a normal recovery situation.  NEVER.

I think what I hear you telling me is that I shouldn't use the -f
switch, but I'm not certain of that....

>David Rifkind wrote in message <3787484c.99456170@forums.sybase.com>...
>>I'm trying to figure out how a database backup works.  Suppose I back up
>>the database and transaction log, and truncate the log.  The next day I
>>back up just the log.  A couple of days later I want to restore to the
>>second backed-up version.  I restore the first backup database and log,
>>then run the engine with '-a' to apply changes from the second log.
>>
>>First, is that the correct procedure?  Second, did I really need the
>>first backup log to do that?  In other words, if I back up a database
>>and truncate the log, is there anything in the pre-truncate log that I
>>need to restart that database?  Or would I have done as well to restore
>>the database, delete the log, and run the engine with '-f'?  (To get
>>back to the first backup, in this case, not the second.)

-- 
"Oh, shootings.  Yes, but that doesn't mean Americans are more violent
than other people.  We're just better shots."
0
drifkind
7/10/1999 5:01:39 AM
I'm assuming that the working directory is not the same as the production 
directory.

First copy both the db and log file from the base backup (when the 
database and the log were backed up together in one session).
Apply the log file to the database.  There _may_ be transactions that 
need to be applied.
Next copy in any log files that were from subsequent backups and apply 
those (in order from oldest to newest of course) to the database.
Finally, copy in the log file from the production directory and apply 
that also.

That should be it and if your production log file wasn't corrupted then 
you should be back in business with no loss of data except for those 
transactions that had not been committed when the database went down.
-- 
Jim Egan [TeamSybase]
Dynamic Data Solutions, Inc. http://www.dyn-data.com
Houston, TX
0
jegan
7/10/1999 5:32:59 AM
Jim,

I tried to get to the newsletters via this link, but became trapped in
"Login or Create a new account" hell. No matter what button I press,
whether I fill in a potential userid/password pair or leave 'em blank,
the only response I get is "Invalid Login, please verify username and
password."

Is the page broken? (This is not directed to Jim necessarily, but to
anybody who might happen to know the answer.) If not, what is the magic
incantation that will let me get to the newsletters?

Kathleen

Jim Egan wrote:
> 
> There was an EXCELLENT newsletter that the Mobile and Embedded Computing
> staff put together that covers backups.
> 
> Here is a URL to the page that lists all the newsletters:
> http://sdn.sybase.com/sdn/mec/mec_docs_news.stm
> --
> Jim Egan [TeamSybase]
> Dynamic Data Solutions, Inc. http://www.dyn-data.com
> Houston, TX
0
Kathleen
7/10/1999 5:03:05 PM
I presume you haven't already set up your SDN account (which is free).
If that is true, maybe the dialog will work better if you go in higher
up in the food chain http://sdn.sybase.com/sdn and choose "member
login". Then click on Create New Account *without* filling in the user
id and password. Set up your account, and *then* use the direct URL
Jim provided.

BTW, that direct URL worked for me, possibly because I already *had* a
user id which I entered at that point.

Plus, I always keep a dead chicken handy, for waving over the keyboard
:)

As far as I can tell, all interactive web sites (and Sybase is no
exception) are designed and maintained by summer interns on drugs.
Only one exception comes to mind: www.google.com, a masterpiece of
effective simplicity.

Breck

"Kathleen M. Beaumont" <KATBEAU@ix.netcom.com> wrote:

>Jim,
>
>I tried to get to the newsletters via this link, but became trapped in
>"Login or Create a new account" hell. No matter what button I press,
>whether I fill in a potential userid/password pair or leave 'em blank,
>the only response I get is "Invalid Login, please verify username and
>password."
>
>Is the page broken? (This is not directed to Jim necessarily, but to
>anybody who might happen to know the answer.) If not, what is the magic
>incantation that will let me get to the newsletters?
>
>Kathleen
>
>Jim Egan wrote:
>> 
>> There was an EXCELLENT newsletter that the Mobile and Embedded Computing
>> staff put together that covers backups.
>> 
>> Here is a URL to the page that lists all the newsletters:
>> http://sdn.sybase.com/sdn/mec/mec_docs_news.stm
>> --
>> Jim Egan [TeamSybase]
>> Dynamic Data Solutions, Inc. http://www.dyn-data.com
>> Houston, TX

0
NOSPAM__bcarter
7/10/1999 6:01:24 PM
Breck Carter wrote:
> 
> I presume you haven't already set up your SDN account (which is free).

Who knows? It amazes me how many sites require me to set up an account
for what is likely to be a one-time visit, and then make me nuts if I
happen to come back at some future time. As if I'll remember what user
name and password I used! And if I don't remember, the page argues with
me about having set up an account before. 

> If that is true, maybe the dialog will work better if you go in higher
> up in the food chain http://sdn.sybase.com/sdn and choose "member
> login". Then click on Create New Account *without* filling in the user
> id and password. Set up your account, and *then* use the direct URL
> Jim provided.

Still no go, but thanks for the suggestion. It just loops around to the
same page, having done nothing. It must be connected to my Reload Page
button.

> As far as I can tell, all interactive web sites (and Sybase is no
> exception) are designed and maintained by summer interns on drugs.

<g> 

But seriously... could a Sybase person look into this please? I started
to submit a bug report, but even THAT process is hideous.

Thanks,
Kathleen, who really would like to see that newsletter Jim mentioned.
0
Kathleen
7/11/1999 8:27:42 PM
I just tried out the link Jim specified, using a different
workstation, and it works without a hitch using Netscape 4.51. Perhaps
the problem is on the client side; have you tried emptying the browser
caches?

Breck
0
NOSPAM_bcarter
7/12/1999 1:53:56 PM
On Sun, 11 Jul 1999 13:27:42 -0700, "Kathleen M. Beaumont"
<KATBEAU@ix.netcom.com> wrote:
>Thanks,
>Kathleen, who really would like to see that newsletter Jim mentioned.

OK, but is that your correct email address? My message to you is stuck
in our mail server. You can reach me at bcarter@bcarter.com *and*
bcarter@vmicls.com (use both for faster service on newsletter delivery
:)

Breck
0
NOSPAM_bcarter
7/12/1999 7:09:34 PM
I already sent them to her.
-- 
Jim Egan [TeamSybase]
Dynamic Data Solutions, Inc. http://www.dyn-data.com
Houston, TX
0
jegan
7/12/1999 8:05:02 PM
Reply:

Similar Artilces:

sqlanywhere backup
Hello, is there any possibility to backup sql anywhere with arcserve software ? DmS wrote: > Hello, is there any possibility to backup sql anywhere with > arcserve software ? Doing a search for "Arcserve" using Google Groups, I found a number of threads that cover this topic: http://tinyurl.com/a86u4 [shortcut to Google Groups] The basic answer is that there is no "ASA client" for Arcserve, so what you can do is use an EVENT in ASA to backup the database to a directory and have Arcserve backup that directory. Hope this helps, greg.fenton ...

Trying to understand...
Someone just hit me over 70 times inside 3 minutes on TCP ports over 63700 from 200.192.240.8. I dropped my connection and picked up a new IP, but is there really anything other than an attempt to invade my box that this kind of activity could be? Just trying to get an education... nospam@myaddress.com wrote: > > Someone just hit me over 70 times inside 3 minutes on TCP ports over > 63700 from 200.192.240.8. I dropped my connection and picked up a new > IP, but is there really anything other than an attempt to invade my box > that this kind of activity could be? J...

Backup What Backup?
--____BKJDRTALSVZHZOVVWDZK____ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Content-Disposition: inline; modification-date="Wed, 9 Dec 2008 04:32:10 -0500" V2UgaGF2ZSBOZXR3YXJlIDYuNS43IGFuZCBHcm91cHdpc2UgNy4wMy4gIEZpdmUgUG9zdCBvZmZp Y2VzIG9uIDUgZGlmZmVyZW50IHNlcnZlcnMuDQoNCldlIHdhbnQgdG8gcmVwbGFjZSBvdXIgY3Vy cmVudCBCYWNrdXAgc29sdXRpb24uDQpJZiBZT1UgY291bGQgY2hvb3NlIGEgbmV3IGJhY2t1cCBz eXN0ZW0gZm9yIHlvdXIgR3JvdXB3aXNlIHN5c3RlbSwgV2hhdCB3b3VsZCB5b3UgY2hvb3NlIGFu ZCBXaHk/DQpXaGF0IHdvdWxkIHlvdSByZWNvbW1lbmQgdGhhdCBJIHVzZT8= --____BKJDRTALSVZHZOV...

Trying to understand
Ok, I'm been trying to understand the new ADO.net thing, and it seems pretty simple, as long as your using databound controls.Unfortunatly, I have a lot of pages that I can just ad a grid view to and make the things look right, so I'm trying to understand how to programatically access ADO.net.Below is an example of some of the simplest code I need to convert and any help would be aprreciated.set connectionToDatabase=server.createobject("adodb.connection")connectionToDatabase.connectiontimeout=60connectionToDatabase.open "DSN=ServiceCalls"set rc=server.CreateObject...

Backup
We'd like to give remote users the option to backup their SQLAnywhere DBs to diskette but I was told by Sybase that DBBACKUP will not span disks. Is this correct and if so, are there any alternatives (other than using standard backup or ZIP utilites)? TIA, Joe Regan Joe, This is not true. I just backed up a test database running on a server on my C drive to a floppy on my A drive. HTH, Carson ---------------------------------------------------------------------------- Carson Hager Dynamic Data Solutions Team Powersoft http://w...

Backup; How and what should I backup?
Ok thinking about reinstalling and I really don't want to lose some of my setting but it's no big deal if I have to. I have a space USB drive and have backed up my doc's pic's and downloads but what about my setting? Now if I do back them up and I reinstall the software will it pick those setting up or mess them up? -- D1 openSUSE 11.2 WinXP64 KDE 4.3.5 AMD 64 X2 6000+ nVidia GTX 260 16GB RAM Gig MB L1 openSUSE 11.1 WinXP Pentium 4 3.06GHz KDE 3.5 ATI RV250 Graphics 1GB RAM ProStar 888E L2 openSuse 11.3RC2 KDE4.4.4 beta Celeron 1.4GHz Intel 855GM 2GB RAM Toshi...

Backup in SQLAnywhere
How does one back up to tape. The documentation indicates that it can be done but does not give any instructions for doing it. AFAIK there is no support for backup direct to tape. You'll have to backup to a file and then use a tape backup utility to backup that file. -- Jim Egan [TeamPS] Dealer Solutions, LLC Houston, TX ...

trying and trying
Name: otto de koningh Email: ottodotdedotkoninghatskynetdotbe Product: Firefox Release Candidate Summary: trying and trying Comments: what a weird robot !! please refrain from using these horrendous figures i like the motorcycle though shown on the add-ons page i am having trouble because there is an unknown dump on firefox - never encountered this ! your browser is otherwise top of the bill !! from Firefox Setup 1.5.0.3 onwards in May 2006 Firefox has become a true companion ! now with Firefox Setup 3.0 RC1 i have error reports ! how come ? Browser Details: Mozilla/5.0 (...

What generals generally do
Reading a McChrystal thread elsewhere, I came across someone quoting a US general http://en.wikipedia.org/wiki/Smedley_Butler > I spent 33 years and four months in active military service and > during that period I spent most of my time as a high class thug for > Big Business, for Wall Street and the bankers. In short, I was a > racketeer, a gangster for capitalism. I helped make Mexico and > especially Tampico safe for American oil interests in 1914. I helped > make Haiti and Cuba a decent place for the National City Bank boys to > collect revenues in. I ...

Backup
We'd like to give remote users the option to backup their SQLAnywhere DBs to diskette but I was told by Sybase that DBBACKUP will not span disks. Is this correct and if so, are there any alternatives (other than using standard backup or ZIP utilites)? TIA, Joe Regan Joe, This is not true. I just backed up a test database running on a server on my C drive to a floppy on my A drive. HTH, Carson ---------------------------------------------------------------------------- Carson Hager Dynamic Data Solutions Team Powersoft http://w...

Backup of SQLAnywhere
I would like to automatically shutdown SQLAnywhere as part of my backup and then restart it when the backup ends. I am using BackupExec and know that I can issue "pre and post" backup commands. I'm sure this is very simple but I need help! An example, etc would be greatly appreciated. Thanks, -- Tom J. Peterson Wayne Wire Cloth If you are on NT just start and stop the service. Find the services in Control Panel. Find your service name and then use that: NET STOP "SQL Anywhere - SADEMO" NET START "SQL Anywhere - SADEMO" -- Jim E...

backup your backups?
.. . especially if CDs go bad in under 2 years . . The Dutch PC-Active magazine has done an extensive CD-R quality test. For the test the magazine has taken a look at the readability of discs, thirty different CD-R brands, that were recorded twenty months ago. The results were quite shocking as a lot of the discs simply couldn't be read anymore: http://www.cdfreaks.com/news/7751 ...

Understanding log backups
Trying to understand what goes on with dbbackup with the -r -t options. It would appear that I get a truncated copy of the current log in the specified directory with the name <DBName>.LOG. This file is deleteable. I also get the current <DBName>.LOG file renamed to YYMMDDxx.LOG and it's read-only. Then a new <DBName>.LOG file replaces it. What I'd like to know is - what is the difference between the YYMMDDxx.LOG file and the truncated logfile created in my specified directory? Also, is it OK for me to grab the YYMMDDxx.LOG files and move them elsew...

Trying to understand some things
I'm not very technical, so I apologize in advance if what I'm asking doesn't quite make sense. I have a Maxtor 80GB drive that was my primary drive until it started having data and OS corruption problems. I ran the Maxtor utility Powermax and the basic test indicated the drive needed advanced testing. The advanced test indicated that the drive was failing. I did NOT do a Powermax low level format. The exisiting data on the drive was unimportant because it had been backed up, but I was hoping to "fix" the drive in hopes of using it for occassional backups of my ...

Web resources about - Trying to understand backup - sybase.sqlanywhere.general

Resonate Social For Facebook Helps Advertisers Understand Users’ Motivations
Why do Facebook users make the decisions they make? Resonate wants to help advertisers find out, so the digital marketing outfit launched Resonate ...

Facebook PMD Gigya releases Consumer Insights to better understand user identities
... allows marketers to easily query Gigya’s Identity Storage database and tie identity information with key performance indicators to understand ...

Genius by Rap Genius — Search and understand the meaning of song lyrics, poetry, literature, and news ...
Get Genius by Rap Genius — Search and understand the meaning of song lyrics, poetry, literature, and news on the App Store. See screenshots and ...

All sizes - Understand Abundance & Breath - Flickr - Photo Sharing!
Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to ...

Kate Micucci & Tony Thaxton - "Puppets Understand" - YouTube
Subscribe for more Nerdist Presents: http://nerdi.st/subscribe Written and Performed by KATE MICUCCI & TONY THAXTON Watch Duo: http://youtu.be/Tj5RLliHNMQ ...

Scientists continue search to understand Mers
The Mers coronavirus continues to confound scientists. To better understand the disease and determine where it comes from, a new project set ...

Explainer Video of the Day: Author John Green Helps You Understand Boko Haram
... in the news, but the situation in Nigeria with the Islamist terrorist group Boko Haram often gets overlooked and can be difficult to understand. ...

The Aussie rules love affair and one who can't understand it
Football (the AFL variety) and I have always had a tumultuous relationship. I've never really understood its allure, but it's always been there, ...

14 Accounting Terms Everyone In Small Business Needs To Understand
Like any profession, accounting has what seems to be impenetrable jargon to outsiders. But, also like most professions, the jargon is just shorthand ...

Tony Abbott doesn't understand the China challenge
The Australian government's new attitude towards China's foreign policy underestimates that country's determination to change the geopolitical ...

Resources last updated: 12/25/2015 5:30:46 PM