Switch to standard view 
  Sybase logo
 
 
 



The dbstop command in the example above references the ASA database started in the SQLAny.init file.

Starting the database

The easiest way to start the database server is using a script. The following steps explain how to create a SQLAny.init file that starts the database.

To create a script to start the database

  1. Using TextEdit, create a file in /Applications/SQLAnywhere9/ named SQLAny.init with the following contents:
  2. Customize the command to start your database as necessary. For information about command-line options, see the chapter "Running the Database Server" in the Adaptive Server Anywhere Database Administration Guide.

 

Stopping the database

You need a separate script to stop the database. The following instructions explain how to create a SQLAny.fini file that stops the database.

To create a script to stop the database

  1. Using TextEdit, create a file in /Applications/SQLAnywhere9/ named SQLAny.fini with the following contents:
  2. Customize the command to start your database as necessary. For information about command-line options, see "Stopping the database server" in the chapter "Running the Database Server" in the Adaptive Server Anywhere Database Administration Guide.

 

Creating the startup item’s folder and contents

To create the startup item’s folder and contents

  1. Using an account with the authority to create a folder in /Library/StartupItems, create a folder named SQLAnywhere.
  2. Within the SQLAnywhere folder, create a file named SQLAnywhere with the following contents:

    #!/bin/sh

    ##
    # SQLAnywhere
    ##

    . /etc/rc.common

     

    StartService ()
    {

      /Applications/SQLAnywhere9/SQLAny.init
      ConsoleMessage -s "Starting SQLAnywhere services"
    }

    StopService ()
    {

     

      /Applications/SQLAnywhere9/SQLAny.fini
      ConsoleMessage -s "Stopping SQLAnywhere services"
    }
    RestartService ()
    {
      /Applications/SQLAnywhere9/SQLAny.fini
      /Applications/SQLAnywhere9/SQLAny.init
      ConsoleMessage -s "Restarting SQLAnywhere services"
    }

    RunService $*

  3. Within the SQLAnywhere folder, create a file named StartupParameters.plist with the following contents:
    {
    Description       = "SQLAnywhere DB server";
    Provides           = ("SQLAnywhere");
    Requires           = ("Disks", "Network", "Resolver");
    OrderPreference = "None";
    Messages =
    {
    start = "Starting SQL Anywhere";
    stop = "Stopping SQL Anywhere";
    };
    }
  4. Test the startup item by rebooting and connecting to the server with Interactive SQL (using only the connection parameters "uid=dba;pwd=sql") from the same machine. You should see a brief message on machine startup about "Starting SQL Anywhere", indicating that the startup item is starting.


Back to Top
© Copyright 2010, Sybase Inc.