A database 0-removing method and device, computer device and storage medium

By using automated scripts and data synchronization tools, the problem of lacking process-oriented and automated tools in the database migration process was solved, realizing efficient and automated migration from Oracle to domestic databases, reducing time and manpower costs.

CN116821088BActive Publication Date: 2025-11-25PING AN TECH (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310650837.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-02
Publication Date
2025-11-25
Estimated Expiration
2043-06-02

AI Technical Summary

Technical Problem

The lack of streamlined and automated database migration tools in existing technologies makes it difficult to migrate databases from Oracle to domestic databases, especially for companies with insufficient experience, where leaving Oracle is fraught with difficulties.

Method used

By employing automated scripts and data synchronization tools, and obtaining database subsystem inventory information, user information, table information, package information, job information, and Dblink information, the platform's automated tools and data synchronization tools, such as OGG or KETTLE, are used to perform database migration, achieving a streamlined and automated process for migrating away from Oracle.

Benefits of technology

It enabled the streamlined and automated migration of medical data, saving time and manpower costs, filling the gap in the database migration from Oracle, and ensuring the smooth progress of the migration process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116821088B_ABST
    Figure CN116821088B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of medical data management, and discloses a database 0-removing method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring subsystem list information in a database by using a platform automatic tool, acquiring user information directly connected to the database within a set time dimension, and obtaining project group information related to the database 0-removal according to the user information and the subsystem list information; querying the database by using an automatic script, acquiring table information needing to be migrated in the database, and extracting PACKAGE information, job information and Dblink information in the database; based on the project group information, the table information, the PACKAGE information, the job information and the Dblink information, performing data migration on the database by using a data synchronization tool, and completing the database 0-removal. The application realizes process-based and automatic 0-removing information sorting and automatic migration of a medical database, and fills the gap of the medical database 0-removal.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medical data management, in particular to a database 0-removing method and device, computer equipment and storage medium. BACKGROUND

[0002] With the continuous development of Internet technology, Oracle database has been popular in the Chinese market for many years. Using Internet technology and Oracle database technology to build a data warehouse, storing medical data in an Oracle database to manage daily comprehensive business information of a hospital can improve the comprehensive medical service level of the hospital.

[0003] At present, the national regulatory authorities have clearly proposed the requirements of software self-controlling and software localization. At the same time, the application framework and software products based on open source databases are becoming more and more mature, and more and more software and applications no longer choose Oracle database but use domestic databases. Therefore, database 0-removing has become an urgent need for many companies in recent years. Migrating data storage business from an Oracle database to a domestic database and migrating medical data stored in an Oracle database to a domestic database have become the general trend. However, there is no process-based and automated 0-removing tool in the prior art, and it is difficult for some companies with insufficient 0-removing experience to remove 0. SUMMARY

[0004] The present application provides a database 0-removing method, device, computer equipment and storage medium, aiming to solve the technical problems of lack of process-based and automated 0-removing tools and high difficulty of database 0-removing in the prior art.

[0005] To solve the above technical problems, the technical solution adopted by the present application is as follows:

[0006] A database 0-removing method comprises the following steps:

[0007] A platform automatic tool is used to obtain subsystem list information in a database and user information directly connected to the database within a set time dimension, and project group information related to 0-removing of the database is obtained according to the user information and the subsystem list information;

[0008] An automatic script is used to query the database, obtain table information that needs to be migrated in the database, and extract PACKAGE information, job information and Dblink information in the database;

[0009] Based on the project group information, table information, PACKAGE information, job information and Dblink information, a data synchronization tool is used to perform data migration on the database, and 0-removing of the database is completed.

[0010] The technical scheme adopted by the embodiment of the present application further includes that the subsystem list information includes state information and person-in-charge information of each subsystem, and the project group information related to the database is obtained according to the user information and the subsystem list information, and specifically is:

[0011] The database table / view:v$active_session_history,dba_users is queried by using a first automatic script to obtain user information having an operation record in the database within a set time dimension;

[0012] The user information is associated with the subsystem list information, the subsystem list information is filtered according to the association result, and the filtered subsystem list information is the project group information related to the database.

[0013] The technical scheme adopted by the embodiment of the present application further includes that the database is queried by using an automatic script to obtain table information needing to be migrated in the database, and specifically is:

[0014] The database table:dba_role_privs,dba_tab_privs,dba_tab_comments is queried by using a second automatic script to sort the table information associated with the database, and the table information needing to be migrated is obtained; the table information includes a table name, an authorized user, a right of the authorized user to the table and description information of the table.

[0015] The technical scheme adopted by the embodiment of the present application further includes that the PACKAGE information, job information and Dblink information in the database are extracted, and specifically includes:

[0016] The database internal associated table:dba_objects is queried by using a third automatic script to extract the PACKAGE information in the database; the extracted PACKAGE information includes a PACKAGE name, a PACKAGE user owner, a PACKAGE type and definition.

[0017] The technical scheme adopted by the embodiment of the present application further includes that the PACKAGE information, job information and Dblink information in the database are extracted, and specifically includes:

[0018] The database internal associated table:dba_jobs is queried by using a fourth automatic script to sort the job information in the database, and the job information of the database is obtained; the obtained job information includes a job name, a job description / function, a user to which the job belongs, a job state, a last execution time, a next execution time and an execution frequency.

[0019] The technical scheme adopted by the embodiment of the present application further includes that the extracting the PACKAGE information, the job information and the Dblink information in the database further includes:

[0020] The fifth automation script is used to query the internally associated table dba_db_links of the database, the data synchronization task Dblink in the database is sorted, the Dblink information of the database is obtained, and the Dblink information includes the user owner of the dblink, the dblink name, the host information of the data synchronization and the creation time.

[0021] The technical scheme adopted by the embodiment of the present application further includes that the data synchronization tool is OGG or KETTLE.

[0022] Another technical scheme adopted by the embodiment of the present application is a database 0 removal device, which comprises:

[0023] The project group acquisition module is used to acquire the subsystem list information in the database by using the platform automation tool, acquire the user information directly connected to the database within a set time dimension, and obtain the project group information related to the database 0 removal according to the user information and the subsystem list information.

[0024] The database information extraction module is used to query the database by using an automation script, acquire the table information to be migrated in the database, and extract the PACKAGE information, the job information and the Dblink information in the database.

[0025] The data migration module is used to perform data migration on the database by using a data synchronization tool based on the project group information, the table information, the PACKAGE information, the job information and the Dblink information, and complete the database 0 removal.

[0026] Still another technical scheme adopted by the embodiment of the present application is a computer device, which comprises:

[0027] A memory storing executable program instructions;

[0028] A processor connected with the memory;

[0029] The processor calls the executable program instructions stored in the memory to execute the database 0 removal method as described above.

[0030] Still another technical scheme adopted by the embodiment of the present application is a storage medium storing program instructions executable by a processor, and the program instructions are used to execute the above-mentioned database 0 removal method.

[0031] The database 0-removing method, device, computer device and storage medium of the embodiment of the present application propose a general automatic 0-removing scheme, through automatic collection of item group information, table information, PACKAGE information, job information and data synchronization task Dblink involved in 0-removal by automatic script, data migration of the table needing migration is performed by using a data synchronization tool. The present application can realize streamlined and automated 0-removing information analysis and automatic database migration, greatly saving time and labor cost, and filling the gap of database 0-removal. BRIEF DESCRIPTION OF DRAWINGS

[0032] Figure 1 is a flowchart of the database 0-removing method of the first embodiment of the present application;

[0033] Figure 2 is a flowchart of the database 0-removing method of the second embodiment of the present application;

[0034] Figure 3 is a structural diagram of the database 0-removing device of the embodiment of the present application;

[0035] Figure 4 is a structural diagram of the computer device of the embodiment of the present application;

[0036] Figure 5 is a structural diagram of the storage medium of the embodiment of the present application. DETAILED DESCRIPTION

[0037] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0038] The terms "first", "second", "third" in the present application are only for descriptive purpose, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second", "third" can explicitly or implicitly include at least one of the features. In the description of the present application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise explicitly and specifically limited. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present application are only used to explain the relative position relationship, movement condition, etc. between components in a certain posture (as shown in the drawings), and if the certain posture changes, the directional indications also change accordingly. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but can optionally include steps or units not listed, or can optionally include other steps or units inherent to the process, method, product or device.

[0039] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily mutually exclusive or alternative embodiments. It is expressly understood that the embodiments described herein are merely examples from among a great variety of embodiments that can be made as described above.

[0040] Please refer to Figure 1 is a flowchart of a database 0-out method of the first embodiment of the present application. The database 0-out method of the first embodiment of the present application includes the following steps:

[0041] S100: Obtain subsystem list information in the database by using a platform automation tool, and obtain user information directly connected to the database within a set time dimension, obtain project group information related to the database 0-out according to the user information and the subsystem list information;

[0042] In this step, the obtained subsystem list information includes but is not limited to subsystem state information and information of persons in charge of each link such as development, testing, operation and maintenance or business in the subsystem. The present application embodiment manages all subsystems by using a platform automation tool. For each newly created or changed subsystem, the platform automation tool automatically enters or modifies the related information of the subsystem. When the database 0-out is performed, the platform automation tool automatically obtains the list information of all subsystems, so that the subsystems involved in the 0-out and the subsystem persons in charge can be accurately counted and notified, facilitating the subsequent 0-out work.

[0043] Taking each medical branch belonging to the same medical platform as an example, the obtained subsystem list information includes but is not limited to state information of each medical branch system and information of persons in charge of each link such as development, test, operation and maintenance or business in the subsystem, taking each department belonging to the same medical institution as an example, the obtained subsystem list information includes but is not limited to state information of each department system and information of persons in charge of each link such as development, test, operation and maintenance or business in the subsystem; when performing database 0, the platform automatic tool automatically obtains the list information of all subsystems, thereby accurately counting and notifying the subsystems and the subsystem persons in charge involved in 0.

[0044] S110: querying the database by using an automatic script, obtaining table information needing migration in the database, and extracting PACKAGE information, job information and Dblink information in the database;

[0045] In this step, the obtained table information includes but is not limited to table name, authorized user, permission of the authorized user to the table and description information of the table, and the database tables needing to be queried are dba_role_privs, dba_tab_privs and dba_tab_comments. The extracted PACKAGE information includes but is not limited to PACKAGE name, PACKAGE user owner, PACKAGE type and specific definition, and the database internally associated table is dba_objects. The obtained job information includes but is not limited to job name, job description / function, user belonging to the job, job state, last execution time, next execution time and execution frequency, and the database internally associated table is dba_jobs. The obtained Dblink information includes but is not limited to user owner of the dblink, dblink name, host information of data synchronization and creation time, and the database internally associated table is dba_db_links.

[0046] S120: based on the project group information, table information, PACKAGE information, job information and Dblink information, performing data migration on the database by using a data synchronization tool, and completing 0 of the database;

[0047] In this step, the data synchronization tool includes but is not limited to OGG or KETTLE.

[0048] Based on the above, the database 0 removal method of the first embodiment of the application automatically collects the project group information, table information, PACKAGE information, job information and data synchronization task Dblink involved in 0 removal through an automatic script, and then uses a data synchronization tool to perform data migration on the tables that need to be migrated. The application realizes the flow and automation of medical data 0 information sorting and the automatic migration of medical databases, greatly saves time and labor costs, and fills the gap of database 0 removal.

[0049] Please refer to Figure 2 is a flowchart of the database 0 removal method of the second embodiment of the application. The database 0 removal method of the second embodiment of the application comprises the following steps:

[0050] S200: Use a platform automation tool to obtain subsystem list information in the database;

[0051] In this step, since each schema (schema) in the database corresponds to different subsystems, it is necessary to collect the list information of each subsystem. The collected subsystem list information includes but is not limited to subsystem state information and the information of the person in charge of each link such as development, testing, operation and maintenance or business in the subsystem.

[0052] As an optional implementation, taking the medical data stored in a medical institution as an example, since the medical institution contains multiple departments, each department as a branch stores medical data information of different time dimensions and different users. If the subsystem list information is maintained manually, it is relatively complex and inefficient. Therefore, the application embodiment uses a platform automation tool to manage all subsystems. For each newly created or changed subsystem, the relevant information of the subsystem is automatically entered or modified. When performing database 0 removal, the platform automation tool automatically obtains the list information of all subsystems, so that the subsystems involved in 0 removal and the subsystem responsible persons can be accurately counted and notified, facilitating the subsequent 0 removal work.

[0053] S210: Use a first automatic script to query the database table / view, obtain the user information of the direct connection database within the set time dimension, and filter the subsystem list information according to the obtained user information to obtain the project group information involved in 0 removal;

[0054] In this step, after obtaining the subsystem list information in the database, the database table / view: v$active_session_history, dba_users is queried according to the set time dimension: the query information includes but is not limited to database users, host information, etc. to confirm the user information of the recent database operation record, and the subsystem list information is screened according to the user information to narrow the corresponding upstream and downstream range. In the embodiment of the application, the subsystem list information is screened according to the user information, specifically: the user information obtained in this step is associated with the subsystem list information obtained in the previous step, the subsystem list information is screened according to the association result, and the screened subsystem list information is the project group information involved in the go 0, which includes the subsystems involved in the go 0 and the corresponding subsystem responsible person information. Specifically, the first automated script for querying the database table / view is as follows:

[0055] select a.username,b.*from dba_users a,(select distinct MACHINE,PROGRAM,MODULE,user_id from v$active_session_history where user_id not in(select user_id from dba_users where username like'%OPR'OR USERNAME in('SYS','OVSEE','DBMGR','FOGLIGHT'))and sample_time>=to_date('&begintime','yyyymmddhh24mi'))b where a.user_id=b.user_id;

[0056] S220: querying the database by using the second automated script to comb the table information associated with the database to obtain the table information that needs to be migrated;

[0057] In this step, after obtaining the project group information involved in the go 0, the table information associated with the database needs to be combed to confirm which tables need to be migrated and which tables do not need to be migrated. The table information that needs to be combed includes but is not limited to table name, authorized user, table permission of the authorized user and table description information, etc. Among them, the database tables that need to be queried are: dba_role_privs, dba_tab_privs, dba_tab_comments. The second automated script for querying the database is as follows:

[0058] select bb.grantee,bb.table_name,bb.privilege,cc.comments

[0059] from(

[0060] select grantee,table_name,privilege from (

[0062] select a.grantee,b.table_name,b.privilege from

[0063] dba_role_privs a,

[0064] dba_tab_privs b

[0065] where a.granted_role=b.grantee

[0066] and a.grantee like '%OPR'

[0067] union all

[0068] select c.grantee,c.table_name,c.privilege from

[0069] dba_tab_privs c

[0070] where c.grantee like '%OPR'

[0071] )aa

[0072] group by grantee,table_name,privilege)bb leftjoin dba_tab_comments ccon bb.table_name=cc.table_name order by bb.grantee

[0073] S230: Use a third-party automated script to query the tables within the database and extract the PACKAGE information from the database;

[0074] In this step, the database 0 removal process also includes the modification process of the internal PACKAGE of the database, therefore, the PACKAGE information extraction in the database is an essential link. The embodiment of the application extracts the corresponding PACKAGE information through a database script. The extracted PACKAGE information includes but is not limited to the PACKAGE name, the PACKAGE user owner, the PACKAGE type and specific definition, etc. The internal associated table of the database is: dba_objects, and the third automatic script for querying the database is as follows:

[0075] select owner, object_name, object_type from dba_objects where object_type in ('PACKAGE', 'PACKAGE BODY', 'PROCEDURE') and owner in ('HIMSCDE', 'EHISJOB', 'VOUCDE', 'DEPLOYOP', 'EHISDATA', 'HRCSCDE', 'EHISCDE') order by object_type

[0076] S240: The internal associated table of the database is queried by using the fourth automatic script, the job information in the database is sorted, and the job information of the database is obtained;

[0077] In this step, since the 0 removal work needs to sort out the internal scheduled tasks of the database to ensure that the migration work does not miss the scheduled tasks, therefore, the internal scheduled tasks of the database are also the key link of the 0 removal. The embodiment of the application sorts out the job information in the database by querying the internal associated table of the database by using a related script, and the sorted job information includes but is not limited to the job name, the job description / function, the user to which the job belongs, the job state, the last execution time, the next execution time, the execution frequency, etc. The internal associated table of the database is: dba_jobs, and the fourth automatic script for querying the database is as follows:

[0078] "select substr(substr(a.what, 1, length(a.what)-1), INSTR(substr(a.what, 1, length(a.what)-1), '.') +1) as job_name, b.description, a.schema_user, a.last_date, a.NEXT_DATE, a.BROKEN, a.interval, b.early_start_up, b.lately_start_up from dba_jobs a

[0079] left join ehisjob.job_schedule_table b

[0080] on substr(substr(a.what,1,length(a.what)

[0081] 1),INSTR(substr(a.what,1,length(a.what)-1),'.')+1)=b.job_name

[0082] where a.log_user='EHISJOB'and a.broken='N'

[0083] order by a.next_sec;

[0084] "

[0085] S250: query the internally associated table of the database by using the fifth automatic script, comb the data synchronization task Dblink in the database, and obtain the Dblink information of the database;

[0086] In this step, since the Oracle databases synchronize data by using the Dblink mode, this work must be known in advance at the time of the go 0, so as to ensure that the medical data transmission in the new system after the go 0 will not be interrupted, and the medical data transmission function runs normally. Therefore, it is necessary to comb the data synchronization task Dblink in the database. The Dblink information to be combed includes but is not limited to the user owner of the Dblink, the Dblink name, the host information of the data synchronization, and the creation time, etc. As an optional implementation manner, the medical data stored in the Oracle database is taken as an example. The go 0 must be known in advance, so as to ensure that the medical data transmission in the new system after the go 0 will not be interrupted, and the medical data transmission function runs normally. The internally associated table of the database is: dba_db_links, and the fifth automatic script for querying the database is: select*from dba_db_links.

[0087] Based on the above steps, the subsystem list information in the database and the project group information involved in the go 0 are obtained by using the platform automatic tool, and the table information associated with the database, the PACKAGE information, the job information, and the data synchronization task Dblink are combed by using the script, so as to complete the construction of the go 0 basic work.

[0088] S260: Based on the project group information, table information, PACKAGE information, job information and data synchronization task Dblink involved in the 0 removal, data migration is performed on the tables to be migrated by using a data synchronization tool such as OGG or KETTLE, and the database 0 removal is completed.

[0089] Based on the above, the database 0 removal method of the second embodiment of the present application proposes a general automated 0 removal scheme. After automatically collecting the project group information, table information, PACKAGE information, job information and data synchronization task Dblink involved in the 0 removal by an automated script, the ogg or kettle tool is used to perform data migration on the tables to be migrated. The present application realizes the process-based and automated 0 removal information sorting and automatic migration of medical databases, greatly saving time and labor cost, and filling the gap of database 0 removal.

[0090] In an optional embodiment, the result of the database 0 removal method can also be uploaded to a blockchain. It should be noted that the blockchain here can be used to store medical data, such as storing personal health records, prescriptions, examination reports and other medical data generated during medical treatment.

[0091] Specifically, the corresponding summary information is obtained based on the result of the database 0 removal method, and specifically, the summary information is obtained by hashing the result of the database 0 removal method, such as using sha256s algorithm. Uploading the summary information to the blockchain can ensure its security and fair transparency to users. Users can download the summary information from the blockchain to verify whether the result of the database 0 removal method has been tampered with, improve the efficiency of medical institutions, ensure the security of medical data, realize the sharing of medical resources and the expansion of medical scope. The blockchain referred to in the present example is a new application mode of computer technology such as distributed data storage, point-to-point transmission, consensus mechanism and encryption algorithm. Blockchain, in essence, is a decentralized database, which is a series of data blocks associated using cryptography. Each data block contains information about a batch of network transactions, which is used to verify the validity (anti-fake) of the information and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer and an application service layer, and can be applied to application scenarios such as the medical field.

[0092] Please refer to Figure 3 is a structural schematic diagram of the database 0 removal device of the embodiment of the present application. The database 0 removal device 40 of the embodiment of the present application comprises:

[0093] The project group acquisition module 41 is configured to acquire subsystem list information in the database by using the platform automation tool, acquire user information connected to the database within a set time dimension, and obtain project group information related to the database 0 according to the user information and the subsystem list information. Since each schema in the database corresponds to different subsystems, the list information of each subsystem needs to be collected, and the collected subsystem list information includes but is not limited to subsystem state information and information of persons in charge of each link such as development, testing, operation and maintenance or business in the subsystem.

[0094] As an optional implementation, the acquired subsystem list information includes but is not limited to state information of each medical branch system and information of persons in charge of each link such as development, testing, operation and maintenance or business in the subsystem, taking each department belonging to the same medical institution as an example, the acquired subsystem list information includes but is not limited to state information of each department system and information of persons in charge of each link such as development, testing, operation and maintenance or business in the subsystem. When the database 0 is performed, the platform automation tool automatically acquires the list information of all subsystems, so as to accurately count and notify the subsystems and persons in charge of the subsystems involved in the database 0.

[0095] Taking the medical data stored by a medical institution as an example, since the medical institution includes multiple departments, each department as a branch stores medical data information of different time dimensions and different users. If the subsystem list information is manually maintained, it is relatively complex and inefficient. Therefore, in the embodiment of the present application, the platform automation tool is used to manage all subsystems. For each newly created or changed subsystem, the related information of the subsystem is automatically entered or modified. When the database 0 is performed, the platform automation tool automatically acquires the list information of all subsystems, so as to accurately count and notify the subsystems and persons in charge of the subsystems involved in the database 0, facilitating the subsequent work of the database 0. After acquiring the subsystem list information in the database, the database table / view v$active_session_history, dba_users is queried according to the set time dimension, and the query information includes but is not limited to database users, host information and the like, so as to confirm the user information with recent operation records of the database. The subsystem list information is filtered according to the user information, so as to narrow the upstream and downstream range of the database 0. In the embodiment of the present application, the filtering of the subsystem list information according to the user information is specifically: the user information acquired in the present step is associated with the subsystem list information acquired in the previous step, the subsystem list information is filtered according to the association result, and the filtered subsystem list information is the project group information involved in the database 0, which includes the subsystems involved in the database 0 and the corresponding subsystem person in charge information. Specifically, the first automation script for querying the database table / view is as follows:

[0096] select a.username,b.*from dba_users a,(select distinct MACHINE,PROGRAM,MODULE,user_id from v$active_session_history where user_id not in(select user_id from dba_users where username like'%OPR'OR USERNAME in('SYS','OVSEE','DBMGR','FOGLIGHT'))and sample_time>=to_date('&begintime','yyyymmddhh24mi'))b where a.user_id=b.user_id;

[0097] The database information extraction module 42 is configured to query the database by using an automated script, obtain table information that needs to be migrated in the database, and extract PACKAGE information, job information, and Dblink information in the database. The database information extraction module 42 first queries the database by using a second automated script, and sorts table information associated with the database to obtain table information that needs to be migrated. After obtaining the project group information involved, the table information associated with the database needs to be sorted to determine which tables need to be migrated and which tables do not need to be migrated. The table information that needs to be sorted includes, but is not limited to, a table name, authorized users, permissions of the authorized users on the table, and description information of the table. The database tables that need to be queried include dba_role_privs, dba_tab_privs, and dba_tab_comments. The second automated script for querying the database is as follows:

[0098] select bb.grantee,bb.table_name,bb.privilege,cc.comments

[0099] from(

[0100] select grantee,table_name,privilege from (

[0102] select a.grantee,b.table_name,b.privilege from

[0103] dba_role_privs a,

[0104] dba_tab_privs b

[0105] where a.granted_role=b.grantee

[0106] and a.grantee like '%OPR'

[0107] union all

[0108] select c.grantee,c.table_name,c.privilege from

[0109] dba_tab_privs c

[0110] where c.grantee like '%OPR'

[0111] )aa

[0112] group by grantee,table_name,privilege)bb leftjoin dba_tab_comments cconbb.table_name=cc.table_name order by bb.grantee

[0113] Then, a third automated script is used to query the tables internally associated with the database to extract the package information. The process of removing zeros from the database also includes modifying the internal packages; therefore, extracting the package information is an essential step. This embodiment extracts the corresponding package information using a database script. The extracted package information includes, but is not limited to, package name, package owner, package type, and specific definition. The table internally associated with the database is dba_objects, and the third automated script for querying the database is as follows:

[0114] select owner, object_name, object_type from dba_objects where object_type in ('PACKAGE', 'PACKAGE BODY', 'PROCEDURE') and owner in ('HIMSCDE', 'EHISJOB', 'VOUCDE', 'DEPLOYOP', 'EHISDATA', 'HRCSCDE', 'EHISCDE') order by object_type

[0115] Then, the fourth automatic script is used to query the internally associated table of the database, to sort out the job information in the database, and to obtain the job information of the database. Since the 0 removal work needs to sort out the timing tasks in the database, to ensure that the migration work does not miss the timing tasks, the timing tasks in the database are also a key link of the 0 removal. The embodiments of the present application use related scripts to query the internally associated table of the database, to sort out the job information in the database. The sorted job information includes but is not limited to job name, job description / function, job owner, job state, last execution time, next execution time, and execution frequency. The internally associated table of the database is: dba_jobs. The fourth automatic script for querying the database is:

[0116] "select substr(substr(a.what,1,length(a.what)-1),INSTR(substr(a.what,1,length(a.what)-1),'.')+1)asjob_name,b.description,a.schema_user,a.last_date,a.NEXT_DATE,a.BROKEN,a.interval,b.early_start_up,b.lately_start_up from dba_jobs a

[0117] left join ehisjob.job_schedule_table b

[0118] on substr(substr(a.what,1,length(a.what)

[0119] 1),INSTR(substr(a.what,1,length(a.what)-1),'.')+1)=b.job_name

[0120] where a.log_user='EHISJOB' and a.broken='N'

[0121] order by a.next_sec;

[0122] "

[0123] Finally, the fifth automatic script is used to query the internally associated table of the database, to comb the internal data synchronization task Dblink of the database, and to obtain the Dblink information of the database; since the data synchronization between the Oracle databases is performed through the Dblink mode, the work must be known in advance at the time of 0, so as to ensure that the medical data transmission in the new system after 0 will not be interrupted, and the medical data transmission function is ensured to operate normally, therefore, the internal data synchronization task Dblink of the database needs to be combed, and the Dblink information that needs to be combed includes but is not limited to the user owner of the dblink, the dblink name, the host information of the data synchronization, and the creation time, etc., as an optional implementation manner, the medical data stored in the Oracle database is taken as an example, the work must be known in advance at the time of 0, so as to ensure that the medical data transmission in the new system after 0 will not be interrupted, and the medical data transmission function is ensured to operate normally. The internally associated table of the database is: dba_db_links, and the fifth automatic script for querying the database is: select*from dba_db_links.

[0124] Based on the above, the subsystem list information in the database and the project group information involved in 0 are obtained through the platform automation tool, and the table information associated with the database, the PACKAGE information, the job information and the data synchronization task Dblink are combed by using the automatic script, and the construction of the 0 basis work is completed.

[0125] The data migration module 43 is used to perform data migration on the database by using a data synchronization tool based on the project group information, the table information, the PACKAGE information, the job information and the Dblink information, to complete the 0 of the database; wherein the data synchronization tool includes but is not limited to OGG or KETTLE, etc.

[0126] The database 0 device of the embodiment of the application proposes a general automatic 0 scheme, after the project group information, the table information, the PACKAGE information, the job information and the data synchronization task Dblink involved in 0 are automatically collected by using the automatic script, the tables that need to be migrated are migrated by using the ogg or kettle tool. The application realizes the flow and automation of the 0 information combing and the automatic migration of the medical database, greatly saves the time and labor cost, and fills the gap of the database 0.

[0127] Referring to Figure 4 , a schematic diagram of a computer device structure of an embodiment of the present application. The computer device 50 comprises:

[0128] a memory 51 storing executable program instructions;

[0129] a processor 52 connected with the memory 51;

[0130] The processor 52 is configured to invoke the executable program instructions stored in the memory 51 and perform the following steps: obtaining subsystem list information in a database by using a platform automation tool, and obtaining user information connected directly to the database within a set time dimension, obtaining project group information related to the database from the user information and the subsystem list information; querying the database by using an automation script, obtaining table information needing to be migrated in the database, and extracting PACKAGE information, job information and Dblink information in the database; based on the project group information, the table information, the PACKAGE information, the job information and the Dblink information, performing data migration on the medical database by using a data synchronization tool, and completing the de-0 of the medical database.

[0131] The processor 52 can also be referred to as a CPU (Central Processing Unit). The processor 52 can be an integrated circuit chip with signal processing capability. The processor 52 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0132] The computer device of the embodiment of the present application automatically collects project group information, table information, PACKAGE information, job information and data synchronization task Dblink related to de-0 by using an automation script, and then performs data migration on the table needing to be migrated by using a data synchronization tool. The present application realizes the process-based and automated de-0 information sorting and the automatic migration of the medical database, greatly saves time and labor cost, and fills the gap of the database de-0.

[0133] Referring to Figure 5 , Figure 5A structural schematic diagram of the storage medium of the embodiment of the present application. The storage medium of the embodiment of the present application stores program instructions 61 capable of realizing the following steps: obtaining subsystem list information in a database by using a platform automation tool, and obtaining user information directly connected to the database within a set time dimension, obtaining project group information related to the database from the user information and the subsystem list information; querying the database by using an automation script, obtaining table information needing to be migrated in the database, and extracting PACKAGE information, job information and Dblink information in the database; based on the project group information, the table information, the PACKAGE information, the job information and the Dblink information, performing data migration on the database by using a data synchronization tool, and completing the de-0 of the database. The program instructions 61 can be stored in the above storage medium in the form of a software product, including a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the method of each embodiment of the present application. The storage medium mentioned above includes various media capable of storing program instructions, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone or a tablet.

[0134] The storage medium of the embodiment of the present application automatically collects project group information, table information, PACKAGE information, job information and data synchronization task Dblink related to de-0 by using an automation script, and performs data migration on the table needing to be migrated by using a data synchronization tool. The present application realizes the flow-based and automated de-0 information sorting and the automatic migration of a medical database, greatly saves time and labor cost, and fills the gap of database de-0.

[0135] In the several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the system embodiments described above are only schematic. The division of units is only a logical function division. In actual implementation, additional division can be made, or some features can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or in other forms.

[0136] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit. The above is only an implementation manner of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent flow transformation made by using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, is also included in the patent protection scope of the present application.

Claims

1. A method for removing zeros from a database, characterized in that, include: The platform's automation tools are used to obtain subsystem list information from the database and user information directly connected to the database within a set time dimension. Based on the user information and subsystem list information, project group information related to the database is obtained. The automated script queries the database to obtain the table information that needs to be migrated, and extracts the PACKAGE information, job information and Dbl ink information from the database. Based on the project group information, table information, package information, job information, and database information, a data synchronization tool is used to migrate the database and complete the removal of zeros from the database.

2. The database zero-removal method according to claim 1, characterized in that, The subsystem list information includes the status information and responsible person information of each subsystem. The specific steps for obtaining the project group information related to the database decomposition based on the user information and the subsystem list information are as follows: Use the first automated script to query the database table / view: v$active_session_history,dba_users, to obtain user information that has actual operation records in the database within a set time dimension; The user information is associated with the subsystem list information, and the subsystem list information is filtered according to the association result. The filtered subsystem list information is the project group information related to the database.

3. The database zero-removal method according to claim 1 or 2, characterized in that, The specific steps of using automated scripts to query the database and obtain the table information that needs to be migrated are as follows: The second automated script queries the databases dba_role_privs, dba_tab_privs, and dba_tab_comments to sort out the table information associated with the database and obtain the table information that needs to be migrated. The table information includes the table name, authorized users, the authorized users' permissions on the table, and the table description information.

4. The database zero-removal method according to claim 3, characterized in that, The extraction of PACKAGE information, job information, and Dbl ink information from the database includes: The third automated script queries the dba_objects table, which is internally associated with the database, to extract the PACKAGE information from the database. The extracted PACKAGE information includes the PACKAGE name, PACKAGE user owner, PACKAGE type, and definition.

5. The database zero-removal method according to claim 4, characterized in that, The step of extracting PACKAGE information, job information, and Dbl ink information from the database also includes: The fourth automated script queries the dba_jobs table, which is internally associated with the database, to sort out the job information in the database and obtain the job information of the database. The obtained job information includes job name, job description / function, user to which the job belongs, job status, last execution time, next execution time, and execution frequency.

6. The database zero-removal method according to claim 5, characterized in that, The step of extracting PACKAGE information, job information, and Dbl ink information from the database also includes: The fifth automated script queries the dba_db_links table within the database to sort out the data synchronization tasks Dblink within the database and obtain the Dblink information of the database. The Dblink information includes the user owner of the dblink, the dblink name, the host information of the data synchronization, and the creation time.

7. The database zero-removal method according to claim 1, characterized in that, The data synchronization tool is OGG or KETTLE.

8. A database zero-removal device, characterized in that, include: Project Group Acquisition Module: Used to acquire subsystem list information from the database using platform automation tools, and to acquire user information directly connected to the database within a set time dimension. Based on the user information and subsystem list information, project group information related to the database is obtained. Database information extraction module: used to query the database using automated scripts, obtain the table information that needs to be migrated in the database, and extract the PACKAGE information, job information and Dblink information in the database; Data migration module: Based on the project group information, table information, package information, job information, and Dblink information, it uses a data synchronization tool to migrate the database and complete the removal of zeros from the database.

9. A computer device, characterized in that, The computer device includes: A memory that stores executable program instructions; The processor connected to the memory; The processor invokes the executable program instructions stored in the memory to execute the database zero-removal method as described in any one of claims 1-7.

10. A storage medium storing processor-executable program instructions, characterized in that, The program instructions are used to execute the database zero-removal method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Oracle removing method based on Clickhome

    CN119248784A