The system is converted from Oracle version to SQLServer version

xiaoxiao2021-03-06  60

Waterxp is converted from Oracle version to SQLServer version

1, system arrangement

For the Oracle version and the SQLServer version, it can be easily converted, and the two versions can be synchronized, especially the business logic layer. The decision is as follows:

A, two versions of business logic layers are placed in the Source directory. There are two directorys in this directory:

SQL and ORA. These two directory have three files:

COMMON.PBL, Water_Modi.pbl, dw_version.pbl.

Most of these three files are data windows, mainly because SQL Server and Oracle syntax is different. If it is just because the data window has dual quotation in SQL Server, the field quotation of the SELECT syntax of the data window is removed, because the SELECT statement without quotation is available below SQL Server and Oracle. Pay attention to the UPDATE attribute during the modified process.

B, different databases will use different directories.

2, the establishment of the system environment

Establish the following disk mapping on each machine:

P point to // ORASERVR / P237

V pointing // ilaservr / sql237 or // ilraserver / ora237

Source code in // ORASERVER / CODE / WATER237 / SOURCE.

The P disk is definitely necessary, the V disk is determined by what version of the use.

3, the modification of the source code

The modification of the business layer is as possible, because such modifications can make two versions simultaneously modify.

The P disk is that the class library can not be modified.

The data window in the V disk needs to be changed.

Change the data window inside SQL237 to modify and pay attention to:

Replacement method

Oracle uses SQL Server in SQL Server

TO_CHAR (ReadingDate, 'YYYYMM') Convert (Char (6), ReadingDate, 111)

TO_CHAR (ReadingDate, 'YYYY / mm') Convert (Char (7), ReadingDate, 112)

Decode (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Connection ( ) Left Outer Join

Pay attention to the UPDATE properties of the data window during the modification.

4, work plan

4, 1 Modify the syntax of the data window in the three PBLs in the SQL237 directory. In order to take care of the UPDATE attribute of the data window, it is recommended to use the EDIT SOURCE method, and the quotation marks of the SELECT syntax field is recommended to remove the SQL Server version. Use the PB's Replace function.

4, 2 Modify the syntax of the embedded SQL of some data windows. Because some embedded SQL also use decode (), or to_CHAR (), these syntax must be replaced in SQLServer.

Modification method:

IF GS_DATABASE = 'Oracle' Then

.................. decode () ...............;

Else

.................... Case When I end ........ ..;

END IF

4, 3 The last job is test. This is the most cumbersome and most important thing. The process of testing will find that some data windows cannot be used in SQL Server: The modification method is to remove the quotation marks of the field or move it in the dw_version.pbl file in the SQL and ORA directory, and modify it.

转载请注明原文地址:https://www.9cbs.com/read-112322.html

New Post(0)