Sybase Business Intelligence Solutions - Database Management, Data Warehousing Software, Mobile Enterprise Applications and Messaging
Sybase Brand Color Bar
delete

Search for    in all of Sybase.com
view all search results right arrow
  blank
 
 
 
 
 
 
 
 
 
 

 
 
CLICK TO EXPAND NAVIGATION
CLICK TO EXPAND NAVIGATION
 
 
 
 
Support > Technical Documents > Document Types > Technote > Creating an Adaptive Server Anywhere Startup Item ...

Creating an Adaptive Server Anywhere Startup Item on Mac OS X

This document explains how to create a startup item for Adaptive Server Anywhere 9.x on Mac OS X.
 
RSS Feed
 
 
 

    . /Applications/SQLAnywhere9/System/bin/asa_config.sh > /dev/null
    # The following command must be entered all on one line.
    dbsrv9 -n ASA -gd all -ud -o /var/log/englog
    /Applications/SQLAnywhere9/System/asademo.db
    . /Applications/SQLAnywhere9/System/bin/asa_config.sh > /dev/null
    dbstop -c "uid=dba;pwd=sql;eng=ASA" > /dev/null
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.

 

DOCUMENT ATTRIBUTES
Last Revised: Sep 10, 2004
Product: SQL Anywhere
Technical Topics: SQL Anywhere, Database Admin
  
Business or Technical: Technical
Content Id: 1032393
Infotype: Technote
 
 
 

 
© Copyright 2014, Sybase Inc. - v 7.6 Home / Contact Us / Help / Jobs / Legal / Privacy / Code of Ethics