Windows上でpgAgentをインストールする方法(PostgreSQL Job Scheduler)

WindowsにpgAgentをインストールする方法(PostgreSQL Job Scheduler)

これは、PostgreSQLにジョブスケジューラが組み込まれていないことに驚きました。 しかし、それはpgAdminソースにパックしましたが、なぜデフォルトでインストールしなかったのでしょうか? ここでは、サービスとしてWindowsにpgAgent(Job Scheduler)をインストールする方法を示すいくつかの手順を提供します

1)以下のようにPgAdimファイルパスに移動します。「C:\ ProgramFiles \ PostgreSQL \ 8.2 \ pgAdminIII」のような独自のpgAdminファイルパスに変更してください。

pgagent-install-step1

2)pgAgent.sqlを取得してスクリプトを実行すると、すべてのpgAgentコアテーブルが作成されます。

pgagent-install-step2

3)pgAgentスクリプトを実行した後、ユーザーはpgAdminに1つのジョブアイコンが表示されることに気付くでしょう。

pgagent-install-step3

4)ジョブスケジューラはまだ機能していません。Windowsでサービスとして登録する必要があります。 コマンドプロンプトで次のコマンドを発行してください

C:\Program Files\PostgreSQL\8.2\bin\pgAgent INSTALL pgAgent -u postgres
-p secret hostaddr=127.0.0.1 dbname=newdb user=postgres password=secret

please issue C:\Program Files\PostgreSQL\8.2in\pgAgent to show usage of pgAgent, where
-u = username
-p = password
“hostaddr=127.0.0.1 dbname=newdb user=postgres password=secret” = connect string

P.S please notice INSTALL is all uppercase, do not type lowercase , it will not work.

5)Windowsにサービスを登録したら、Windowsサービスにアクセスして開始するか、netstartコマンドを使用します。

pgagent-install-step4

6)完了しました。これで、ジョブのスケジュールを開始できます。