# ZzTop Application

## Description

ZzTop 為 tmd 輕量級應用程式，目標是將計畫中好的工作 (job) 根據排程 (Quartz) 定時執行。

## Database

目前驗證過的資料庫有：

* SAP HANA 2.0
* PostgreSQL 9.3

### Tables

#### zzt\_exec\_job

紀錄執行過的工作 (job)。

1. id：主鍵。
2. tmd\_job\_bo：工作名稱。
3. database\_source：來源資料庫。
4. database\_target：目的資料庫。
5. tmd\_task\_log\_bo：
6. executed\_date：執行日期。
7. executed\_time：執行時間。
8. executed\_result：執行結果。
9. run\_state：狀態。
10. delete\_after：可刪除來源資料的時間。

#### zzt\_exec\_task

紀錄執行過的任務 (task)

1. id：主鍵。
2. tmd\_task\_bo：任務名稱。
3. exec\_job\_bo：zz\_exec\_job 主鍵。
4. table\_name：表格名稱。
5. sql\_where：SQL Where 條件。
6. triggered\_by：任務觸發者。
7. result\_count：任務執行時取得的資料筆數。
8. task\_path：任務路徑。

#### zzt\_qtz\_clock

計畫工作的執行排程。

1. id：主鍵。
2. start\_time：開始時間。
3. end\_time：結束時間。
4. clock\_type：週期單位（"day", "hour", "min"）。
5. clock\_interval：執行週期。
6. tmd\_job\_bo：工作名稱，定義在 XML 內。
7. trigger\_startup：啟動後是否立刻執行。

#### zzt\_tx\_key

紀錄同步過的資料。

1. id：主鍵。
2. tx\_time：交易時間。
3. table\_name

#### zzt\_tx\_table

紀錄同步過的表格。

1. id：主鍵。
2. tx\_time：交易時間。
3. table\_name

## Configurations

**app.properties** 為應用程式配置檔案，內容包括資料庫設定與運行條件。

conf/**tmd\_plans.xml** 為 TMD 計畫，內容包過工作 (job)、工作項 (item)、任務 (task)、資料表 (table)、資料庫 (database) 等訊息。

### Properties

app.properties 屬性包括：

* zzt.db.driver - JDBC 驅動程式
* zzt.db.connection JDBC 連線字串
* zzt.db.user - 帳戶
* zzt.db.pwd - 密碼

#### SAP HANA

* **zzt.db.driver**=com.sap.db.jdbc.Driver
* **zzt.db.connection**=jdbc:sap\://10.160.2.23:31015
* **zzt.db.user**=WIP\_ARCHIVE
* **zzt.db.pwd**=Admin12345

#### PostgreSQL&#x20;

* **zzt.db.driver**=org.postgresql.Driver
* **zzt.db.connection**=jdbc:postgresql://localhost:5432/tmd
* **zzt.db.user**=postgres
* **zzt.db.pwd**=Admin12345

## Execute

應用程式啟動後，先根據 conf/tmd\_plans.xml 載入 TMD 計畫，之後根據 app.properties 配置連結排程資料庫並載入排程項目，當排程項目被驅動時，會從 TMD 計畫中取得工作 (job) 定義並執行。

在資料轉移過程中，應用程式會將工作 (job) 與任務 (task) 的執行訊息記錄在 zzt\_exec\_job、zzt\_exec\_task 表格中，同時將表格與數據異動紀錄至 zzt\_tx\_key、zzt\_tx\_table 表格中。

應用程式的啟動方式有兩種：Console 和 Service。

#### Console

主程式為 uia.tmd.zztop.ZztopConsole。

#### Service

主程式為 uia.tmd.zztop.ZztopService。

####

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://uia.gitbook.io/simple-data-migration-tool/zztop-application.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
