このレッスンでは、Listener オプションをテキスト・ファイルに保存してから、コマンド・ラインでファイル名を指定して dblsn を実行し、Listener を設定します。
次のコマンドを実行して 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 サーバと同期する必要があります。
次の内容の 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';" |
mydblsn.txt ファイルを保存します。
Listener を起動します。
コマンド・プロンプトで、Listener コマンド・ファイルのディレクトリに移動します。
次のように入力して Listener を起動します。
dblsn @mydblsn.txt |
Listener が動作中であることを示すウィンドウが表示されます。
Copyright © 2009, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.1 |