Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (日本語) » Mobile Link - サーバ起動同期 » サーバ起動同期チュートリアル » チュートリアル:ライトウェイト・ポーリングを使用したサーバ起動同期

 

レッスン 6:Listener の設定

このレッスンでは、Listener オプションをテキスト・ファイルに保存してから、コマンド・ラインでファイル名を指定して dblsn を実行し、Listener を設定します。

♦  Listener を設定するには、次の手順に従います。
  1. 次のコマンドを実行して Mobile Link サーバと同期し、SIS_CarDealer_LP_DBLSN_REM.rid ファイルを作成します。

    dbmlsync -c filedsn=SIS_CarDealer_LP_DBLSN_REM.dsn -ot dbmlsync.log -qc -e sa=on

    Listener は、$remote_id action 変数を使用してポーリング・キーを定義できます。このキーは、Mobile Link サーバでデバイスの識別に使用されます。この変数は、リモート ID ファイル SIS_CarDealer_LP_DBLSN_REM.rid から取得します。このファイルは、Mobile Link サーバと初期同期するときに作成されます。リモート ID ファイルを使用する場合は、Mobile Link サーバと同期する必要があります。

  2. 次の内容の mydblsn.txt というテキスト・ファイルを作成します。

    # Verbosity level
    -v2
    
    # Show notification messages in console and log
    -m
    
    # Truncate, then write output to dblsn.log
    -ot dblsn.log
    
    # Remote ID file (defining the scope of $remote_id)
    -r SIS_CarDealer_LP_DBLSN_REM.rid
    
    # Message handlers
    
    # Watch for a notification without action
    -l "poll_connect=tcpip(host=localhost);
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.no_action;"
    
    # Signal dbmlsync to launch, sync and then shutdown
    -l "poll_connect=tcpip(host=localhost);
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.sync;
        action='run dbmlsync.exe -c filedsn=SIS_CarDealer_LP_DBLSN_REM.dsn -ot dbmlsync.log -qc -e sa=on';"
    
    # Shutdown the listener
    -l "poll_connect=tcpip(host=localhost);
        poll_notifier=CarDealerNotifier;
        poll_key=$remote_id.shutdown;
        action='DBLSN FULL SHUTDOWN';"
  3. mydblsn.txt ファイルを保存します。

  4. Listener を起動します。

    コマンド・プロンプトで、Listener コマンド・ファイルのディレクトリに移動します。

    次のように入力して Listener を起動します。

    dblsn @mydblsn.txt

    Listener が動作中であることを示すウィンドウが表示されます。

参照