Reverse engineering - Databases: design

Reverse Engineering

The tools for developing databases have existed for a long time, but their application in practical design began quite recently (around the beginning of the XXI century), but also not always in full. This led to the fact that today a lot of databases work without the availability of corresponding database models, which causes serious difficulties in their maintenance and modification. In view of this problem, the tools allow to restore the structure of a database (model) from a physical database, called reverse engineering (Reverse Engineering). The principle of this tool in IBM InfoSphere Data Architect is identical to the procedure of transition from a model of one level to a model of another level.

In the first step of reverse engineering, you need to specify the created database model, and the model view does not matter (Figure 4.99). Restoring the database model can be performed for the physical and/or logical models, restoring those elements (objects) that are acceptable for the corresponding level.

Fig. 4.99. Specifying the destination model

The

The second step requires the developer to specify the source of the information structure (Figure 4.100), among which he can select a database or program code with commands for describing data structures, represented in the language

Fig. 4.100. Selecting the source of model objects

The

If you select DDL script, then the developer needs to specify where the script is physically located on the magnetic medium (see Figure 4.101). It is worth noting that when creating a script (program code) for creating a database, it is stored in the project and on a magnetic medium in the project folder. When reverse engineering is required, the entire file structure of the magnetic medium is proposed for selection. Therefore, it is important to know exactly where the code file for the action is placed.

Fig. 4.101. Specifying the program code for recovery

The

If the developer performs reverse engineering from a physical database, you need to connect to this database, which is provided through the data source organization mechanism. This mechanism is called automatically when the reverse design type is selected Database (Database).

In the data source setup window in the Connections A set of previously generated data sources is created on the existing physical databases on the current computer or on the network (Figure 4.102). If among the specified data sources there is one whose database is needed for recovery in the form of a model, then it is sufficient to select it and go to the procedure for creating the model.

If you do not need one of these sources, you need to create it, which is provided with the New ... and the corresponding connection settings dialog box (Figure 4.103). These settings define a whole set of parameters, among which:

• Database - the name of the database to which you want to connect;

• Host - the location of the database on the network, which can be specified by the network name of the computer, IP address or Internet address;

• Port number - the port number of the connection through which the corresponding server is provided access to the DBMS and database;

• User name - the name of the user with whom you want to connect to the database;

• Password - password for accessing the database;

• Default schema is the default schema where the necessary database objects are located.

Fig. 4.102. Selecting a connection to the database

The

By specifying these characteristics in the Connection URL field, the database access address will be generated, and using the Test connections button, you can verify the correctness of these characteristics.

Fig. 4.103. Setting up a connection to the database

The

The set of corresponding settings is determined by the selected DBMS and the driver connecting to it. The DBMS can be selected in the Select a database manager (Selection of the database manager), and the driver - in the "JDBC driver" field, which lists the drivers available for the DBMS. If you want to use the drivers and DBMS not represented in the selection, you need to install these drivers in the tool if they exist in the appropriate form.

As a result of specifying all these parameters, the database model will be recreated by corresponding entities, constraints, defaults, and other objects. And in case of contradictions, for example, if the model has an identical object, the developer will be presented with a report describing the problem that has arisen.

thematic pictures

Ошибка в функции вывода объектов.