Forum: Managing VoltDB

Post: How to restore old data in volt db

How to restore old data in volt db
bas
Jul 8, 2013
Hi all,

I am following getting started document on volt db.
I ran these two commands after following all steps.
$ voltdb compile -o helloworld.jar helloworld.sql
$ voltdb create catalog helloworld.jar


$ sqlcmd
1> INSERT INTO HELLOWORLD VALUES( 'Hello','World', 'English');
(1 row(s) affected)
2> SELECT * FROM HELLOWORLD;
HELLO WORLD DIALECT
------ ------ --------
Hello World English
(1 row(s) affected)
3> EXIT


Now i have a single record in my database.
I will close the terminal and again run both compile and create commands, entered into sqlcmd and i want the old record from the statement
SELECT * FROM HELLOWORLD;

But there is no record and my database is empty.
I tried in sqlcmd these things.
1> exec @Pause;
@Pause is not available to this client

5> @SnapshotSave;
Unexpected Ad Hoc Planning Error: java.lang.RuntimeException: Error compiling query: org.voltdb.planner.PlanningErrorException: unknown token

How to get old data which i have entered in first attempt ?
francis
Jul 8, 2013
The @Pause operation puts your DB in admin mode. You must call the @Pause through the admin mode (just a different port).

SnapshotSave operation requires that you send parameters through, which doesn't appear you are doing. See some details here: http://voltdb.com/docs/UsingVoltDB/sysprocsave.php

Once you have your snapshot saved, you can choose to recover the database (rather than create), but if you choose to start your DB with create, you will need to use SnapshotRestore command.
bas
Jul 9, 2013
The @Pause operation puts your DB in admin mode. You must call the @Pause through the admin mode (just a different port).

SnapshotSave operation requires that you send parameters through, which doesn't appear you are doing. See some details here: http://voltdb.com/docs/UsingVoltDB/sysprocsave.php

Once you have your snapshot saved, you can choose to recover the database (rather than create), but if you choose to start your DB with create, you will need to use SnapshotRestore command.


My problem got solved. I was using exec @Pause; with semicolon so it was giving error. I removed the semicolon and exec @SnapshotSave in sqlcmd. So i got previously entered data saved when accessed in next time.

Can you please tell what is the admin mode how to go to admin mode ?
francis
Jul 10, 2013
If you are using CLI: http://voltdb.com/docs/UsingVoltDB/clivoltadmin.php

Otherwise, have a look here: http://voltdb.com/docs/UsingVoltDB/RunModes.php

You are essentially authenticating yourself through another port in the DB that is meant for admin actions. It is best described in the documentation. "There are actually two modes of operation for a VoltDB database: normal operation and admin mode. During normal operation clients can connect to the cluster and invoke stored procedures (as allowed by the security permissions set in the application catalog and deployment files). In admin mode, only clients connected through a special admin port are allowed to initiate stored procedures. Requests received from any other clients are rejected."
bas
Jul 11, 2013
Thank You. Got it.