Collection Contents Index Start replicating data PART 3.  Basic SQL pdf/chap11.pdf

First Guide to SQL Anywhere Studio
   PART 2. Getting Results with SQL Anywhere Studio
     CHAPTER 11. Replicating Data with SQL Remote       

Restoring the database and database settings


Once you have completed the tutorial it is important to undo any changes you have made to the database. Make sure that the following steps are completed in order to insure that the settings are reset properly.

  To delete the remote user:
  1. Click the Remote Users folder for the sample database (dba) on the left panel.

  2. Right-click the field user, and select Revoke Remote from the popup menu. Click Yes to remove the user from the list.

  To delete the publication:
  1. Click the Publications folder in the SQL Remote folder.

  2. Right-click DepartmentPub in the right panel and select Delete from the popup menu. Click Yes to confirm the deletion.

  To revoke the publishing status from the sample database:
  1. Click the Users and Groups folder on the left panel.

  2. Right-click the DBA user on the right panel, and select Revoke Publisher from the popup menu.

Revoking a status while running the database    
The status of a user cannot be modified while the user is running the database. Make sure that the user is idle before revoking or invoking a status.

  To restore the original message type settings:
  1. Click the Message Types folder in the SQL Remote folder.

  2. Right-click the File message type in the right panel and select Properties.

  3. Delete the publisher address and click OK to restore the settings.

  To delete the remote database:
  1. Click the Utilities folder on the left panel.

  2. Double-click Erase Database from the right panel. The Erase An Adaptive Server Anywhere Wizard is displayed.

  3. Enter the name of the database you want to erase or click Browse to search for the database. If you followed the tutorial correctly, the database should be stored in your tutorial directory and called field.db.

  4. On the next page, choose to delete a database file and click next to finish erasing the file.

Notes 

Top of page  Restore the data in the database:

The most important part of the cleanup process is to ensure that the changes to the sample database are reversed. The integrity of the sample database is very important in order to carry out other tutorials in later chapters of the manual.

  To delete the inserted data from the sample database:
  1. Connect to the sample database (dba) using Interactive SQL.

  2. Type the following statements in the command window and click Execute:

    DELETE
    FROM department
    WHERE dept_id = 202 
       OR dept_id = 203
       OR dept_name = 'Eastern Sales' 
       OR dept_name = 'Western Sales';
    COMMIT;
  3. Confirm that the data has been deleted by viewing the data in the tables:

    SELECT *
    FROM department

The inserted data has been deleted and the database has been restored to its original state.

Notes 

The previous statements delete only the data that was added specifically in the tutorial. If you have modified the database in any other way, you must reverse the changes you have made.

Top of page  

Collection Contents Index Start replicating data PART 3.  Basic SQL pdf/chap11.pdf