Recreate the sample database (demo.db)

Testing features and completing the tutorials in the SQL Anywhere documentation sometimes results in changes to the sample database that can prevent the successful completion of subsequent tutorials and tests. When this happens, you can restore the sample database to its original state. Alternatively, if you need to preserve the sample database in its current state, then you can recreate the sample database in its original state using a different name. Both methods are presented below.

 Recreate the sample database (Windows)
  1. Run the following command to erase demo.db and create a new copy of the sample database with objects and data:

    newdemo "%SQLANYSAMP12%\demo.db"
  2. When you are prompted, choose to erase any existing files.

 Recreate the sample database (Unix)
  1. Run the following command in the directory where the sample database is located to erase demo.db and create a new copy of the sample database with objects and data:

    newdemo.sh demo.db
  2. When you are prompted, choose to erase any existing files.

 Create a copy of the sample database with a different name (Windows)
  • Run the following command to create a database called mydemo.db that contains objects and data.

    If you do not specify a path, the file is created in the current directory.

    newdemo path\mydemo.db
 Create a copy of the sample database with a different name (Unix)
  • Run the following command to create a database called mydemo.db that contains objects and data.

    If you do not specify a path, the file is created in the current directory.

    newdemo.sh path/mydemo.db