TWI510938B - Method and database system for processing transaction of database utilizing transaction log file - Google Patents
Method and database system for processing transaction of database utilizing transaction log file Download PDFInfo
- Publication number
- TWI510938B TWI510938B TW101144004A TW101144004A TWI510938B TW I510938 B TWI510938 B TW I510938B TW 101144004 A TW101144004 A TW 101144004A TW 101144004 A TW101144004 A TW 101144004A TW I510938 B TWI510938 B TW I510938B
- Authority
- TW
- Taiwan
- Prior art keywords
- database
- instruction
- transmitted
- log file
- instructions
- Prior art date
Links
Description
本發明是有關於一種藉由異動日誌檔識別資料庫異動之方法以及資料庫系統。The invention relates to a method for identifying a database change by a transaction log file and a database system.
資料庫藉由一組織化的方式,將許多的數位化資料儲存在一起,提供給許多的使用者共享。使用者可以藉由資料庫指令,新增或刪除資料庫中之檔案,也可以對資料庫之檔案中的資料執行新增、擷取、更新、刪除等操作。The database stores a large number of digital data together in an organized way and provides it to many users for sharing. The user can add or delete files in the database by means of database instructions, and can also perform operations such as adding, extracting, updating, and deleting data in the files in the database.
在先前技術中,為了提高各資料庫連線之利用率,發展出連接池(connection pool),供多個使用者共用同一條資料庫連線,執行資料庫指令。然而,連接池會使用同一共享帳號連線至資料庫。因此,造成資料庫上之異動日誌檔(transaction log file)只能記錄到各資料庫指令是由何連接池所使用之共享帳號所提供。換言之,藉由連接池連線資料庫之技術無法分析出各筆資料庫上之異動是由哪一個使用者所要求的。In the prior art, in order to improve the utilization of each database connection, a connection pool is developed, for multiple users to share the same database connection, and the database instruction is executed. However, the connection pool will connect to the repository using the same shared account. Therefore, the transaction log file on the database can only be recorded to the shared account used by the connection pool for each database command. In other words, the technique of connecting the pool connection database cannot analyze which user requested the transaction on each database.
因此,本發明之一態樣是在提供一種藉由異動日誌檔識別資料庫異動之方法,用以藉由連接池(Connection Pool)提供資料庫連線時,安插對應之客戶端之識別資訊,作為後續分析之用。藉由異動日誌檔識別資料庫異動之方法包含以下步驟:Therefore, in one aspect of the present invention, a method for identifying a database change by using a log file is provided, and when the database is provided by a connection pool, the identification information of the corresponding client is inserted. Used as a follow-up analysis. The method for identifying a database change by a transaction log file includes the following steps:
(a)自數個客戶端接收數個資料庫指令,用以透過一連接池,要求一資料庫執行資料庫指令。(a) Receiving a plurality of database instructions from a plurality of clients for requesting a database to execute database instructions through a connection pool.
(b)在自連接池藉由一連接池連線,依序傳送資料庫指令至資料庫時,藉由連接池連線依序傳送數個安插指令,用以安插客戶端之識別資訊至資料庫之一異動日誌檔。(b) In the self-connection pool, when a database connection command is sequentially transmitted to the database, a plurality of insertion instructions are sequentially transmitted through the connection pool connection to insert the identification information of the client to the data. One of the library's transaction log files.
(c)根據異動日誌檔中所安插之客戶端之識別資訊,分析資料庫所執行之資料庫指令。(c) Analyze the database instructions executed by the database based on the identification information of the client inserted in the transaction log file.
本發明之另一態樣是在提供一種藉由異動日誌檔識別異動之資料庫系統。藉由異動日誌檔識別異動之資料庫系統包含一資料庫以及至少一處理元件。處理元件與資料庫建立連結。處理元件包含一指令接收模組、一指令傳送模組、一安插模組以及一分析模組。指令接收模組自數個客戶端接收數個資料庫指令,用以透過一連接池要求資料庫執行資料庫指令。指令傳送模組自連接池藉由一連接池連線,依序傳送資料庫指令至資料庫。在自連接池藉由連接池連線依序傳送資料庫指令至資料庫時,安插模組藉由連接池連線依序傳送數個安插指令,用以安插客戶端之識別資訊至資料庫之一異動日誌檔。分析模組根據異動日誌檔中所安插之客戶端之識別資訊,分析資料庫所執行之資料庫指令。Another aspect of the present invention is to provide a database system for identifying transactions by a transaction log file. The database system for identifying the transaction by the transaction log file includes a database and at least one processing element. The processing component is linked to the database. The processing component includes an instruction receiving module, an instruction transmission module, an insertion module, and an analysis module. The instruction receiving module receives a plurality of database instructions from a plurality of clients, and uses the connection pool to request the database to execute the database instructions. The instruction transfer module connects the database instructions to the database sequentially through a connection pool connection from the connection pool. In the self-connection pool, the database module sequentially transmits the database command to the database through the connection pool connection, and the plug-in module sequentially transmits a plurality of insertion instructions through the connection pool connection to insert the identification information of the client to the database. A transaction log file. The analysis module analyzes the database instruction executed by the database according to the identification information of the client inserted in the transaction log file.
應用本發明具有下列優點。即使透過連接池進行資料庫連線,仍能分析出執行資料庫指令所產生之異動是由何客戶端產生的。此外,亦能同時具有透過連接池連線之優點。The application of the present invention has the following advantages. Even if the database is connected through the connection pool, it can be analyzed by the client which generated the transaction generated by the execution of the database command. In addition, it also has the advantage of connecting through the connection pool.
以下將以圖式及詳細說明本發明之精神,任何所屬技術領域中具有通常知識者在瞭解本發明之較佳實施例後,當可由本發明所教示之技術加以改變及修飾,其並不脫離本發明之精神與範圍。The spirit and scope of the present invention will be described in the following detailed description of the preferred embodiments of the present invention, which can be modified and modified by the teachings of the present invention. The spirit and scope of the present invention.
請參照第1圖,其係依照本發明一實施方式的一種藉由異動日誌檔識別資料庫異動之方法之流程圖。在藉由異動日誌檔識別資料庫異動之方法中,藉由連接池(Connection Pool)提供資料庫連線時,安插對應之客戶端之識別資訊,作為後續分析之用。藉由異動日誌檔識別資料庫異動之方法可經由電腦程式來進行實作。電腦程式可儲存於一電腦可讀取記錄媒體中,而使電腦讀取此記錄媒體後執行此藉由異動日誌檔識別資料庫異動之方法。電腦可讀取記錄媒體可為唯讀記憶體、快閃記憶體、軟碟、硬碟、光碟、隨身碟、磁帶、可由網路存取之資料庫或熟悉此技藝者可輕易思及具有相同功能之電腦可讀取記錄媒體。Please refer to FIG. 1 , which is a flowchart of a method for identifying a database transaction by a transaction log file according to an embodiment of the present invention. In the method of identifying the database change by the transaction log file, when the database connection is provided by the Connection Pool, the identification information of the corresponding client is inserted for subsequent analysis. The method of identifying the database change by the transaction log file can be implemented by a computer program. The computer program can be stored in a computer readable recording medium, and the computer can read the recording medium and execute the method of identifying the database change by the transaction log file. Computer-readable recording media can be read-only memory, flash memory, floppy disk, hard disk, optical disk, flash drive, tape, network accessible database or familiar with the art can easily think of the same The function of the computer can read the recording medium.
藉由異動日誌檔識別資料庫異動之方法100包含以下步驟:The method 100 for identifying a database transaction by a transaction log file includes the following steps:
在步驟110中,自數個客戶端接收數個資料庫指令,用以透過一連接池,要求一資料庫執行資料庫指令。In step 110, a plurality of database instructions are received from a plurality of clients for requesting a database to execute database instructions through a connection pool.
在步驟120中,在自連接池藉由一連接池連線,依序傳送資料庫指令至資料庫時,藉由連接池連線依序額外傳送數個安插指令,用以安插客戶端之識別資訊至資料庫之一異動日誌檔(transaction log file)。其中,連接池係使用 連接池本身之識別資訊,與資料庫建立起一連接池連線。此外,可藉由insert、update、delete或其他類型可安插資訊至異動日誌檔之變動類型指令,夾帶客戶端之識別資訊,安插至一額外表格。因此,資料庫在收到安插指令時,便會將安插指令中所夾帶之客戶端之識別資訊,安插於資料庫之異動日誌檔(transaction log file)。In step 120, when the database connection is sequentially transmitted to the database through a connection pool connection, the connection pool connection is additionally used to additionally transmit a plurality of insertion instructions for inserting the client identification. Information to one of the database's transaction log files. Among them, the connection pool is used The identification information of the connection pool itself is established, and a connection pool is established with the database. In addition, the insert type information can be inserted into the change type command of the transaction log file by insert, update, delete or other types, and the identification information of the client can be included and inserted into an additional form. Therefore, when the database receives the insertion instruction, it will insert the identification information of the client carried in the insertion instruction into the transaction log file of the database.
在步驟130中,根據於步驟120安插至異動日誌檔中之客戶端之識別資訊,分析資料庫所執行之資料庫指令。如此一來,即使透過連接池傳送資料庫指令至資料庫,仍能依據異動日誌檔中之客戶端之識別資訊,分析出資料庫指令是由哪一個客戶端所要求。此外,亦能同時具有透過連接池連線之優點。In step 130, according to the identification information of the client inserted in the transaction log file in step 120, the database instruction executed by the database is analyzed. In this way, even if the database command is transmitted to the database through the connection pool, the client's identification information in the transaction log file can be used to analyze which client the database command is requested by. In addition, it also has the advantage of connecting through the connection pool.
參照第2圖,其係本發明實作時之一應用場景。在收到分別來自客戶端a210、客戶端b220之資料庫指令(步驟110)時,連接池301藉由其連接池連線302依序傳送資料庫指令201a、201b至資料庫400(步驟120)。其中,在步驟120之一實施例中,在自連接池301藉由連接池連線302依序傳送各資料庫指令201a、201b至資料庫400前,先判斷當前將傳送之資料庫指令201a、201b對應之客戶端是否與前一資料庫指令相同。在本實施例中,資料庫指令201b之客戶端b220與其前一個資料庫指令201a之客戶端a210並不相同,因此會先傳送一安插指令202,藉此安插當前將傳送之資料庫指令201b對應之客戶端b220之識別資訊至資料庫400之異動日誌檔。接下來,在安插當前將傳送之資料庫指令201b對應之客戶端b220之識別資 訊至資料庫400之異動日誌檔後(也就是傳送安插指令202後),才開始傳送當前將傳送之資料庫指令201b。Referring to Fig. 2, it is an application scenario in the practice of the present invention. Upon receiving the database instructions from the client a210 and the client b220 (step 110), the connection pool 301 sequentially transmits the database instructions 201a, 201b to the database 400 via its connection pool connection 302 (step 120). . In an embodiment of step 120, before the connection pool connection 302 transmits the database instructions 201a, 201b to the database 400 through the connection pool connection 302, the database instruction 201a currently being transmitted is determined. Whether the client corresponding to 201b is the same as the previous database instruction. In this embodiment, the client b220 of the database command 201b is not the same as the client a210 of the previous database command 201a. Therefore, an insert instruction 202 is first transmitted, thereby inserting the corresponding database command 201b to be transmitted. The identification information of the client b220 is changed to the transaction log file of the database 400. Next, the identification of the client b220 corresponding to the database command 201b currently being transmitted is inserted. After the transaction log file of the database 400 is transmitted (that is, after the insertion instruction 202 is transmitted), the database instruction 201b to be transmitted is started to be transmitted.
參照第3圖,其係本發明實作時之另一應用場景。在自連接池301藉由連接池連線302依序傳送各資料庫指令201a、201b至資料庫400前,先判斷當前將傳送之資料庫指令對應之客戶端是否與前一資料庫指令相同。在本實施例中,資料庫指令201b之客戶端b220與其前一個資料庫指令201a之客戶端a210並不相同,因此會先傳送安插指令203,藉此安插前一資料庫指令201a對應之客戶端a210之識別資訊至資料庫400之異動日誌檔。在安插前一資料庫指令201a對應之客戶端a210之識別資訊至資料庫400之異動日誌檔後(也就是傳送安插指令203後),才開始傳送當前將傳送之資料庫指令201b。Referring to Fig. 3, it is another application scenario when the present invention is implemented. Before the self-connection pool 301 sequentially transfers the database instructions 201a, 201b to the database 400 through the connection pool connection 302, it is first determined whether the client corresponding to the database instruction currently transmitted is the same as the previous database instruction. In this embodiment, the client b220 of the database command 201b is not the same as the client a210 of the previous database command 201a. Therefore, the insert command 203 is first transmitted, thereby inserting the client corresponding to the previous database command 201a. The identification information of a210 is changed to the transaction log file of the database 400. After the identification information of the client a210 corresponding to the previous database instruction 201a is inserted into the transaction log file of the database 400 (that is, after the insertion instruction 203 is transmitted), the transfer of the database instruction 201b to be transmitted is started.
參照第4圖,其係本發明實作時之另一應用場景。在自連接池301藉由連接池連線302依序傳送各資料庫指令201a、201b至資料庫400前,先分別傳送一安插指令204、205,藉此安插當前將傳送之資料庫指令201a、201b對應之客戶端a210、客戶端b220之識別資訊至資料庫400之異動日誌檔。在分別安插當前將傳送之資料庫指令201a、201b對應之客戶端a210、客戶端b220之識別資訊至資料庫400之異動日誌檔後,才開始傳送當前將傳送之資料庫指令201a、201b。Referring to Figure 4, it is another application scenario when the present invention is implemented. Before the self-connection pool 301 sequentially transfers the database instructions 201a, 201b to the database 400 through the connection pool connection 302, an insertion instruction 204, 205 is respectively transmitted, thereby inserting the database instruction 201a to be currently transmitted. 201b corresponds to the identification information of the client a210 and the client b220 to the transaction log file of the database 400. After the identification information of the client a210 and the client b220 corresponding to the database instructions 201a and 201b currently to be transmitted are respectively inserted into the transaction log file of the database 400, the transfer of the database instructions 201a and 201b currently to be transmitted is started.
參照第5圖,其係本發明實作時之另一應用場景。在自連接池301藉由其連接池連線302依序傳送資料庫指令201b至資料庫400前,先傳送一安插指令206,藉此安插 資料庫指令201b之前一資料庫指令201a對應之客戶端a210之識別資訊至資料庫400之異動日誌檔。在安插客戶端a210之識別資訊至資料庫400之異動日誌檔(也就是傳送安插指令206)後,才開始傳送當前將傳送之資料庫指令201b。Referring to Figure 5, it is another application scenario when the present invention is implemented. Before the connection pool 301 sequentially transfers the database instruction 201b to the database 400 through the connection pool connection 302, an insertion instruction 206 is transmitted first, thereby inserting The database server 201b corresponds to the identification information of the client a210 corresponding to the database command 201a to the transaction log file of the database 400. After the identification information of the client a210 is inserted into the transaction log file of the database 400 (that is, the transfer instruction 206), the database command 201b currently being transmitted is started to be transmitted.
參照第6圖,其係本發明實作時之另一應用場景。在自連接池301藉由其連接池連線302依序傳送各資料庫指令201a、201b至資料庫400前,判斷當前將傳送之資料庫指令201a、201b是否為變更型指令(如insert、update、delete或其他類型之變更型指令)。在本實施例中,假設當前將傳送之資料庫指令201b為變更型指令時,先傳送一安插指令207,藉此安插當前將傳送之資料庫指令201b對應之客戶端b220之識別資訊至資料庫400之異動日誌檔。在安插對應之客戶端b220之識別資訊至資料庫400之異動日誌檔(也就是傳送安插指令207)後,才開始傳送當前將傳送之資料庫指令201b。如此一來,可依據所安插之客戶端之識別資訊,而分析資料庫上之變更由何客戶端所要求。Referring to Figure 6, it is another application scenario when the present invention is implemented. Before the connection pool 301 sequentially transfers the database instructions 201a, 201b to the database 400 through the connection pool connection 302, it is determined whether the database instructions 201a, 201b currently being transmitted are changed instructions (such as insert, update). , delete or other types of change instructions). In this embodiment, it is assumed that when the database instruction 201b to be transmitted is a change type instruction, an insertion instruction 207 is first transmitted, thereby inserting the identification information of the client b220 corresponding to the database instruction 201b currently being transmitted to the database. 400 transaction log file. After the identification information of the corresponding client b220 is inserted into the transaction log file of the database 400 (that is, the transfer instruction 207), the database command 201b currently being transmitted is started to be transmitted. In this way, the client can determine the change on the database according to the identification information of the inserted client.
參照第7圖,其係本發明實作時之另一應用場景。在自連接池301藉由其連接池連線302依序傳送各資料庫指令至資料庫400前,判斷當前將傳送之資料庫指令201a、201b是否為變更型指令。假設當前將傳送之資料庫指令201b為變更型指令時,在傳送資料庫指令201b後,傳送一安插指令208,藉此安插剛傳送之資料庫指令201b對應之客戶端b220之識別資訊至資料庫400之異動日誌檔。如此一來,可依據資料庫400之異動日誌檔中所安插之客戶 端之識別資訊,而分析資料庫上之變更由何客戶端所要求。Referring to Figure 7, it is another application scenario when the present invention is implemented. Before the connection pool 301 sequentially transfers the database instructions to the database 400 through the connection pool connection 302, it is determined whether the database instructions 201a, 201b currently being transmitted are changed instructions. Assuming that the database command 201b to be transmitted is a change type command, after the database command 201b is transmitted, an insert command 208 is transmitted, thereby inserting the identification information of the client b220 corresponding to the database command 201b just transferred to the database. 400 transaction log file. In this way, the customer can be inserted according to the transaction log file of the database 400. The end identifies the information, and the changes on the analysis database are requested by the client.
請參照第8圖,其繪示依照本發明一實施方式的一種藉由異動日誌檔識別異動之資料庫系統之功能方塊圖。藉由異動日誌檔識別異動之資料庫系統500包含一資料庫510以及至少一處理元件520。處理元件520與資料庫510建立連結。在本發明之一些實施例中,資料庫510以及處理元件520可以由同一電腦主機、伺服器或其他類型之電子裝置所提供。在本發明之另一些實施例中,資料庫510以及處理元件520可分散式的配置於多台電腦主機、伺服器、其他類型之電子裝置或其組合。Please refer to FIG. 8 , which is a functional block diagram of a database system for identifying a transaction by a transaction log file according to an embodiment of the invention. The database system 500 for identifying transactions by the transaction log file includes a database 510 and at least one processing component 520. Processing component 520 establishes a connection with database 510. In some embodiments of the invention, database 510 and processing component 520 may be provided by the same computer host, server, or other type of electronic device. In other embodiments of the present invention, the database 510 and the processing component 520 are decentralizedly configured in a plurality of computer hosts, servers, other types of electronic devices, or a combination thereof.
處理元件520包含一指令接收模組521、一指令傳送模組522、一安插模組523以及一分析模組524。指令接收模組521自數個客戶端接收數個資料庫指令,用以透過一連接池,要求資料庫510執行資料庫指令。其中,連接池可由處理元件520所提供。The processing component 520 includes an instruction receiving module 521, an instruction transmitting module 522, an insertion module 523, and an analysis module 524. The command receiving module 521 receives a plurality of database instructions from a plurality of clients for requesting the database 510 to execute the database instructions through a connection pool. Therein, the connection pool can be provided by the processing component 520.
指令傳送模組522自連接池藉由一連接池連線,依序傳送資料庫指令至資料庫510。其中,指令傳送模組522係使用連接池本身之識別資訊,與資料庫510建立起一連接池連線,以傳送資料庫指令。The command transfer module 522 connects the database instructions to the database 510 in sequence through a connection pool connection from the connection pool. The command transmission module 522 uses the identification information of the connection pool itself to establish a connection pool connection with the database 510 to transmit the database instructions.
在自連接池藉由連接池連線依序傳送資料庫指令至資料庫510時,安插模組523藉由連接池連線依序傳送數個安插指令,用以安插客戶端之識別資訊至資料庫510之異動日誌檔。此外,指令傳送模組522可藉由insert、update、delete或其他類型可安插資訊至異動日誌檔之變動類型指令,夾帶客戶端之識別資訊,安插至資料庫510之一額外 表格。因此,資料庫510在收到安插指令時,便會將安插指令中所夾帶之客戶端之識別資訊,安插於資料庫510之異動日誌檔(transaction log file)。When the self-joining pool sequentially transmits the database command to the database 510 through the connection pool connection, the plug-in module 523 sequentially transmits a plurality of insertion instructions through the connection pool connection to insert the identification information of the client to the data. The transaction log file of library 510. In addition, the instruction transfer module 522 can insert the information into the change type command of the transaction log file by insert, update, delete or other types, and carry the identification information of the client, and insert it into one of the data library 510. form. Therefore, when receiving the insertion instruction, the database 510 inserts the identification information of the client carried in the insertion instruction into the transaction log file of the database 510.
於是,分析模組524根據異動日誌檔中所安插之客戶端之識別資訊,分析資料庫所執行之資料庫指令。如此一來,即使透過連接池傳送資料庫指令至資料庫510,仍能依據異動日誌檔中所安插之客戶端之識別資訊,分析出資料庫指令是由哪一個客戶端所要求。此外,亦能同時具有透過連接池連線之優點。Therefore, the analysis module 524 analyzes the database instruction executed by the database according to the identification information of the client inserted in the transaction log file. In this way, even if the database command is transmitted to the database 510 through the connection pool, the identification information of the client inserted in the transaction log file can be used to analyze which client the database command is requested by. In addition, it also has the advantage of connecting through the connection pool.
在本發明之一些實施例中,可在所傳送之資料庫指令所屬之客戶端換人時,傳送其客戶端之識別資訊。因此,在指令傳送模組522自連接池藉由連接池連線依序傳送各資料庫指令至資料庫510前,處理元件520之一判斷模組525可判斷當前將傳送之資料庫指令對應之客戶端是否與前一資料庫指令相同。在先後資料庫指令對應之客戶端不同時,安插模組523先傳送一安插指令,藉此安插當前將傳送之資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔。在安插模組523安插當前將傳送之資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔後,才觸發指令傳送模組522開始傳送當前將傳送之資料庫指令。In some embodiments of the present invention, the identification information of the client may be transmitted when the client to which the transferred database instruction belongs is replaced. Therefore, before the command transfer module 522 sequentially transfers the database commands to the database 510 from the connection pool through the connection pool connection, one of the processing elements 520 determining module 525 can determine that the database command currently being transmitted corresponds to Whether the client is the same as the previous database directive. When the client corresponding to the database command is different, the plug-in module 523 first transmits an insert command, thereby inserting the identification information of the client corresponding to the database command currently transmitted to the transaction log file of the database 510. After the insertion module 523 inserts the identification information of the client corresponding to the database instruction currently transmitted to the transaction log file of the database 510, the instruction transmission module 522 is triggered to start transmitting the database instruction to be transmitted.
此外,可在判斷模組525判定先後資料庫指令對應之客戶端不同時,安插模組523先傳送一安插指令,藉此安插前一資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔。在安插模組523安插前一資料庫指令對應 之客戶端之識別資訊至資料庫510之異動日誌檔後,才觸發指令傳送模組522開始傳送當前將傳送之資料庫指令。In addition, when the determining module 525 determines that the client corresponding to the database command is different, the plug-in module 523 first transmits an insert command, thereby inserting the identification information of the client corresponding to the previous database command to the database 510. Transaction log file. Inserting the previous database module in the plug-in module 523 After the identification information of the client reaches the transaction log file of the database 510, the instruction transmission module 522 is triggered to start transmitting the database instruction to be transmitted.
在本發明之另一些實施例中,可在傳送每個資料庫指令前,先傳送安插指令。因此,在指令傳送模組522自連接池藉由連接池連線依序傳送各資料庫指令至資料庫510前,先藉由安插模組523傳送一安插指令,藉此先安插當前將傳送之資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔。接下來,在安插模組523安插當前將傳送之資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔後,才觸發指令傳送模組522開始傳送當前將傳送之資料庫指令。In still other embodiments of the invention, the insertion instructions may be transmitted prior to transmitting each database instruction. Therefore, before the instruction transfer module 522 sequentially transfers the database instructions to the database 510 through the connection pool connection, the insertion module 523 first transmits an insertion instruction, thereby first inserting the current transmission. The identification information of the client corresponding to the database instruction is to the transaction log file of the database 510. Next, after the insertion module 523 inserts the identification information of the client corresponding to the database instruction currently being transmitted to the transaction log file of the database 510, the instruction transmission module 522 is triggered to start transmitting the database instruction to be transmitted.
在本發明之另一些實施例中,可在傳送下一個資料庫指令後,傳送前一個資料庫指令之客戶端之識別資訊。詳細來說,在指令傳送模組522自連接池藉由連接池連線依序傳送各資料庫指令至資料庫510前,先藉由安插模組523傳送一安插指令,藉此安插各資料庫指令之前一資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔。接下來,在安插模組523安插前一資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔後,才觸發指令傳送模組522開始傳送當前將傳送之資料庫指令。In still other embodiments of the present invention, the identification information of the client of the previous database instruction may be transmitted after the next database instruction is transmitted. In detail, before the instruction transfer module 522 sequentially transfers the database instructions to the database 510 through the connection pool connection, the insertion module 523 first transmits an insertion instruction, thereby inserting each database. The identification information of the client corresponding to the database instruction is sent to the transaction log file of the database 510. Next, after the insertion module 523 inserts the identification information of the client corresponding to the previous database instruction to the transaction log file of the database 510, the instruction transmission module 522 is triggered to start transmitting the database instruction to be transmitted.
在本發明之另一些實施例中,可在資料庫指令為變更型指令(如update、delete或其他類型之變更型指令)時,才傳送安插客戶端之識別資訊。因此,在指令傳送模組522自連接池藉由連接池連線依序傳送各資料庫指令至資料庫510前,判斷模組525可判斷當前將傳送之資料庫指令是 否為變更型指令。在當前將傳送之資料庫指令為變更型指令時,先藉由安插模組523傳送一安插指令,藉此安插當前將傳送之資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔。接下來,在安插模組523安插當前將傳送之資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔後,才觸發指令傳送模組522開始傳送當前將傳送之資料庫指令。In other embodiments of the present invention, the identification information of the client may be transmitted when the database instruction is a change type instruction (such as update, delete, or other type of change type instruction). Therefore, before the instruction transfer module 522 sequentially transfers the database instructions to the database 510 through the connection pool connection from the connection pool, the determination module 525 can determine that the database command to be transmitted is No change order. When the database instruction to be transmitted is a modified instruction, the insertion module 523 first transmits an insertion instruction, thereby inserting the identification information of the client corresponding to the database instruction currently transmitted to the transaction log of the database 510. files. Next, after the insertion module 523 inserts the identification information of the client corresponding to the database instruction currently being transmitted to the transaction log file of the database 510, the instruction transmission module 522 is triggered to start transmitting the database instruction to be transmitted.
此外,亦可在判斷模組525判定當前將傳送之資料庫指令為變更型指令時,在指令傳送模組522傳送當前將傳送之資料庫指令後,才藉由安插模組523傳送一安插指令,藉此安插剛傳送之資料庫指令對應之客戶端之識別資訊至資料庫510之異動日誌檔。In addition, when the determining module 525 determines that the database command to be transmitted is a change type command, the command transmitting module 522 transmits the current database command to be transmitted, and then inserts an insert command by the plug-in module 523. In this way, the identification information of the client corresponding to the database instruction just transmitted is inserted into the transaction log file of the database 510.
雖然本發明已以實施方式揭露如上,然其並非用以限定本發明,任何熟習此技藝者,在不脫離本發明之精神和範圍內,當可作各種之更動與潤飾,因此本發明之保護範圍當視後附之申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and the present invention can be modified and modified without departing from the spirit and scope of the present invention. The scope is subject to the definition of the scope of the patent application attached.
100‧‧‧藉由異動日誌檔識別資料庫異動之方法100‧‧‧Method for identifying database changes by transaction log file
110-130‧‧‧步驟110-130‧‧‧Steps
201a、201b‧‧‧資料庫指令201a, 201b‧‧‧ Database Instructions
202、203、204、205、206、207、208‧‧‧安插指令202, 203, 204, 205, 206, 207, 208‧‧ ‧ insertion instructions
210‧‧‧客戶端a210‧‧‧Client a
220‧‧‧客戶端b220‧‧‧Client b
301‧‧‧連接池301‧‧‧connection pool
302‧‧‧連接池連線302‧‧‧Connected pool connection
400‧‧‧資料庫400‧‧‧Database
500‧‧‧藉由異動日誌檔識別異動之資料庫系統500‧‧‧Recognition of the database system by transaction log file
510‧‧‧資料庫510‧‧‧Database
520‧‧‧處理元件520‧‧‧Processing components
521‧‧‧指令接收模組521‧‧‧Instruction Receiver Module
522‧‧‧指令傳送模組522‧‧‧Command Transfer Module
523‧‧‧安插模組523‧‧‧Installation module
524‧‧‧分析模組524‧‧‧Analysis module
525‧‧‧判斷模組525‧‧‧Judgement module
為讓本發明之上述和其他目的、特徵、優點與實施例能更明顯易懂,所附圖式之說明如下:第1圖係依照本發明一實施方式的一種藉由異動日誌檔識別資料庫異動之方法之流程圖。The above and other objects, features, advantages and embodiments of the present invention will become more <RTIgt; <RTIgt; </ RTI> <RTIgt; </ RTI> <RTIgt; </ RTI> <RTIgt; Flow chart of the method of change.
第2圖至第7圖係本發明實作時之多個應用場景。Figures 2 through 7 are a plurality of application scenarios in the practice of the present invention.
第8圖繪示依照本發明一實施方式的一種藉由異動日誌檔識別異動之資料庫系統之功能方塊圖。FIG. 8 is a functional block diagram of a database system for identifying a transaction by a transaction log file according to an embodiment of the invention.
100‧‧‧藉由異動日誌檔識別資料庫異動之方法100‧‧‧Method for identifying database changes by transaction log file
110-130‧‧‧步驟110-130‧‧‧Steps
Claims (14)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW101144004A TWI510938B (en) | 2012-11-23 | 2012-11-23 | Method and database system for processing transaction of database utilizing transaction log file |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW101144004A TWI510938B (en) | 2012-11-23 | 2012-11-23 | Method and database system for processing transaction of database utilizing transaction log file |
Publications (2)
Publication Number | Publication Date |
---|---|
TW201421268A TW201421268A (en) | 2014-06-01 |
TWI510938B true TWI510938B (en) | 2015-12-01 |
Family
ID=51393426
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW101144004A TWI510938B (en) | 2012-11-23 | 2012-11-23 | Method and database system for processing transaction of database utilizing transaction log file |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI510938B (en) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5907848A (en) * | 1997-03-14 | 1999-05-25 | Lakeview Technology, Inc. | Method and system for defining transactions from a database log |
US20030233485A1 (en) * | 2002-06-13 | 2003-12-18 | Mircrosoft Corporation | Event queue |
CN100337235C (en) * | 2003-06-23 | 2007-09-12 | 华为技术有限公司 | Method and apparatus for accessing database |
US20100061233A1 (en) * | 2008-09-11 | 2010-03-11 | International Business Machines Corporation | Flow control in a distributed environment |
TW201202976A (en) * | 2010-04-30 | 2012-01-16 | Ibm | Method and system for centralized control of database applications |
-
2012
- 2012-11-23 TW TW101144004A patent/TWI510938B/en active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5907848A (en) * | 1997-03-14 | 1999-05-25 | Lakeview Technology, Inc. | Method and system for defining transactions from a database log |
US20030233485A1 (en) * | 2002-06-13 | 2003-12-18 | Mircrosoft Corporation | Event queue |
CN100337235C (en) * | 2003-06-23 | 2007-09-12 | 华为技术有限公司 | Method and apparatus for accessing database |
US20100061233A1 (en) * | 2008-09-11 | 2010-03-11 | International Business Machines Corporation | Flow control in a distributed environment |
TW201202976A (en) * | 2010-04-30 | 2012-01-16 | Ibm | Method and system for centralized control of database applications |
Also Published As
Publication number | Publication date |
---|---|
TW201421268A (en) | 2014-06-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10536456B2 (en) | Method and system for identifying user information in social network | |
US20140040465A1 (en) | Systems and methods for tag information validation in wide port sas connections | |
US9111081B2 (en) | Remote direct memory access authentication of a device | |
US7970957B2 (en) | Apparatus, method and computer readable medium for disambiguating commands with respect to logical protocols | |
US9350730B2 (en) | Biometric-based wireless device association | |
WO2018090256A1 (en) | Directory deletion method and device, and storage server | |
JP6595625B2 (en) | Automatic recharge system, method and server | |
WO2017000761A1 (en) | Method and apparatus for extracting feature information of terminal device | |
CN103279380A (en) | Information processing system and method | |
US8484342B2 (en) | Organizing individual java client request flows into a single server transaction | |
WO2015097789A1 (en) | Query generating method and query generating device | |
US11625382B2 (en) | Blockchain as a service method, apparatus, and system | |
WO2015121923A1 (en) | Log analysis device, unauthorized access auditing system, log analysis program, and log analysis method | |
US7529980B2 (en) | Method and apparatus for injecting errors into SAS domains through SAS expanders | |
CN110086836B (en) | Method and device for acquiring metadata | |
US20180241700A1 (en) | Transfer device, transfer system, and transfer method | |
CN111092958B (en) | Node access method, device, system and storage medium | |
KR101846778B1 (en) | Method for ID Resolution Service and M2M System applying the same | |
TWI510938B (en) | Method and database system for processing transaction of database utilizing transaction log file | |
WO2021128165A1 (en) | Formal verification method and device, information identification method and device, and storage medium | |
CN109218338B (en) | Information processing system, method and device | |
US20160187231A1 (en) | Performance testing method, performance testing apparatus performing the same and storage medium storing the same | |
US10216505B2 (en) | Using machine learning to optimize minimal sets of an application | |
CN117544334A (en) | Device access method, data exchange method, device and storage medium | |
US20080288501A1 (en) | Integrating Database Functionality with Workload Schedulers |