The forum is currently being migrated to a new host. While the migration happens, the old server is still available. Once the new machine is ready, I will copy the database to the new machine. Feel free to ask and answer questions in the meantime.

How do I know if the database is not presenting problem, so that does not generate a backup of a database invalid (with db error)?

asked 27 Nov '12, 16:02

Walmir%20Taques's gravatar image

Walmir Taques
accept rate: 12%

After creating a backup, start the backup in read-only mode and run the dbvalid.exe utility against it. If dbvalid does not report any errors, then you know that both the backup and the original database are OK.

permanent link

answered 27 Nov '12, 16:04

Breck%20Carter's gravatar image

Breck Carter
accept rate: 20%

How do I run dbvalid through an event database? Its create an event to perform validation of the database automatically?

(28 Nov '12, 09:01) Walmir Taques
Replies hidden
Comment Text Removed

You could use xp_cmdshell to launch dbvalid.exe from inside an event, but I suggest using the Windows - Accessories - System Tools - Task Scheduler to launch a *.bat file because it's easier to administer and track.

...or a chron job in Linux.

(28 Nov '12, 09:11) Breck Carter

While Breck's statement is the official correct one, in case your database is not actively used 24x7 (*), you may also validate the existing database in a "quiet" timespan and then make a backup.

Theoretically, that's a bit more error-prone (the database could become invalid between validation and backup, or the backup itself could fail), but usually the statements in use should notify you accordingly with error messages - and for failing backup processes, you should always have at least one previous "safe" backup.

You may use the Sybase Central Maintenance plan facility to generate such events, if you prefer a GUI-based approach.

(*) Note: Validating a database with active transactions may lead to false positives and is not recommended...

permanent link

answered 28 Nov '12, 09:15

Volker%20Barth's gravatar image

Volker Barth
accept rate: 34%

edited 28 Nov '12, 09:15

Comment Text Removed

Imagine the following scenario. With the main database started, I created an event within that db that does the following process:

IF NOT exists (select null from sysevent where SYSEVENT.EVENT_NAME = 'TEST') then
START TIME '11: 00AM '
ON ('Mon')
START DATE '2012-11-28 '
    CALL sa_validate (owner_name = 'DBA') --- in the database BDBACKUP




permanent link

answered 28 Nov '12, 12:16

Walmir%20Taques's gravatar image

Walmir Taques
accept rate: 12%

edited 17 Sep '13, 11:30

That won't work, as the sa_validate() call relates to the current database of the current connection, and not to the freshly started one.

If you want to valid the backup via an event triggered from your production database, it would be way easier to use xp_cmdshell() to call the DBVALID tool to start and validate the backup in one command, as Breck has sugested.

Why do you want to use an event at all? Does it do the backup before? (Don't get me wrong, events are fine, but for scheduled file-related tasks, the OS scheduler might be easier to setup and monitor, as Breck has pointed out.)

(28 Nov '12, 13:12) 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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 27 Nov '12, 16:02

question was seen: 2,248 times

last updated: 17 Sep '13, 11:30