Switch to standard view
Sybase logo  
Sybase logo  
Products | About Sybase | Support



Using Manage Anywhere Studio for the Distribution of SQL Anywhere Software and the Control of a SQL Remote Environment

Preface

SQL Anywhere?s SQL Remote technology is a very powerful tool for the synchronization of data among many remote users. It allows information in a consolidated, or master, database to be published to any number of other computers, as well as updating this same central database from the results of transactions processed on the remote machines.

SQL Remote uses messages to synchronize the data throughout the installation. SQL Remote can pass these messages between computers using a number of methods. It can create files containing the messages and store them in a designated directory, or it can pass messages using common messaging protocols.

Issues that arise in some customer deployments are "How does the SQL Anywhere software get installed on the remote machine" and "How should the databases be distributed?"

This paper investigates the use of Manage Anywhere to solve these problems. This application is designed to manage remote devices, and perform numerous functions on these devices. As a result, Manage Anywhere provides a quick and efficient method to deploy a large number of remote devices.

Overview

Manage Anywhere Studio is a product designed to control software distribution, application management, and system configurations. This document gives detailed information about setting up Manage Anywhere to deploy and maintain remote databases. For more information about Manage Anywhere Studio, see the product's Web page at http://www.sybase.com/mobile_manager.

Manage Anywhere can be used to supervise the distribution of SQL Anywhere software, and remote databases in a SQL Remote environment. After a remote database is extracted, it can be sent to a remote device using Manage Anywhere.

If the FILE message type is being used, Manage Anywhere can be used for exchanging messages, as well.

Setting up an Manage Anywhere Server

Server Overview

Manage Anywhere Studio is a management solution optimized to support mobile users who connect intermittently over low bandwidth. This optimization is accomplished by creating and transmitting Manage Anywhere packages-one or more files that can include data and applications, configuration information and commands-which you customize to meet the needs of individuals and groups.

Manage Anywhere Studio consists of the following applications:

Manage Anywhere Console

The Console, along with Package Editor and the Server, run on the computer that manages the mobile users. They store information in and retrieve information from the Manage Anywhere database, which can be any ODBC compliant database.

Manage Anywhere Package Editor

Package Editor is the application used to create the packages that are sent to remote machines. Packages provide the ability to combine multiple files and commands and then schedule their deployment to remote machines, or save them for future use.

Manage Anywhere Server

The Manage Anywhere Server manages the distribution of packages. It monitors and responds to messages sent by the remote Agents. Its activities are logged in the Server window.

Manage Anywhere Agent

The Agent runs on each mobile and remote computer but is not needed on the computer from which you are managing mobile users.

Server Requirements

The following minimum requirements are necessary for installing Manage Anywhere Studio.

Server Hardware

Server Software Requirements

Installation Procedure

Installing IIS

Microsoft provides information for installing IIS. The information can be viewed at:

http://www.microsoft.com/NTServer/nts/deployment/planguide/Install.asp#iis

Installing Manage Anywhere Server

The Manage Anywhere installation wizard is started by executing the provided setup.exe file. The wizard installs the console, the package editor and the Manage Anywhere Server on the main computer.

When the Manage Anywhere Console (rsadmin.exe) is opened for the first time, the program will start the deployment wizard. The Manage Anywhere Agents can be deployed to client machines at this time. It is not necessary to deploy agents at this time; however, since machines can be deployed at any time.

Deploying Manage Anywhere Agents

An agent is a piece of software approximately 2MB in size that resides on all of the remote devices.

The ?deploy agent wizard? icon, located on the PCs view menu can be used to deploy agents. The wizard asks for an installation directory on the remote devices. All the machines in the same round of deployment will have the agent stored in the same location. (It is possible to run the deployment wizard several times to add more machines to the list of users.)

In the next screen, the Manage Anywhere server name is specified. In some cases, characters such as ?_? cannot be viewed by other machines. If there is a problem connecting using the server machine name, enter the IP address in the server box, using the advanced option.

The Advanced options provide detailed agent configuration information. It is recommended that, before the first set deployment, the advanced options should be explored to see if any may apply.

Manage Anywhere deploys the agent by sending an email to all users, asking them to download and run a setup.exe file. This is the only time that remote devices need to be aware of installation processes. Although Manage Anywhere suggests executing the setup.exe files from the user?s net browser, many browsers are configured not to allow execution. As a result, the setup file may have to be saved to disk, and then executed. Downloading the file is not sufficient to install the agent.

Using Manage Anywhere to set up a Remote User

Once the Manage Anywhere agent is installed on a remote device, software, database information, and message files can be transferred to the remote users.

Installing Database Software

Manage Anywhere provides the ability to distribute applications. The software to be installed is sent to the remote computer in Manage Anywhere packages. These installation files are stored temporarily on the computer. Ensure that the remote device has the appropriate memory available for the application package, before sending large applications.

Many programs including Adaptive Server Anywhere have the ability to install in silent mode. This option provides the opportunity to install all database software in an identical manner on all remote devices. It is also a benefit, since silent installations run without user input and with no indication to the user that an installation is occurring. You can call the Adaptive Server Anywhere setup program from your own setup program in such a way that the Adaptive Server Anywhere installation is silent.

For more information about installing Adaptive Server Anywhere using silent mode, see the ASA 7.0 User?s Guide - PART 5: Database Administration and Advanced Use - Chapter 28: Deploying Databases and Applications - Using a silent installation for deployment.

A second method for installing software is provided by ?creating a difference image?. This procedure involves the Manage Anywhere image function. An image of a computer is taken before the program is installed. Then a second image function is used after the installation to detect changes made to the computer during the installation process. The differences can then be applied to the remote devices.

Some caution is needed when using the second method. Some registry keys depend on each user?s environment. It may be necessary to send a task that edits registry keys along with the image to identify the remote user?s environment rather than using the registry keys in the image.

For more information about this functionality see the Manage Anywhere Studio manual - Creating Difference Images.

Deploying the Remote Database

The deployment of the remote database depends greatly on the number of users.

If there is a small number of users, it might be appropriate to create an individual package for each user. This method takes advantage of the packaging method for transferring the extracted databases.

In most cases, however, it is more efficient to create one package for all combined databases. It methods relies on an ftp call from the remote device to the Manage Anywhere Server in order to retrieve the correct database.

Creating a Deployment Package

  1. Open Manage Anywhere Studio, using ?rsadmin.exe?.
  2. Notice on the left-hand side of the screen that there is a menu of views. Choose the Package view.
  3. Click on ?New Package?
  4. Create a new package using ?New Task?, and clicking ?OK?
  5. Give the task an appropriate name (for example, ?deployDB?)
  6. Package Editor opens, and code may be entered to execute the desired commands

In this example, it is assumed that the names of the remote databases are the users? names. In many cases, the databases should all have the same name if remote applications run with a fixed database name. If databases have the same name, the extracted databases would have to be placed in different directories for retrieval. These retrieval directories could have the names of the users. It is also possible deploy databases using device name, any unique registry value, or a variable created using Manage Anywhere Machine.

The following is an example of the code used to deploy a database:

      
    Message Box:  Title ="Installing remote database", Text = "A remote database is now being..."
    Add entry to log.  Text: "The machine is <MACHINE>"
    Add entry to log.  Text: "The user is <USER>"
    FTP Connect:  server = Prodmec-pc, user = administrator
    FTP Get Multiple Files from remote directory . to local directory c:\sqlremote
    FTP Get File: 0.txt to local directory c:\sqlremote\0
    FTP Get File: <USER>.txt to local directory c:\sqlremote\
    FTP Delete File:  <USER>.db
    FTP Delete File:  <USER>.log
    FTP Disconnect
    Delete File: "c:\sqlremote\0\0.txt"
    Delete File: "c:\sqlremote\<USER>\<USER>.txt"
    Create Shortcut: Remote_database
    Message Box Title = "Steup Complete", Text = "The setup is now finished..."
    

    Add entry to log:

    Information can be added to the log file to debug any process errors. Since this script uses the <USER> variable to retrieve the database, this information can be logged to ensure that the user received the correct database.

    FTP Connect:

    The remote device connects to the server where the extracted databases are stored. In most cases, this server would also be the Manage Anywhere Server.

    When FTP commands are used, Manage Anywhere agents must have the correct permissions to access or modify the files on the FTP server. For more information, see ?Appendix A: Configuring the FTP server?.

    FTP Get Multiple Files from remote directory . to local directory c:\sqlremote:

    In this case the user?s database and the log file are downloaded from the ftp home directory to the remote site. Instead of ?.? for home directory, ?/<USER>/.? could be used if the database file names were the same, but were located in different directories.

    When the command window is opened (double click on the command), the following information is present:

      Remote Directory:  
    .
    Files:
    <USER>.db
    <USER>.log
    Local directory:
    c:\sqlremote

    FTP Get File:

    The next two commands are work-arounds to extend the usability of the Manage Anywhere system. FTP will create a directory if it does not exist before it transfers files into it. If the files that are going into the new directory do not exist on the FTP server, the directory is still created. If the files are not present on the FTP server, however, a warning will be recorded in the log file.

    See ?Appendix B: Creating remote directories? for another solution.

    FTP Disconnect:

    Disconnect from the FTP server.

    Delete File:

    This is also part of the work-around to create the messaging directories on the remote machines. If the files are copied to the remote system, they should be deleted.

    Create Shortcut: Remote_database:

    It might be necessary to create shortcuts for the remote users so that they can easily access the software that has been installed on their machines. This example creates a shortcut to dbremote, so the user can run it manually if desired.

    The following information is inside the command box:

      Program or Document:
    C:\Program Files\Sybase\Adaptive Server Anywhere 6.0\win32\dbremote.exe
    Command-line Arguments:
    -c "uid=<USER>;pwd=sql;dbf=c:\sqlremote\<USER>.db"
    Shortcut Title:
    Remote_database
    Place shortcut in one of the following locations:
    Desktop
    

    There is currently not way to specify a ?start in? directory. Since dbremote.exe should start in the message directory, some user intervention would be necessary the first time dbremote was run manually. On the other hand, if dbremote is always run through scripts, there is no need to create the shortcut.

Sending a Package:

  1. Go to the package view.
  2. Single-click on the package that should be sent.
  3. Click on the ?Send Package? icon.
  4. Select the group, and then the users that need to receive the package.
  5. Choose whether the task has priority over other Manage Anywhere tasks.
  6. Choose whether the download requires a high-speed LAN connection.
  7. Monitor the package from the PCs, Palms, and Windows CEs views. Each package will have log associated with each device. Errors and warnings should be examined after the package has ended.

Message Transfer Using the FILE Message Type

Manage Anywhere can schedule tasks that will occur at regular intervals. A small package can sit on the remote device, and execute at specified times. This functionality is used to transfer message files between the remote devices and the consolidated database.

Creating a Message Transfer Package

This example continues to use the conversions developed when deploying the databases. Each user has a messaging folder designated by user name. The consolidated database has a messaging directory of 0.

The following is an example of the code used to transfer messages:

      
    Gather Files to C:\Messaging\0
    Delete File: "C:\sqlremote\0\*.*"
    FTP Connect:  server = mec-pc, user = administrator
    FTP Get Multiple Files from remote directory \<USER> to local directory C:\sqlremote\<USER>.
    FTP Delete File: \<USER>\*.*
    FTP Disconnect
    

    Gather Files to C:\Messaging\0:

    The gather files command collects all files in a directory, and sends them to the Manage Anywhere Server using package technology. In this case, C:\Messaging is a mapped to the consolidated database machine, so that the consolidated database can run dbremote.

    When the command window is open the following fields are present:

      Use this directory on the Manage Anywhere Server:
    C:\Messaging\0
    Files to gather:
    c:\sqlremote\0\*.*
    

    This step copies all files in the remote database directory that belong to consolidated database into the mapped drive.

    Delete Files: "C:\sqlremote\0\*.*";:

    This command deletes the message files that have been sent. This step is done so that a large number of files do not build up in the remote messaging directories. This step is important, because it would be inefficient to continue to send old message files to the consolidated database.

    FTP Connect: server = mec-pc, user = administrator:

    FTP is the best method to collect messages from the consolidated database. Since the names of the message files are unknown until the user connects, other options which require the file names or the presence of the files before the package is made cannot be used.

    FTP Get Multiple Files from remote directory \<USER> to local directory c:\sqlremote\<USER>:

    All the message files belonging to the user are retrieved. The following information is inside the command window:

      Remote directory:
    \<USER>
    Files:
    *.*
    Local directory:
    C:\sqlremote\<USER>

    FTP Delete File: <USER>\*.*:

    In order to prevent old message files from collecting in the consolidated directory, downloaded files must be deleted. This requires write permissions on the user directory. For more information, see ?Appendix A: Configuring the FTP server?.

    FTP Disconnect:

    Disconnect from the FTP server.

Scheduling a Task

A task can be scheduled, so that it runs on certain days of the week, or at certain times. To schedule a task, perform the following steps:

  1. Go to the PCs views menu
  2. Select the ?Schedule Tasks? icon
  3. Select the package that contains the tasks
  4. On the next screen, click the ?Schedule? button
  5. Choose the desired schedule
  6. On the next window select the PCs that should receive the package

Note: Currently, tasks cannot be scheduled to run on Palm and Windows CE devices. The packages must be sent each time that the task should be performed.

Summary

Manage Anywhere provides a method for managing remote devices. This functionality can be used to deploy remote databases. All the steps to install a remote database can be done using Manage Anywhere packages.

The first step is installing software on the remote device. Manage Anywhere has the ability to distribute applications. This process uses the ?distribute application? wizard. It is also possible to install new software using the ?creating a difference image? functionality. This method is more complex, because variables that are unique for each user must be updated using script commands.

The second step is deploying the extracted database. This can be done by sending the database in a package, or by telling the remote device to retrieve the database using FTP. The first method is acceptable if there are very few databases to be deployed.

The continuous step is the exchange of message files. A simple script can be used to facilitate this process. It is sent to the computer once, and then remains on the computer to perform the tasks based on a given schedule.

The Manage Anywhere Software creates a unique way to deploy a database without using the intervention of the remote user.

Appendix A

Configuring the FTP Server

Microsoft Internet Information Server provides a utility to mange an FTP server, or a web server. The Microsoft Management Console (MMC) is a Windows-based tool that enables the management of all Web services and applications from a single window. More information about how to use these products can be viewed at http://www.microsoft.com/NTServer/web/exec/feature/FeatSetupAdmin.asp

The FTP server component can be used in conjunction with the Manage Anywhere FTP commands. Manage Anywhere has the ability to package and send FTP commands that will be executed on the remote device. This device can use FTP to retrieve files from the consolidated database, or any other FTP server.

The Microsoft Management Console can be used to configure the FTP server. The mmc.exe file is located in the WINNTsystem32 directory.

To start configuring the FTP server, enter the following sequence of commands:

  1. Start the Microsoft Management Console
  2. Console>Add/Remove Snap-in
  3. In the Add/Remove Snap-in Dialog box go to ?Add...?
  4. Add ?Internet Information Server?
  5. Press okay until the dialog boxes are gone
  6. Expand the Internet Information Server, and the computer folders
  7. Right-click on the ?Default FTP Site?, and open properties.
  8. The home directory and the security can be configured.

Note: If users are allowed to delete files, make sure that they have the write privileges.

Appendix B

Creating Remote Directories

There is a way to avoid using FTP as work-around when creating remote directories. The command editor allows the execution of DOS commands. As a result, the directories can be created using this method.

  Execute command.com /C mkdir c:\Remotedb
Execute command.com /C mkdir c:\Remotedb\0
Execute command.com /C mkdir c:\Remotedb\<USER>

NOTE: Directory names cannot be longer than 8 characters, and if the first character is a letter, it must be capitalized. All the other letters will be small.

For example, the following is incorrect:

  Set Text Variable "<REMOTE DIR>" = "sqlremote";
Execute command.com /C mkdir c:\REMOTE DIR;
Execute command.com /C mkdir c:\REMOTE DIR\0
Execute command.com /C mkdir c:\REMOTE DIR\<USER>;
FTP Get File test.txt to local directory c:\REMOTE DIR;

In this example, 2 directories are created. One directory is called Sqlremot and has 2 subdirectories. Both subdirectories start with a capital and the rest of the letters are small. The other directory is called sqlremote and contains a file called test.txt

WARNING: If your variable names (i.e. <USER>) do not follow these conversions, not do use this method.

The following is an example of the code used to deploy a database:

      
    Add entry to log. Text:  "The machine is <MACHINE>"
    Add entry to log. Text:  "The user is <USER>"
    Set Text Variable "<REMOTE DIR>" = "Remotedb"
    Execute command.com /C mkdir c:\REMOTE DIR;
    Execute command.com /C mkdir c:\REMOTE DIR\0
    Execute command.com /C mkdir c:\REMOTE DIR\<USER>;
    FTP Connect:  server = mec-pc, user = administrator
    FTP Get Multiple Files from remote directory . to local directory c:\<REMOTE DIR>;
    FTP Disconnect
    Create Shortcut: Remote_database
    


[#]Home  [*]Top

© Copyright 2008, Sybase Inc.