Database deployment methods, apparatus, computer-readable storage media and electronic devices
Patent Information
- Application Number
- CN202310334662.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-30
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2043-03-30
AI Technical Summary
Traditional database deployment methods require a lot of manual operation, which leads to large errors and low efficiency. Manually installing patches and running baselines can also cause large errors in the target database and low deployment efficiency.
By acquiring database setup information, the system automatically builds the initial database and reads the matching target script for supplementary configuration, including parsing basic information and control commands, compiling configuration files, and automatically executing the target script to achieve automated database deployment.
It reduces errors caused by manual operation, improves the efficiency and accuracy of database deployment, and realizes automated database configuration and monitoring feedback.
Smart Images

Figure CN116340294B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of cloud computing, and more specifically, to a database deployment method, apparatus, computer-readable storage medium, and electronic device. Background Technology
[0002] A database is a collection of large amounts of organized, shareable, and uniformly managed data that is stored long-term in a computer. With the continuous development of cloud computing technology and the arrival of the big data era, the demand for database deployment is constantly expanding.
[0003] However, traditional database deployment methods require significant manpower for deployment and tracking. Furthermore, database deployment involves numerous steps, all of which are manually performed. These include: basic environment checks, environment variable configuration, software package downloads, mutual trust configuration, Automated Storage Management (ASM) cluster setup, instance software setup, installation of the latest patch set, database instance creation, best practice parameter configuration, environment verification, etc. Each step requires substantial manual operation, and different configurations are needed for different business needs to avoid errors in intermediate steps that would necessitate database redeployment. Therefore, traditional database deployment methods require a large amount of manual operation, which can easily lead to errors in the target database. Moreover, the extensive manual operation results in high time costs and low deployment efficiency.
[0004] There is currently no effective solution to the problems of manual patch installation, large errors in the target database due to baseline running, and low database deployment efficiency caused by the database deployment methods provided by the above-mentioned technologies. Summary of the Invention
[0005] The main objective of this application is to provide a database deployment method, apparatus, computer-readable storage medium, and electronic device to solve the problems of database deployment methods provided by related technologies, such as the need for manual patch installation, large errors in the target database due to baseline running, and low database deployment efficiency.
[0006] To achieve the above objectives, according to one aspect of this application, a database deployment method is provided. The method includes:
[0007] Obtain database setup information; based on the database setup information, build an initial database on the target server; read the target script that matches the initial database, where the target script is used to supplement the configuration of the initial database; call the target script to supplement the configuration of the initial database, and obtain the target database.
[0008] Optionally, building an initial database on the target server based on the database setup information includes: parsing the database setup information to obtain the basic information and control instructions of the target database; and using the basic information and control instructions to build the initial database on the target server.
[0009] Optionally, building an initial database on the target server using basic information and control commands includes: compiling a configuration file for the target database based on the basic information and preset compilation documents; and building the initial database on the target server based on the control commands and configuration file.
[0010] Optionally, building an initial database on the target server according to control instructions and configuration files includes: reading the target configuration data from the configuration file; and building the initial database on the target server according to control instructions and target configuration data.
[0011] Optionally, calling the target script to supplement the initial database configuration to obtain the target database includes: parsing the target script to obtain the parsing result; and using the parsing result to supplement the initial database configuration to obtain the target database.
[0012] Optionally, the above database deployment method further includes: traversing the baseline data of the target database; comparing the standard value and the query value of each baseline data item in the baseline data to obtain a comparison result, wherein the comparison result is used to determine the status of the baseline data; and generating feedback information based on the comparison result, wherein the feedback information is used to determine abnormal data in the baseline data.
[0013] Optionally, the above database deployment method further includes: responding to a user's query command, obtaining log information of the target database, wherein the query command is used to obtain the target query result corresponding to the query object from the target database, the target query result is used to determine the status of the query object, and the log information is used to record the operation process and exception information of the target database; generating the target query result corresponding to the query object based on the log information; and feeding back the target query result to the user.
[0014] To achieve the above objectives, according to another aspect of this application, a database deployment apparatus is provided. The apparatus includes:
[0015] The module is divided into four parts: an acquisition module for acquiring database setup information; a setup module for setting up an initial database on the target server based on the database setup information; a reading module for reading a target script that matches the initial database, where the target script is used to supplement the initial database configuration; and a processing module for calling the target script to configure the initial database and obtain the target database.
[0016] Optionally, the above-mentioned construction module is also used to: parse the database construction information to obtain the basic information of the target database and the control instructions of the target database; and use the basic information and control instructions to build an initial database on the target server.
[0017] Optionally, the above-mentioned setup module is also used to: compile a configuration file for the target database based on basic information and preset compilation documents; and build an initial database on the target server based on control instructions and the configuration file.
[0018] Optionally, the above-mentioned setup module is also used to: read the target configuration data from the configuration file; and build an initial database on the target server based on the control instructions and the target configuration data.
[0019] Optionally, the above processing module is also used to: parse the target script to obtain the parsing result; and use the parsing result to supplement the configuration of the initial database to obtain the target database.
[0020] Optionally, the above database deployment method further includes: a comparison module, used to traverse the baseline data of the target database; compare the standard value and query value of each baseline data item in the baseline data to obtain a comparison result, wherein the comparison result is used to determine the status of the baseline data; and generate feedback information based on the comparison result, wherein the feedback information is used to determine abnormal data in the baseline data.
[0021] Optionally, the above database deployment method further includes: a query module, used to respond to a user's query command, obtain log information of the target database, wherein the query command is used to obtain the target query result corresponding to the query object from the target database, the target query result is used to determine the status of the query object, and the log information is used to record the operation process and exception information of the target database; based on the log information, the target query result corresponding to the query object is generated; and the target query result is fed back to the user.
[0022] To achieve the above objectives, according to another aspect of this application, a computer-readable storage medium is provided, wherein a program is stored in the computer-readable storage medium, wherein the program executes the database deployment method of any of the foregoing embodiments.
[0023] To achieve the above objectives, according to another aspect of this application, an electronic device is provided, including one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the database deployment method of any of the foregoing.
[0024] This application employs the following steps: obtaining database setup information; building an initial database on the target server based on the database setup information; reading a target script matching the initial database, wherein the target script is used to supplement the configuration of the initial database; calling the target script to supplement the configuration of the initial database to obtain the target database. This solves the problems of large errors in the target database and low database deployment efficiency caused by manually installing patches and running baselines in database deployment methods provided by related technologies. By automatically building the initial database based on database setup information and reading the target script to supplement the configuration of the initial database (such as installing patches and baseline configuration), the application achieves the effect of automatically deploying the target database, thereby reducing the error of the target database and improving the deployment efficiency of the target database. Attached Figure Description
[0025] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0026] Figure 1 This is a flowchart of a database deployment method provided according to an embodiment of this application;
[0027] Figure 2 This is a schematic diagram of an optional database deployment process according to an embodiment of this application;
[0028] Figure 3 This is a schematic diagram of another optional database deployment process according to an embodiment of this application;
[0029] Figure 4 This is a schematic diagram of another optional database deployment process according to an embodiment of this application;
[0030] Figure 5 This is a schematic diagram of another optional database deployment process according to an embodiment of this application;
[0031] Figure 6 This is a schematic diagram of another optional database deployment process according to an embodiment of this application;
[0032] Figure 7 This is a schematic diagram of another optional database deployment process according to an embodiment of this application;
[0033] Figure 8 This is a schematic diagram of another optional database deployment process according to an embodiment of this application;
[0034] Figure 9 This is a schematic diagram of a database deployment apparatus according to an embodiment of this application;
[0035] Figure 10 This is a schematic diagram of another database deployment apparatus according to an embodiment of this application;
[0036] Figure 11 This is a schematic diagram of another database deployment apparatus according to an embodiment of this application;
[0037] Figure 12 This is a schematic diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0038] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0039] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0040] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of this application described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0041] It should be noted that all relevant information (including but not limited to database setup information, user input information, etc.) and data (including but not limited to baseline data, script data, database instances, etc.) involved in this application are information and data that have been authorized by the user or fully authorized by all parties.
[0042] The following describes this application in conjunction with the preferred implementation steps. Figure 1 This is a flowchart of a database deployment method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0043] Step S101: Obtain database setup information;
[0044] In one optional solution provided by step S101 above, the database setup information can be information corresponding to each of one or more database parameters filled in by the user. These database parameters may include, but are not limited to: database username, database password, and database name. It should also be noted that this database setup information can be used to build a target database, which can be a database that meets the needs of the target user.
[0045] The database deployment method provided in this application can be applied to a database deployment platform. As an optional implementation method, the specific method for obtaining database setup information can be: the user enters the database setup information in the corresponding location on the interactive page provided by the database deployment platform. For example, the user manually enters the name of the target database in the "Database Name" input box. Furthermore, after the user has entered all the database setup information, they click "Save and Submit," so that the database deployment platform can automatically generate the setup information of the target database.
[0046] As another optional implementation method, the specific method for obtaining database setup information can be: users can download the template document of database setup information provided by the database deployment platform, fill in the corresponding database setup information, and further upload the completed database setup information document to the database deployment platform, so that the database deployment platform can automatically generate the setup information of the target database.
[0047] The following combination Figure 2 , Figure 3 , Figure 4 , Figure 5 The above methods will be further explained.
[0048] Figure 2 This is a schematic diagram of an optional database deployment process according to an embodiment of this application, such as... Figure 2 As shown, the front-end component 201 can interact with the user and can be used to receive the environment setup information input by the user (i.e., the database setup information mentioned above); the back-end task processor 202 can be used to receive and parse the database setup information received by the front-end component 201; the task executor 203 can automatically build the database according to the parsing result of the back-end task processor 202; and the target server 204 can receive and execute the instructions sent by the task executor 203.
[0049] Figure 3 This is a schematic diagram of another optional database deployment process according to an embodiment of this application, such as... Figure 3 As shown, users can log in. Figure 2The front-end component 201 shown provides a page where, based on the page prompts and user needs, the user selects the database installation method. It should be noted that this installation method can be server installation, client installation, or other methods. Figure 3 (Not shown). Further, the user enters the corresponding database setup information according to the selected installation method. This database setup information is provided by... Figure 2 The front-end component 201 shown sends data to the back-end (including but not limited to...). Figure 2 (As shown in the backend task processor 202 and task executor 203). It can also be understood that the database setup information entered by the user can be entered into the database by the backend.
[0050] Figure 4 This is a schematic diagram of another optional database deployment process according to an embodiment of this application, such as... Figure 4 As shown, when the user selects the "server-side installation" method, Figure 2 The front-end component 201 shown provides the user with a "server-side information entry" page (such as...). Figure 4 As shown), on this page, the user enters database setup information, including: entering the application name; selecting the version, where... Figure 4 The version shown is the Oracle database version (including 11g / 12c / 19c); select the storage type, where, Figure 4 The storage types shown include File System (FS) storage and ASM storage; enter the node's Internet Protocol (IP) address, Virtual Internet Protocol (VIP) address, and Private Network Address (PRIV); enter the scan address (Scan_IP); enter the database (DB) name, denoted as DB_NAME; optionally, enter the private network segment.
[0051] Figure 5 This is a schematic diagram of another optional database deployment process according to an embodiment of this application, such as... Figure 5 As shown, when the user selects the "client installation" method, Figure 2 The front-end component 201 shown provides the user with a "Client Information Entry" page (such as...). Figure 5 As shown in the image, on this page, the user enters database setup information, including: application name, IP address, version number, username, password, and length. Figure 5 The number of bits shown includes 32 bits and 64 bits.
[0052] Step S102: Based on the database setup information, build the initial database on the target server;
[0053] In one optional solution provided by step S102 above, the target server can be a server specified by the target user and capable of communicating with the target user's client (such as a smartphone or laptop). This server can be used to provide computing or application services to the target user's client. The initial database can be a database initially constructed based on database setup information. This initial database can at least have the following functions: data definition function and data manipulation function.
[0054] The following combination Figure 4 , Figure 6 The above methods will be further explained.
[0055] Still as Figure 4 As shown, after the user enters the database setup information, clicking the "Install Now" button on the page can deploy the database. During the database deployment process, the user can click the "Reset" button on the page at any time to cancel the current database deployment process and can re-enter the database setup information to reinstall the database.
[0056] Figure 6 This is a schematic diagram illustrating another optional database deployment process according to an embodiment of this application. For example... Figure 6 As shown, the database deployment platform presents database deployment information in a list format. This deployment information includes at least: Identity Document (ID), application, version, IP address, status, and operation. "Status" indicates the installation status of the corresponding database (e.g., installed, installing, pending installation), and "Operation" assists the user in deploying the database. Figure 6 The "operations" shown, from left to right, are: view database software installation progress, reinstall, install database instance, and view database instance installation progress.
[0057] Step S103: Read the target script that matches the initial database, wherein the target script is used to supplement the configuration of the initial database;
[0058] In one optional solution provided by step S103 above, the target script may include one or more script files. This target script can be executed to improve the existing functionality of the initial database, or it can be executed to add one or more additional functions to the initial database. Specifically, for example, the target script may be a latest patch script; using this latest patch script to supplement the initial data configuration can improve the response speed of the initial database. Another example is that the target script may be another patch script; using this other patch script to supplement the initial data configuration can eliminate security vulnerabilities in the initial database. It should also be noted that each script file in the target script can be executed individually to complete a database function, or multiple script files in the target script can be combined and executed to complete a database function.
[0059] In the optional solution provided in this application, reading the target script that matches the initial database can be done in the following ways: the database deployment platform contains multiple versions of the target script. After the initial database is built, the corresponding version of the target script is automatically matched according to the version of the initial database, and the basic information of the target script (such as storage location) is obtained. Further, the database deployment platform automatically reads the target script from its storage medium (or cloud). It should also be noted that the storage medium can be an external storage medium connected to the database deployment platform, or it can be a storage medium set inside the database deployment platform. The storage medium can include, but is not limited to, USB flash drives, hard drives, and flash memory.
[0060] Step S104: Call the target script to supplement the configuration of the initial database and obtain the target database.
[0061] In one optional solution provided by step S104 above, the target database can provide the target user with the functions they need, such as storing the data required by the target user and assisting the user in data management (such as querying data, adding data, modifying data, and deleting data).
[0062] In the optional solution provided in this application, a target script is invoked to supplement the initial database configuration, resulting in a target database. Specifically, the database deployment platform automatically reads the target script from its storage medium (or cloud), then automatically invokes and executes the target script to supplement the initial database configuration, enabling the target database to perform the functions corresponding to the target script. For example, the target script may be a latest patch script that can eliminate some security vulnerabilities in the database. After the initial database is built, the database deployment platform automatically reads the target script from its storage medium, and further automatically invokes and executes the target script to supplement the initial database configuration, enabling the target database to eliminate some of its own security vulnerabilities.
[0063] This application employs the following steps: obtaining database setup information; building an initial database on the target server based on the database setup information; reading a target script matching the initial database, wherein the target script is used to supplement the configuration of the initial database; calling the target script to supplement the configuration of the initial database to obtain the target database. This solves the problems of large errors in the target database and low database deployment efficiency caused by manually installing patches and running baselines in database deployment methods provided by related technologies. By automatically building the initial database based on database setup information and reading the target script to supplement the configuration of the initial database (such as installing patches and baseline configuration), the application achieves the effect of automatically deploying the target database, thereby reducing the error of the target database and improving the deployment efficiency of the target database.
[0064] Optionally, in the database deployment method provided in this application embodiment, building an initial database on the target server based on database setup information includes:
[0065] Step S1021: Parse the database setup information to obtain the basic information of the target database and the control instructions of the target database;
[0066] Step S1022: Using basic information and control commands, build the initial database on the target server.
[0067] In one optional solution provided by steps S1021 to S1022 above, the basic information may include, but is not limited to: the IP address, username, name, and character set of the target database. The control commands can be used to control the setup of the initial database and the target database, and these control commands may include, but are not limited to: installation commands, query commands, and reinstallation commands. It should also be noted that the installation commands include, but are not limited to: client installation commands, single-node server installation commands, and multi-node server installation commands.
[0068] Still as Figure 2 As shown, after receiving the environment setup information input by the user, the front-end component 201 automatically parses the information to obtain the basic information of the database to be installed and the corresponding control commands. Then, it automatically transmits the basic information and control commands to... Figure 3 The backend shown.
[0069] In the above optional embodiments, the technical effect that can be achieved is: to automatically parse the database construction information input by the user and automatically transmit the parsing results to further build the database. Through a series of automated operations (parsing and transmission), the processing efficiency of database construction information is improved and the error caused by manual processing of database construction information is reduced.
[0070] Optionally, in the database deployment method provided in this application embodiment, building an initial database on the target server using basic information and control instructions includes:
[0071] Step S10221: Based on the basic information and preset compilation documents, compile the configuration file for the target database;
[0072] Step S10222: Based on the control instructions and configuration files, build the initial database on the target server.
[0073] In one optional solution provided by steps S10221 to S10222 above, the aforementioned preset configuration file can be a template file pre-made by technicians within the database deployment platform. This template file can be used to compile the configuration file required for the target database deployment process. It should also be noted that the template file may include one or more parameters to be determined, each of which can be determined by the corresponding parameter information in the basic information of the target database. The aforementioned configuration file can be used to configure the initial database, and this configuration file may include, but is not limited to: basic configuration files, software, and instance response files.
[0074] In the optional solution provided in this application, the configuration file of the target database is prepared based on the basic information and the preset preparation file. The specific method can be: the database deployment platform automatically obtains the internal preset preparation file, and improves the parameter information to be determined in the preset preparation file based on the basic information of the target database obtained after parsing. Then, the configuration file of the target database is automatically prepared based on the improved preset preparation file, and the initial database is automatically built based on the control instructions of the target database and the configuration file.
[0075] In the above optional embodiments, the technical effects that can be achieved are: automating the compilation of the configuration file of the target database, and automatically building the initial database based on the control instructions and configuration file of the target database. Through a series of automated operations (compilation and building), the errors caused by manual database deployment are reduced, the compilation efficiency of the configuration file is improved, and thus the database deployment efficiency is improved.
[0076] Optionally, in the database deployment method provided in this application embodiment, building an initial database on the target server according to control instructions and configuration files includes:
[0077] Step S10223: Read the target configuration data from the configuration file;
[0078] Step S10224: Based on the control instructions and target configuration data, build the initial database on the target server.
[0079] In one optional solution provided by steps S10223 to S10224 above, the target configuration data is one or more data in the configuration file that perform a specific function, which may include, but is not limited to: installing database software and installing a database instance.
[0080] In the optional solution provided in this application, the target configuration data of the configuration file is read, and an initial database is built on the target database according to the control instructions and the target configuration data. The specific method can be: after the database deployment platform completes the configuration file, it automatically reads the target configuration data of the configuration file from the internal storage medium, and further, automatically executes the control instructions of the target database, and automatically builds the initial database in combination with the read target configuration data.
[0081] In the above optional embodiments, the technical effect that can be achieved is: by automatically reading the target configuration data and automatically executing the control instructions of the target database, the initial database is automatically built on the target server, thereby reducing the errors caused by manually processing the target configuration data and manually building the database, and improving the database deployment efficiency.
[0082] Optionally, in the database deployment method provided in this application embodiment, the target script is called to supplement the initial database configuration, resulting in a target database including:
[0083] Step S1041: Parse the target script to obtain the parsing result;
[0084] Step S1042: Using the parsing results, supplement the configuration of the initial database to obtain the target database.
[0085] In one optional solution provided by steps S1041 to S1042 above, the parsing result may be data in the target script used to complete the corresponding function or instructions to execute the corresponding function. The corresponding function may include, but is not limited to, patching and baseline configuration.
[0086] As an optional implementation, the target script is parsed to obtain the parsing result, and the initial database is supplemented with the parsing result to obtain the target database. Specifically, the target script is a newly patched script containing multiple operation instructions that can be used to eliminate a security vulnerability in the database. The database deployment platform automatically calls the target script from its internal storage medium, further automatically parses the target script to obtain the aforementioned multiple operation instructions, and then automatically executes the multiple operation instructions to supplement the initial database configuration, thereby eliminating the aforementioned security vulnerability in the initial database and obtaining the target database.
[0087] In the above optional embodiments, the technical effect that can be achieved is that by automatically calling and parsing the target script and automatically executing the script data of the target script, the initial database is automatically supplemented and configured, thereby improving the configuration efficiency of the initial database and thus improving the deployment efficiency of the target database.
[0088] Optionally, the database deployment method provided in this application embodiment further includes:
[0089] Step S1051: Traverse the baseline data of the target database;
[0090] Step S1052: Compare the standard value and query value of each baseline data item in the baseline data to obtain the comparison result, wherein the comparison result is used to determine the status of the baseline data;
[0091] Step S1053: Based on the comparison results, generate feedback information, wherein the feedback information is used to identify abnormal data in the baseline data.
[0092] In one optional scheme provided by steps S1051 to S1053 above, the baseline data can be each piece of data in the deployed target database. The standard value can be the optimal value of the corresponding baseline data. It should also be noted that the optimal value can be determined by technical personnel based on historical database business time, and the initial database can be supplemented and configured using the above supplementary configuration method. The query value can be the actual value of the baseline data in the target database. The comparison result can be whether the standard value corresponding to the baseline data is the same as the query value. Specifically, for example, if the query value of a certain baseline data in the target database is the same as the standard value, it can be determined that the baseline data is valid data (or normal data). The feedback information can be used to provide feedback to the user on abnormal baseline data in the target database. It should also be noted that the feedback information can be presented to the target user through the interaction page between the database deployment platform and the user. This presentation method can include, but is not limited to: highlighting on the interaction page, presenting in table form, and presenting in document form.
[0093] The following combination Figure 7 , Figure 8 The above methods will be further explained.
[0094] Figure 7 This is a schematic diagram of another optional database deployment process according to an embodiment of this application, such as... Figure 7 As shown, each row of data represents a baseline data item. The parameters for this baseline data include: baseline name, standard value, original environment query value, and new environment query value (i.e., the aforementioned query value). The "original environment" can be the source server, and the "new environment" can be the target server. After the target database is deployed, the database deployment platform automatically iterates through all the baseline data, automatically comparing the standard value of each baseline data item with the new environment query value. When the two are inconsistent, it indicates that the baseline data is abnormal, and the baseline data is automatically highlighted (e.g., ...). Figure 7 (shown in bold) to provide feedback to the target user.
[0095] Figure 8 This is a schematic diagram of another optional database deployment process according to an embodiment of this application, such as... Figure 8 As shown, when the "origin environment" (i.e., the original server) does not exist, the origin environment query value for each baseline data item in the target database is "NULL".
[0096] In the above optional embodiments, the technical effect that can be achieved is: by automatically traversing all baseline data in the target database and automatically comparing the standard value and query value of each baseline data, and automatically generating feedback information to provide to the target user based on the comparison results, the automatic monitoring and feedback of the target database data is realized, thereby improving the processing efficiency of the target database data and saving human resources costs.
[0097] Optionally, the database deployment method provided in this application embodiment further includes:
[0098] Step S1061: In response to the user's query command, obtain the log information of the target database. The query command is used to obtain the target query result corresponding to the query object from the target database. The target query result is used to determine the status of the query object. The log information is used to record the operation process and abnormal information of the target database.
[0099] Step S1062: Based on the log information, generate the target query result corresponding to the query object;
[0100] Step S1063: Return the target query results to the user.
[0101] In one optional solution provided by steps S1061 to S1063 above, the query object may include, but is not limited to, database software and database instances. The query command may be used to query the status of the query object (e.g., installation progress). The operation process of the target database may include, but is not limited to, data query, data addition, data deletion, and data modification. The abnormal information may include, but is not limited to, abnormal data and abnormal operation processes of the target database. The target query result may include, but is not limited to, the status of the query object.
[0102] Still as Figure 3 As shown, after the backend of the database deployment platform receives the database setup information from the frontend, it calls the corresponding Shell script and passes the database setup information as a parameter to the Shell script. Furthermore, the Shell script sends the included database installation script to the target IP address of the target database and executes the database installation script to automatically install the target database on the target server. During the target database installation process, a database installation log is generated, which can be stored in the storage medium of the database deployment platform.
[0103] Still as Figure 3 As shown, after the target database is installed, users can... Figure 6The "Operation" section of the interactive page allows users to query the installation progress of a specific object. Upon receiving the installation progress query request, the backend calls the corresponding Shell script, passing relevant parameters (e.g., the IP address of the queried object). Based on the IP address, the Shell script automatically executes the query command corresponding to the query request, thereby automatically obtaining the installation progress (i.e., the target query result), generating log information, and returning the target query result to the backend. The backend, upon receiving the target query result, returns it to the frontend page and displays it to the user. Furthermore, if the user encounters an installation failure message, they can modify the settings according to the error message and click "Reinstall." During this process, the user does not need to re-enter any information.
[0104] It is readily understood that, based on the method steps provided in the above embodiments of this application, the beneficial effects that the technical solution of this application can achieve include:
[0105] Beneficial effects (1): The target database is automatically built based on the acquired database building information, which not only shortens the target database building time and improves the target database building efficiency, but also effectively avoids the errors in the target database caused by the manual interactive building process;
[0106] Beneficial effects (2): The database deployment method provided in this application is not only applicable to different scenarios such as multiple nodes of Real Application Clusters (RAC), one node of Real Application Clusters (RACONE), single instance, master and backup, but also supports a variety of databases and different versions of databases (such as Oracle database versions 11g, 12c, and 19c), as well as multiple platforms (such as Linux, SuSE, and Red Hat), which improves the applicability of the database deployment method and can meet the database deployment needs of different users.
[0107] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0108] This application also provides a database deployment apparatus. It should be noted that the database deployment apparatus of this application can be used to execute the database deployment method provided in this application. The database deployment apparatus provided in this application will be described below.
[0109] Figure 9 This is a schematic diagram of a database deployment apparatus according to an embodiment of this application. Figure 9 The device includes:
[0110] Module 901 is used to obtain database setup information;
[0111] Module 902 is used to build the initial database on the target server based on the database setup information;
[0112] The reading module 903 is used to read the target script that matches the initial database, wherein the target script is used to supplement the configuration of the initial database;
[0113] Processing module 904 is used to call the target script, configure the initial database, and obtain the target database.
[0114] Optionally, the aforementioned construction module 901 is also used to: parse the database construction information to obtain the basic information of the target database and the control instructions of the target database; and use the basic information and control instructions to build an initial database on the target server.
[0115] Optionally, the aforementioned setup module 901 is also used to: compile a configuration file for the target database based on basic information and preset compilation documents; and to build an initial database on the target server based on control instructions and the configuration file.
[0116] Optionally, the aforementioned setup module 901 is also used to: read the target configuration data from the configuration file; and build an initial database on the target server based on the control instructions and the target configuration data.
[0117] Optionally, the processing module 904 is further configured to: parse the target script to obtain the parsing result; and use the parsing result to supplement the configuration of the initial database to obtain the target database.
[0118] Optionally, Figure 10 This is a schematic diagram of another database deployment apparatus according to an embodiment of this application. Figure 10 As shown, the device includes, in addition to including Figure 9 In addition to all the modules shown, it also includes: a comparison module 905, used to traverse the baseline data of the target database; compare the standard value and query value of each baseline data item in the baseline data to obtain the comparison result, wherein the comparison result is used to determine the status of the baseline data; and generate feedback information based on the comparison result, wherein the feedback information is used to determine abnormal data in the baseline data.
[0119] Optionally, Figure 11 This is a schematic diagram of another database deployment apparatus according to an embodiment of this application. Figure 11 As shown, the device includes, in addition to including Figure 10 In addition to all the modules shown, it also includes: a query module 906, which is used to respond to the user's query command, obtain the log information of the target database, wherein the query command is used to obtain the target query result corresponding to the query object from the target database, the target query result is used to determine the status of the query object, the log information is used to record the operation process and abnormal information of the target database; based on the log information, the target query result corresponding to the query object is generated; and the target query result is fed back to the user.
[0120] The database deployment apparatus provided in this application embodiment includes an acquisition module 901 for acquiring database setup information; a setup module 902 for setting up an initial database on a target server based on the database setup information; a reading module 903 for reading a target script that matches the initial database, wherein the target script is used to supplement the configuration of the initial database; and a processing module 904 for calling the target script to configure the initial database and obtain the target database. This solves the problems of large errors in the target database and low database deployment efficiency caused by manually installing patches and running baselines in the database deployment methods provided by related technologies. By automatically setting up the initial database based on the database setup information and reading the target script to supplement the configuration of the initial database (such as installing patches and configuring baselines), the apparatus achieves the effect of automatically deploying the target database, thereby reducing the error of the target database and improving the deployment efficiency of the target database.
[0121] The database deployment device includes a processor and a memory. The aforementioned units are all stored in the memory as program units, and the processor executes the aforementioned program units stored in the memory to achieve the corresponding functions.
[0122] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and by adjusting kernel parameters, the goal of automating database deployment without manual intervention can be achieved.
[0123] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0124] This application provides a computer-readable storage medium storing a program that, when executed by a processor, implements the database deployment method.
[0125] This application provides a processor for running a program, wherein the program executes a database deployment method during runtime.
[0126] Figure 12 This is a schematic diagram of an electronic device according to an embodiment of this application, such as... Figure 12 As shown, this application embodiment provides an electronic device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps:
[0127] Obtain database setup information; based on the database setup information, build an initial database on the target server; read the target script that matches the initial database, where the target script is used to supplement the configuration of the initial database; call the target script to supplement the configuration of the initial database, and obtain the target database.
[0128] Optionally, building an initial database on the target server based on the database setup information includes: parsing the database setup information to obtain the basic information and control instructions of the target database; and using the basic information and control instructions to build the initial database on the target server.
[0129] Optionally, building an initial database on the target server using basic information and control commands includes: compiling a configuration file for the target database based on the basic information and preset compilation documents; and building the initial database on the target server based on the control commands and configuration file.
[0130] Optionally, building an initial database on the target server according to control instructions and configuration files includes: reading the target configuration data from the configuration file; and building the initial database on the target server according to control instructions and target configuration data.
[0131] Optionally, calling the target script to supplement the initial database configuration to obtain the target database includes: parsing the target script to obtain the parsing result; and using the parsing result to supplement the initial database configuration to obtain the target database.
[0132] Optionally, the above database deployment method further includes: traversing the baseline data of the target database; comparing the standard value and the query value of each baseline data item in the baseline data to obtain a comparison result, wherein the comparison result is used to determine the status of the baseline data; and generating feedback information based on the comparison result, wherein the feedback information is used to determine abnormal data in the baseline data.
[0133] Optionally, the above database deployment method further includes: responding to a user's query command, obtaining log information of the target database, wherein the query command is used to obtain the target query result corresponding to the query object from the target database, the target query result is used to determine the status of the query object, and the log information is used to record the operation process and exception information of the target database; generating the target query result corresponding to the query object based on the log information; and feeding back the target query result to the user.
[0134] The devices mentioned in this article can be servers, personal computers (PCs), tablets (PADs), mobile phones, etc.
[0135] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that initializes the following method steps:
[0136] Obtain database setup information; based on the database setup information, build an initial database on the target server; read the target script that matches the initial database, where the target script is used to supplement the configuration of the initial database; call the target script to supplement the configuration of the initial database, and obtain the target database.
[0137] Optionally, building an initial database on the target server based on the database setup information includes: parsing the database setup information to obtain the basic information and control instructions of the target database; and using the basic information and control instructions to build the initial database on the target server.
[0138] Optionally, building an initial database on the target server using basic information and control commands includes: compiling a configuration file for the target database based on the basic information and preset compilation documents; and building the initial database on the target server based on the control commands and configuration file.
[0139] Optionally, building an initial database on the target server according to control instructions and configuration files includes: reading the target configuration data from the configuration file; and building the initial database on the target server according to control instructions and target configuration data.
[0140] Optionally, calling the target script to supplement the initial database configuration to obtain the target database includes: parsing the target script to obtain the parsing result; and using the parsing result to supplement the initial database configuration to obtain the target database.
[0141] Optionally, the above database deployment method further includes: traversing the baseline data of the target database; comparing the standard value and the query value of each baseline data item in the baseline data to obtain a comparison result, wherein the comparison result is used to determine the status of the baseline data; and generating feedback information based on the comparison result, wherein the feedback information is used to determine abnormal data in the baseline data.
[0142] Optionally, the above database deployment method further includes: responding to a user's query command, obtaining log information of the target database, wherein the query command is used to obtain the target query result corresponding to the query object from the target database, the target query result is used to determine the status of the query object, and the log information is used to record the operation process and exception information of the target database; generating the target query result corresponding to the query object based on the log information; and feeding back the target query result to the user.
[0143] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0144] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0146] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0147] In a typical configuration, a computing device includes one or more processors (Central Processing Unit, CPU), input / output interfaces, network interfaces, and memory.
[0148] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0149] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0150] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0151] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0152] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A database deployment method, characterized in that, include: Obtain database setup information; Based on the database setup information, an initial database is built on the target server; Read the target script that matches the initial database, wherein the target script is used to supplement the initial database configuration, and the target script is obtained according to the version of the initial database; The target script is invoked to supplement the configuration of the initial database, thereby obtaining the target database; The process of building an initial database on the target server based on the database construction information includes: parsing the database construction information to obtain the basic information and control instructions of the target database; compiling a configuration file for the target database according to the basic information and a preset compilation file, wherein the basic information is used to complete the parameter information to be determined in the preset compilation file; reading the target configuration data of the configuration file; and building the initial database on the target server according to the control instructions and the target configuration data.
2. The database deployment method according to claim 1, characterized in that, The target script is invoked to supplement the initial database with additional configurations, resulting in the target database comprising: The target script is parsed to obtain the parsing result; Using the parsing results, the initial database is supplemented and configured to obtain the target database.
3. The database deployment method according to claim 1, characterized in that, The database deployment method also includes: Traverse the baseline data of the target database; The standard value and the query value of each baseline data item in the baseline data are compared to obtain the comparison result, wherein the comparison result is used to determine the status of the baseline data; Based on the comparison results, feedback information is generated, wherein the feedback information is used to identify abnormal data in the baseline data.
4. The database deployment method according to claim 1, characterized in that, The database deployment method also includes: In response to a user's query command, log information of the target database is obtained, wherein the query command is used to obtain the target query result corresponding to the query object from the target database, the target query result is used to determine the status of the query object, and the log information is used to record the operation process and abnormal information of the target database; Based on the log information, generate the target query result corresponding to the query object; The target query results are then returned to the user.
5. A database deployment apparatus, characterized in that, include: The acquisition module is used to obtain database setup information; A setup module is used to set up an initial database on the target server based on the database setup information. A reading module is used to read a target script that matches the initial database, wherein the target script is used to supplement the initial database configuration, and wherein the target script is obtained according to the version of the initial database; The processing module is used to call the target script to configure the initial database and obtain the target database; The setup module is further configured to parse the database setup information to obtain the basic information and control instructions of the target database; based on the basic information and a preset configuration file, to compile the configuration file of the target database, wherein the basic information is used to complete the parameter information to be determined in the preset configuration file; to read the target configuration data of the configuration file; and to build the initial database on the target server based on the control instructions and the target configuration data.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a program that executes the database deployment method according to any one of claims 1 to 4.
7. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the database deployment method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Automatic database performance analysis and early warning system
CN104102668A
Database deployment method and device, computer equipment and storage medium
CN108959385A