Database authentication

You can use the Authenticated database property to determine if the database has been authenticated:

SELECT DB_PROPERTY ( 'Authenticated' );

For more information about database properties, see Accessing database property values.

 Authenticate a database
  1. Set the database_authentication option for the database, using the following SQL authentication statement:

    SET OPTION PUBLIC.database_authentication='company=company-name;
         application=application-name;
         signature=database-signature';
    Note

    Line breaks have been added to the syntax example to improve readability. However, the syntax should be executed without line breaks and without spaces between the equal sign and semicolons.

  2. The company-name and application-name arguments are the values you supplied to Sybase when obtaining your signature, and database-signature is the database signature that you received from Sybase.

  3. Restart the database for the option to take effect.

When the database server loads an authenticated database, it displays a message in the database server messages window describing the authenticated company and application. You can check that this message is present to verify that the database_authentication option has taken effect. The message has the following form:

This database is licensed for use with:
Application: application-name
Company: company-name
Tip

You can store the authentication statement in a SQL script file to avoid having to type in the long signature. You can run the SQL script from Interactive SQL by clicking File » Run Script.

If you create a file named authenticate.sql in the scripts subdirectory of your SQL Anywhere installation directory and store the authentication statement in this file, it is applied whenever you create, rebuild, or upgrade a database. See Upgrading authenticated databases.