Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

(click on this box to dismiss)

Restore delete database

Hello.... first sorry for my bad english... im a braziliam...

I have a database named TESTE and i make a backup lvl 0 in manager.

this database was deleted... but i have the file with backup...

i create again database e go to restore option... 

select the file with backup and...


Time: 08/29/13 16:39:49.015 - ERROR *** file ..\..\src\storage\file_io.c, line 9746 ERROR CODE = -633 Tran = -1, EID = 1

\lixo\teste_backup_lv0 is a backup of database d:\CUBRID\databases\teste\teste created on Wed Aug 28 20:57:28 2013 instead of given database d:\CUBRID\databases\teste\teste created on Thu Aug 29 16:38:48 2013


Time: 08/29/13 16:39:49.015 - FATAL ERROR *** file ..\..\src\transaction\log_page_buffer.c, line 10667 ERROR CODE = -644 Tran = -1, EID = 2

LOG FATAL ERROR: logpb_restore

call stack dump: NOT available in this platform


now how to restore a deleted database ?


link comment (0)
asked last year
37 Answers

Backup/Restore db utilities work a bit different, their porpose being to do log restoring on a database to a point in time. Since you've already deleted your database, you will have to follow the steps described in the manual in the section Backup & Restore on different servers. The basic idea is to start with no database but with a fully specified database in the %CUBRID%\databases\databases.txt file.

link comment (1)
answered last year

\lixo\teste_backup_lv0 is a backup of database d:\CUBRID\databases\teste\teste created on Wed Aug 28 20:57:28 2013 instead of given database d:\CUBRID\databases\teste\teste created on Thu Aug 29 16:38:48 2013

The above error message says that the the database where you would like to restore the full backup is not the same database which the full backup was created from. The reason why this is the problem is the following.

If you see the error it says your original database was created 1 day before the target new database. It is possible that within this day between Wed Aug 28 20:57:28 2013 and Thu Aug 29 16:38:48 2013 there were some transactions logged. Now, how should these transactions in this period be reflected in the new database? The new database does not have this time frame. This is why restoredb utility reports this error message.

How to solve this problem?

All you have to do is not to create the new database manually but let the restoredb utility create it for your from the backup file. Imagine the following scenario.

  1. On nodeA you have original database called demodb.
  2. To see where this database is located you check the databases.txt file. If CUBRID Server is installed at /opt/cubrid, then databases file may be located in /opt/cubrid/databases/databases.txt. In your case it may be in another location. The contents of the databases.txt file is the following:
    #db-name        vol-path                db-host         log-path                lob-base-path
    demodb          /opt/cubrid/databases/demodb    localhost       /opt/cubrid/databases/demodb    file:/opt/cubrid/databases/demodb/lob 
  3.  you made a full backup of the demodb database.
  4. The backup file is stored in /home/user/demodb_bk0v000 where demodb_bk0v000 is the backup filename. You can notice that the name says that this is the full backup file.
  5. Now imagine that for some reason your original demodb database is somehow deleted but you still have the backup file.

Now you should do the following.

  1. Edit databases.txt file of CUBRID Server on nodeA (the target environment) to add the same information about the original database so that the new databases.txt has the same demodb database information as follows:
    #db-name        vol-path                db-host         log-path                lob-base-path
    demodb          /opt/cubrid/databases/demodb    localhost       /opt/cubrid/databases/demodb    file:/opt/cubrid/databases/demodb/lob
  2. Notice that we have only changed the databases.txt file but have not created the demodb database actually.
  3. Now since we have our backup file at /home/user/demodb_bk0v000 we can start restoring it.
  4. Run the following to restore from the backup.
    cd /home/user
    cubrid restoredb -u -B . demodb
  5.  In the above command the option -u tells the restoredb utility to find the target database information from the databases.txt file. If -u option is specified, restoredb utility will create the database automatically for you.
  6. The -B option following by . (dot) tell the restoredb utility where to look for the backup file. Since we have already changed the directory into /home/user, by specifying the . (dot) we tell that the backup file is located in the current directory.
  7. As a result the following restore output is displayed:
    /home/vagrant$ cubrid restoredb -u -B . demodb         
    CUBRID 2008 R4.4

That's all. Now you have restored the demodb database from the backup file even thogh the original database is deleted.

If you have other questions, feel free to ask. We will be glad to answer you.

link comment (0)
answered last year

You are either using a very old browser or a browser that is not supported.
In order to browse you need to have one of the following browsers:

Internet Explorer: Mozilla Firefox: Google Chrome: