From 6a99b86749f3c339320ef3fdfdc960b30d7b37e9 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Tue, 8 Mar 2022 09:26:48 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E4=BC=98=E5=8C=96mogila=E6=A0=B7=E6=9C=AC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=9B=86=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product/en/docs-mogdb/v2.1/quick-start/mogila.md | 6 ++++-- product/zh/docs-mogdb/v2.1/quick-start/mogila.md | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/quick-start/mogila.md b/product/en/docs-mogdb/v2.1/quick-start/mogila.md index 1c58de7e..7faa4b82 100644 --- a/product/en/docs-mogdb/v2.1/quick-start/mogila.md +++ b/product/en/docs-mogdb/v2.1/quick-start/mogila.md @@ -25,15 +25,17 @@ The image below shows an overview of the Mogila database tables and views. Here ## Use Mogila on MogDB Container Edition +The Mogila sample dataset has been built into the MogDB Container Edition, and no additional installation is required. + 1. On terminal pull the latest mogdb image: - - amd + amd ``` docker pull swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:2.1.0_amd ``` - - arm + arm ``` docker pull swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:2.1.0_arm diff --git a/product/zh/docs-mogdb/v2.1/quick-start/mogila.md b/product/zh/docs-mogdb/v2.1/quick-start/mogila.md index ee7598ef..4c2987e9 100644 --- a/product/zh/docs-mogdb/v2.1/quick-start/mogila.md +++ b/product/zh/docs-mogdb/v2.1/quick-start/mogila.md @@ -25,14 +25,17 @@ Mogila适用于MogDB 2.1.0及更高版本。 ## 在MogDB容器版中使用Mogila +MogDB容器版本已经内置了Mogila样本数据库,无需额外安装。 + 1. 在终端拉取最新的MogDB镜像: - - amd + + amd ``` docker pull swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:2.1.0_amd ``` - - arm + arm ``` docker pull swr.cn-north-4.myhuaweicloud.com/mogdb/mogdb:2.1.0_arm -- Gitee From 13ccdbcc4fe61e8514ff27e04a6ecb673aced19d Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Thu, 10 Mar 2022 19:21:57 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=AE=89=E8=A3=85=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E6=9B=B4=E6=96=B0+SCA=205.0=E8=8B=B1=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../4-installing-mogdb.md | 2 - product/en/docs-sca/v5.0/command_options.md | 324 ++++++++++++++++++ product/en/docs-sca/v5.0/db2_to_mogdb.md | 93 +++++ product/en/docs-sca/v5.0/mysql_to_mogdb.md | 105 ++++++ product/en/docs-sca/v5.0/oracle_to_mogdb.md | 97 ++++++ product/en/docs-sca/v5.0/overview.md | 57 +++ product/en/docs-sca/v5.0/release-notes.md | 50 +++ product/en/docs-sca/v5.0/result.md | 168 +++++++++ product/en/docs-sca/v5.0/toc.md | 15 + product/en/docs-sca/v5.0/usage.md | 70 ++++ .../4-installing-mogdb.md | 1 - product/zh/docs-sca/v5.0/command_options.md | 2 +- product/zh/docs-sca/v5.0/result.md | 8 +- product/zh/docs-sca/v5.0/toc.md | 2 +- 14 files changed, 985 insertions(+), 9 deletions(-) create mode 100644 product/en/docs-sca/v5.0/command_options.md create mode 100644 product/en/docs-sca/v5.0/db2_to_mogdb.md create mode 100644 product/en/docs-sca/v5.0/mysql_to_mogdb.md create mode 100644 product/en/docs-sca/v5.0/oracle_to_mogdb.md create mode 100644 product/en/docs-sca/v5.0/overview.md create mode 100644 product/en/docs-sca/v5.0/release-notes.md create mode 100644 product/en/docs-sca/v5.0/result.md create mode 100644 product/en/docs-sca/v5.0/toc.md create mode 100644 product/en/docs-sca/v5.0/usage.md diff --git a/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md b/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md index 51fea6fc..512288c7 100644 --- a/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md +++ b/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md @@ -294,10 +294,8 @@ This section takes the CentOS OS as an example to describe the environment initi 4. Go to the directory for storing the uploaded software package and decompress the following packages in sequence. ``` - cd /opt/software/mogdb tar -xvf MogDB-2.1.0-CentOS-x86_64.tar tar -xvf MogDB-2.1.0-CentOS-64bit-om.tar.gz - tar -xf MogDB-2.1.0-CentOS-64bit.tar.bz2 ``` 5. Go to the directory for storing tool scripts. diff --git a/product/en/docs-sca/v5.0/command_options.md b/product/en/docs-sca/v5.0/command_options.md new file mode 100644 index 00000000..e58bcf6b --- /dev/null +++ b/product/en/docs-sca/v5.0/command_options.md @@ -0,0 +1,324 @@ +--- +title: SCA Command Options +summary: SCA Command Options +author: hongyedba +date: 2021-09-30 +--- + +# SCA Command Options + +SCA is a command line tool. All functions can be realized through single executable program. + +## General Options + +General options may be used in all three types of tasks. + +### --help (Help Information) + +Before using the analysis program, you are advised to read help information carefully. (Command: `./sca_linux_x86_64 --help`): + +```shell +Introduction: + SCA is the tool used to do SQL life-cycle inspector and simulation from other DB to MogDB. + Now we support source databases of Oracle, MySQL and DB2. + So there are 10 type of tasks: + 1. [ I] Init SCA repository + 2. [ L] Apply for License + 3. [ OC] Oracle Collection, collect Oracle basic information and executed SQLs + 4. [ MC] MySQL Collection, collect MySQL basic information and executed SQLs + 5. [ DC] DB2 Collection, collect DB2 basic information and executed SQLs + 6. [ OI] Oracle Inspection, used to do Oracle SQL compatible analysis + 7. [ MI] MySQL Inspection, used to do MySQL SQL compatible analysis + 8. [ DI] DB2 Inspection, used to do DB2 SQL compatible analysis + 9. [ OS] Oracle Simulation, used to do Oracle SQL performance analysis like Oracle build-in SPA tool + 10. [OIS] Oracle Inspection & Simulation, for both SQL compatible and performance analysis + +Options: + --[ Overall ]-- + --help : Show help message + -v, --version : Show SCA version + -T, --type : Run type: + : I = Init SCA repository + : L = Apply for license + : ----------------[Analysis: Target required]--------------- + : OI = Oracle Inspection, this is default type + : MI = MySQL Inspection + : DI = DB2 Inspection + : OS = Oracle Simulation, just like Oracle SPA + : OIS = Oracle Inspection & Simulation + : ------------[Collection: No need of target DB]------------ + : OC = Oracle Collection + : MC = MySQL Collection + : DC = DB2 Collection + -d, --data : Unzipped data directory for analyzer, or directory for collection + -D, --data-id : Use data with data id existed in the repository + -w, --workers : Parallel workers for tasks, default: 10 + -x, --debug : Enable debug mode + -l, --logfile : Output to both logfile (without progress-bar) and screen (with progress-bar) + -L, --log-only : Output to only logfile (without progress-bar) + -F, --force : Force mode in REPO Creation, drop old objects before create it + -r, --report : Final report file location, default in data directory with name 'report' + --license : License file, default is [./license.json] + --sql-transformer : Regular rules for SQL transformation (for internal use) + : Format: [{"name": "xxx" + : "source": "xxx", + : "target": "xxx", + : "comment": "xxx"}, ...] + + --[ Repository Connection ]-- + -H, --repo-host : Repository DB Server host address, default: 127.0.0.1 + -P, --repo-port : Repository DB server port, default: 5432 + -N, --repo-name : Repository database, default: sca_db + -U, --repo-user : Repository user, default: sca_repo + -E, --repo-password : Repository password, default: SCA@password + --user : Administrator used to create repository DB and user, default: mogdb + --password : Password for Administrator, default: mogdb + + --[ Source & Target Connection ]-- + -h, --db-host : Source & Target DB Server host address, default same as -H + -p, --db-port : Source & Target DB server port, default same as -P + -n, --db-name : Source & Target database, default same as -N + -u, --db-user : Source & Target user, default same as -U + -e, --db-password : Source & Target password, default same as -E + --target-type : Target database type in analysis tasks, default: MOGDB + : Valid type: ORACLE, MOGDB, OPENGAUSS, POSTGRESQL, MYSQL, DB2 + + --[ Collection Options ]-- + -q, --sql-days : How many days for session sql data, default: 7 + -Q, --sql-interval : SQL collect interval in seconds, default: 600 + -s, --schema-include : Users/Schemas included in data collection, default: '' + -S, --schema-exclude : Users/Schemas excluded in data collection + : Default: <> + -m, --enable-monitor : Starting background monitor process in SQL Collection + : Valid values: 1/on/true/t = ENABLE, default: on + : 0/off/false/f = DISABLE + --slow-log : MySQL slow-log for client data collection + --sql-csv : SQL file in csv format for SQL Inspection (@todo) + +Usage: + 0. Apply for license + ./sca_macos_x86_64 -T L + 1. Init repository (used for first running) + ./sca_macos_x86_64 -T i -H -P -N -U -E --user --password + 2. Oracle data collection + # Notice: "-q 0.001 -Q 60" means gather Session SQL only once + # "-m off" means do not monitor system status (CPU Idle and Disk Free) + ./sca_macos_x86_64 -T OC -s SCOTT -h -p -n '' -u -e -q 0.001 -Q 60 -m off + ./sca_macos_x86_64 -T OC -s SCOTT -h -p -n '' -u -e + 3. MySQL data collection using slow-log file + ./sca_macos_x86_64 -T MC -d --slow-log= + 4. Oracle SQL compatible analysis (Required: Repository, Target DB) + Note: use [H/P/N/U/E] options to assign the repository + use [h/p/n/u/e] options to assign the target database + ./sca_macos_x86_64 -T OI -d + 5. Oracle SQL performance simulation (Required: Repository, Target DB) + Note: use [H/P/N/U/E] options to assign the repository + use [h/p/n/u/e] options to assign the target database + ./sca_macos_x86_64 -T OS -d + 6. MySQL SQL compatible analysis (Required: Repository, Target DB) + Not e: use [H/P/N/U/E] options to assign the repository + use [h/p/n/u/e] options to assign the target database + ./sca_macos_x86_64 -T MI -d -H -P -n +``` + +### -v, --version (Version) + +View the current version of SCA: + +```shell +hongyedba@localhost ~ % ./sca_linux_x86_64 -v +SCA version: 5.0.0 +``` + +### -T, --type (Task Type) + +Default value: OI + +Specifies the task type. Currently, SCA supports the following types of tasks: + +1. `I [Initialize]`: **Initialize**, used to initialize the SCA repository +2. `L [Apply License]`: **Apply license**, task for license application +3. `OC [Oracle Collection]`: **Oracle collection**, used to collect the business SQL executed in Oracle database, need long time to collect +4. `MC [MySQL Collection]`: **MySQL collection**, used to collect the business SQL executed in MySQL database, need to configure the slow log in advance, and then collect at once +5. `DC [DB2 Collection]`: **DB2 collection**, used to collect the business SQL executed in DB2 database, need long time to collect +6. `OI [Oracle Inspection]`: **Oracle compatibility evaluation**, used to evaluate the actual compatibility of business SQL collected in Oracle on the source side in MogDB on the target side +7. `MI [MySQL Inspection]`: **MySQL compatibility evaluation**, used to evaluate the actual compatibility of business SQL collected in MySQL on the source side in MogDB on the target side +8. `DI [DB2 Inspection]`: **DB2 compatibility evaluation**, used to evaluate the actual compatibility of business SQL collected in DB2 on the source side in MogDB on the target side +9. `OS [Oracle Simulation]`: **Oracle performance evaluation**, used to evaluate the execution performance of business SQL collected in Oracle on the source side in MogDB on the target side +10. `OIS [Oracle Inspection & Simulation]`: **Oracle compatibility and performance evaluation**, equivalent to OI + OS two tasks at the same time + +### -d, --data (Data Directory) + +The -d data directory can be specified for all task types except repository initialization (-T I). + +The collection task writes the collected data to the data directory specified by -d. + +The analysis task reads data from the data directory, inserts the data into the repository table, and the final generated report results are also written to the data directory by default. + +### -D, --data-id (Data ID) + +Specify the data ID and then read the data with the specified ID directly from the repository instead of re-reading and loading the data from the data directory. + +Specifying the -D option skips the step of loading data and performs the relevant analysis task directly. + +## -w, --workers (Degree of Parallelism) + +The default degree of parallelism is 10. + +Specifies the degree of parallelism for running tasks. Appropriate degree of parallelism can improve the running speed of each task. + +Applicable to: file data loaded to a data repository, SQL compatibility assessment, SQL complexity assessment, SQL performance simulation, and other operations + +**Note**: + +* In SQL simulation tasks, a greater degree of parallelism may lead to degradation of the execution efficiency of single SQL. Therefore, an appropriate degree of parallelism needs to be chosen according to the loading of the actual production environment and is generally set to the average number of active sessions of a production database. + +### -x, --debug (Debug Mode) + +Enabling the debug mode does not affect normal analysis logic but will output a large number of logs. The debug mode is usually used for assisting the analysis program in running exceptions itself. + +### -l, --logfile (Log File) + +Specifies the log file of a program. The program will output data to both the terminal command line and log file. + +### -L, --log-only (Log File) + +Specifies the log file of a program. The program will output data only to the log file. + +### -F, --force (Forcible Mode) + +Specifies whether to enable the forcible mode. This mode takes effect in the data repository initialization scenarios. + +During the initialization of a data repository, if the forcible mode is enabled, the data repository will be deleted first and then re-created. + +### -r, --report (Report Directory) + +Default value: /report + +Specifies the report directory. The report here includes the compatibility evaluation and SQL simulation reports in the HTML format, which can be viewed offline. + +Also, for the `compatibility evaluation` task, a `sql_detail_list.csv` file is generated to record the evaluation results of all SQL and possible rewriting options. + +### --license (License File) + +Default value: ./license.json + +The location of the License file. + +### --sql-transformer (SQL transform rules) + +[Advanced Usage] Specify the SQL transform rules from the source database to the target database, and use regular matching for transform. + +## Repository Options + +### -H, --repo-host (Repository IP Addresses) + +Default value: 127.0.0.1 + +Repository database IP Addresses. + +### -P, --repo-port (Repository Port) + +Default value: 5432 + +Repository database port. + +### -N, --repo-name (Repository Name) + +Default value: sca_db + +Repository database name. + +### -U, --repo-user (Repository User) + +Default value: sca_repo + +Repository database login user. + +### -E, --repo-password (Repository Password) + +Default value: SCA@password + +Repository database login password. + +### --user (Administrator User) + +Repository database administrator user, used to create repository user and repository database during the initialization of the repository. + +### --password (Administrator Password) + +Repository administrator user login password, used to create repository user and repository database during the initialization of the repository. + +## Source or Target Database Connection + +### -h, --db-host (Source or Target Database IP Addresses) + +Source or target database IP Addresses, inherits the -H option value by default. + +### -p, --db-port (Source or Target Database Port) + +Source or target database port, inherits the -P option value by default. + +### -n, --db-name (Source or Target Database Name) + +Source or target database Name, inherits the -N option value by default. + +In the SQL Analysis task, specify the target database name, which is usually the target database created on the MogDB side when using MTK or other data migration tools for database structure and data migration. + +Note that the repository user needs to have full operational privileges to the target database by default, and the default repository is administrator privileges. + +* In the compatibility assessment, only the target database needs to have an object structure +* In SQL simulation, the target database needs to have both object structure and real peer-to-peer full production data, otherwise the performance simulation results are not informative + +### -u, --db-user (Source or Target Database User) + +Source or target database login user, inherits the -U option value by default. + +### -e, --db-password (Source or Target Database Password) + +Source or target database login password, inherits the -E option value by default. + +### --target-type (Target Database Type) + +Specify the target database type in the analysis task, the default is MOGDB. + +Currently this parameter is not perfect, only MOGDB/POSTGRESQL is supported. + +## Data Collection Options + +## -q, --sql-days (Number of Days for SQL Collection) + +Specifies the total number of days for SQL-related data collection. Data miss may occur in collecting the executed SQL data from session cache GV\$SQLAREA. You can prolong the number of collection days to reduce the data collection miss possibility. + +By default, SQL data of a week will be collected. + +### -Q, --sql-interval (SQL Collection Interval) + +Specifies the SQL-related data collection interval. By default, the SQL data is collected every 10 minutes. + +The SQL data collected every time will be compared with the collected data to filter out the repeated data. This can prevent the data file from being too large. + +### -s, schema-include (Schema Whitelist) + +Specifies the schema whitelist for data collection. Only schema-related data listed in the whitelist is collected. + +### -S, schema-exclude (Schema Blacklist) + +Specifies the schema blacklist for data collection. Schema-related data listed in the blacklist is not collected. + +By default, Oracle system users are listed in the schema blacklist. + +### -m, enable-monitor (Resource Monitoring) + +Specifies whether to enable the resource monitoring process in the background. This process is enabled by default. + +The resource monitoring process queries the CPU usage of the current server every 3s and the remaining space of the file system where the data directory is located. + +When the CPU usage is greater than 90% or the remaining space of the file system is lower than 100 MB, the monitoring sub-process will stop collecting data from the primary process so that the server will not become faulty due to resource problems. + +### --slow-log (Slow Query Log) + +Specifies the MySQL slow query log file. + +When the collection program cannot access the target MySQL database and the collection program is not running on the MySQL server, you can manually retrieve the MySQL slow log from the target database and use the current option to specify the slow log to parse and generate the corresponding collection data, which can be used for subsequent MySQL SQL compatibility evaluation tasks. + diff --git a/product/en/docs-sca/v5.0/db2_to_mogdb.md b/product/en/docs-sca/v5.0/db2_to_mogdb.md new file mode 100644 index 00000000..055cbba0 --- /dev/null +++ b/product/en/docs-sca/v5.0/db2_to_mogdb.md @@ -0,0 +1,93 @@ +--- +title: DB2 to MogDB evaluation +summary: DB2 to MogDB evaluation +author: Hong Rihua +date: 2022-03-07 +--- + +# DB2 to MogDB Evaluation + +## MogDB Environment Preparation + +You need to prepare your own MogDB/openGauss database environment for the repository and the target database, and the same environment is used by default for the repository and the target database. + +## Object Structure Migration + +- **Structure Migration**: You need to create the target database in the prepared MogDB/openGauss environment and migrate the data structures from the source database to the newly created target database. +- **Data Migration**: If you want to perform SQL performance comparison evaluation, then in addition to migrating the database structure, you also need to migrate the table data to ensure that the source DB2 and the target MogDB/openGauss database data size is the same for the performance comparison to be meaningful. + +Related Tool: + +- **MTK**: Structure and data migration can be done by MTK, for details please refer to [https://mogdb.io/mtk](https://mogdb.io/mtk) + +## DB2 Data Collection + +### Required Permissions + +The permissions required for the collection user are as follows. + +> dbadm + +### Related Commands + +```shell +./sca_linux_x86_64 -T DC -h -p -n -u -e + +# Command options: +# -h/p/t/u/e specify the connection method of the source DB2 database +# Considering that the SQL content in the shared cache may not be comprehensive, the collection will be continuous and incremental, with one week of data collected by default. If you are only doing functional validation, you can use the -q 0.001 -Q 60 option, i.e. only collect SQL data once. +``` + +### Collection Results + +When the collection is complete, a zip packet is generated which can be copied to the target database and unpacked into a data directory. + +Subsequent compatibility analysis relies on the data in this packet and does not require another connection to the source DB2 database. + +## Repository Initialization + +```shell +# Use the MogDB/openGauss user with administrator privileges for repository initialization +# Repository initialization will create a database with the name sca_db by default +# You can specify the repository name by -N, the repository user name by -U, and the repository user password by -E + +./sca_linux_x86_64 -T i -H -P -N sca_db -U sca_repo -E 'SCA@password' --user --password +``` + +## Perform Analysis Tasks + +### Compatibility Analysis + +To do SQL compatibility analysis only, use the following command. + +```shell +# If the repository name, username, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T DI -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. + +### Performance Comparison Analysis + +To do SQL performance comparison analysis only, use the following command. + +```shell +# If the repository name, username, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T DS -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. + +### Compatibility Analysis + Performance Comparison Analysis + +If you need to do both SQL compatibility analysis and SQL performance comparison, use the following command. + +```shell +# If the repository name, user name, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T DIS -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. diff --git a/product/en/docs-sca/v5.0/mysql_to_mogdb.md b/product/en/docs-sca/v5.0/mysql_to_mogdb.md new file mode 100644 index 00000000..0b0acfe4 --- /dev/null +++ b/product/en/docs-sca/v5.0/mysql_to_mogdb.md @@ -0,0 +1,105 @@ +--- +title: MySQL to MogDB Evaluation +summary: MySQL to MogDB Evaluation +author: Hong Rihua +date: 2022-03-07 +--- + +# MySQL to MogDB Evaluation + +## MogDB Environment Preparation + +You need to prepare your own MogDB/openGauss database environment for the repository and the target database, and the same environment is used by default for the repository and the target database. + +## Object Structure Migration + +- **Structure Migration**: You need to create the target database in the prepared MogDB/openGauss environment and migrate the data structures from the source database to the newly created target database. +- **Data Migration**: If you want to perform SQL performance comparison evaluation, then in addition to migrating the database structure, you also need to migrate the table data to ensure that the source MySQL and the target MogDB/openGauss database data size is the same for the performance comparison to be meaningful. + +Related Tool: + +- **MTK**: Structure and data migration can be done by MTK, for details please refer to [https://mogdb.io/mtk](https://mogdb.io/mtk) + +## MySQL Data Collection + +### Required Permissions + +The permissions required for the collection user are as follows. + +> root + +### Enable Slow SQL Logging + +- You need to enable slow logging in advance to ensure that the complete business cycle data is recorded in the slow log, it is recommended to enable slow logging one week in advance +- Set slow SQL threshold interval to 0 + +```sql +SET GLOBAL slow_query_log=ON; +SET GLOBAL long_query_time=0.001; +set global log_output='FILE'; -- log_output='TABLE' is also supported, but the content is relatively small +``` + +### Data Collection + +It is recommended to execute the data collection command after running a full business cycle with slow logging enabled. + +```shell +./sca_linux_x86_64 -T MC -h -p -n -u -e + +# Command options: +# -h/p/t/u/e specify the connection method of the source MySQL database +``` + +### Collection Results + +When the collection is complete, a zip packet is generated which can be copied to the target database and unpacked into a data directory. + +Subsequent compatibility analysis relies on the data in this packet and does not require another connection to the source MySQL database. + +## Repository Initialization + +```shell +# Use the MogDB/openGauss user with administrator privileges for repository initialization +# Repository initialization will create a database with the name sca_db by default +# You can specify the repository name by -N, the repository user name by -U, and the repository user password by -E + +./sca_linux_x86_64 -T i -H -P -N sca_db -U sca_repo -E 'SCA@password' --user --password +``` + +## Perform Analysis Tasks + +### Compatibility Analysis + +To do SQL compatibility analysis only, use the following command. + +```shell +# If the repository name, username, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T OI -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. + +### Performance Comparison Analysis + +To do SQL performance comparison analysis only, use the following command. + +```shell +# If the repository name, username, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T OS -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. + +### Compatibility Analysis + Performance Comparison Analysis + +If you need to do both SQL compatibility analysis and SQL performance comparison, use the following command. + +```shell +# If the repository name, username, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T OIS -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. diff --git a/product/en/docs-sca/v5.0/oracle_to_mogdb.md b/product/en/docs-sca/v5.0/oracle_to_mogdb.md new file mode 100644 index 00000000..bda2b43e --- /dev/null +++ b/product/en/docs-sca/v5.0/oracle_to_mogdb.md @@ -0,0 +1,97 @@ +--- +title: Oracle to MogDB Evaluation +summary: Oracle to MogDB Evaluation +author: Hong Rihua +date: 2022-03-07 +--- + +# Oracle to MogDB Evaluation + +## MogDB Environment Preparation + +You need to prepare your own MogDB/openGauss database environment for the repository and the target database, and the same environment is used by default for the repository and the target database. + +## Object Structure Migration + +- **Structure Migration**: You need to create the target database in the prepared MogDB/openGauss environment and migrate the data structures from the source database to the newly created target database. +- **Data Migration**: If you want to perform SQL performance comparison evaluation, then in addition to migrating the database structure, you also need to migrate the table data to ensure that the source Oracle and the target MogDB/openGauss database data size is the same for the performance comparison to be meaningful. + +Related Tool: + +- **MTK**: Structure and data migration can be done by MTK, for details please refer to [https://mogdb.io/mtk](https://mogdb.io/mtk) + +## Oracle Data Collection + +### Required Permissions + +The permissions required for the collection user are as follows. + +> SELECT ANY DICTIONARY +> CREATE PROCEDURE +> EXECUTE ON DBMS_LOB +> SELECT ON GV_$SQL_PLAN + +### Related Commands + +```shell +./sca_linux_x86_64 -T OC -s SCOTT -h -p -n -u -e + +# Command options: +# -s specify the list of Schema to be collected +# -h/p/t/u/e specify the connection method of the source Oracle database +# Considering that the SQL content in the shared cache may not be comprehensive, the collection will be continuous and incremental, with one week of data collected by default. If you are only doing functional validation, you can use the -q 0.001 -Q 60 option, i.e. only collect SQL data once. +``` + +### Collection Results + +When the collection is complete, a zip packet is generated which can be copied to the target database and unpacked into a data directory. + +Subsequent compatibility analysis relies on the data in this packet and does not require another connection to the source Oracle database. + +## Repository Initialization + +```shell +# Use the MogDB/openGauss user with administrator privileges for repository initialization +# Repository initialization will create a database with the name sca_db by default +# You can specify the repository name by -N, the repository user name by -U, and the repository user password by -E + +./sca_linux_x86_64 -T i -H -P -N sca_db -U sca_repo -E 'SCA@password' --user --password +``` + +## Perform Analysis Tasks + +### Compatibility Analysis + +To do SQL compatibility analysis only, use the following command. + +```shell +# If the repository name, user name, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T OI -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. + +### Performance Comparison Analysis + +To do SQL performance comparison analysis only, use the following command. + +```shell +# If the repository name, user name, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T OS -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. + +### Compatibility Analysis + Performance Comparison Analysis + +If you need to do both SQL compatibility analysis and SQL performance comparison, use the following command. + +```shell +# If the repository name, user name, password are not the default, you need to use the -N, -U, -E options to specify + +./sca_linux_x86_64 -T OIS -H -P -d +``` + +When the analysis is complete, a report will be generated in the directory specified by **-d**, which can be downloaded offline for viewing. diff --git a/product/en/docs-sca/v5.0/overview.md b/product/en/docs-sca/v5.0/overview.md new file mode 100644 index 00000000..d739a2bd --- /dev/null +++ b/product/en/docs-sca/v5.0/overview.md @@ -0,0 +1,57 @@ +--- +title: Overview of SCA +summary: Overview of SCA +author: hongyedba +date: 2021-09-30 +--- + +# Overview of SCA + +SCA (SQL Compatibility Analyzer) is an SQL compatibility and performance evaluation tool for heterogeneous databases prior to migration. + +SCA is used to assess the compatibility of heterogeneous data before migration, to assess whether the actual business SQL in the source database has syntax problems in the target database, and to assess the performance differences between the actual execution of SQL in the two heterogeneous databases. + +SCA currently supports three source databases, including: Oracle, MySQL, DB2. + +**Applicable to**: MogDB and other openGauss-based databases + +SCA service program can run the following 10 types of tasks: + +1. `I [Initialize]`: **Initialize**, used to initialize the SCA repository +2. `L [Apply License]`: **Apply license**, task for license application +3. `OC [Oracle Collection]`: **Oracle collection**, used to collect the business SQL executed in Oracle database, need long time to collect +4. `MC [MySQL Collection]`: **MySQL collection**, used to collect the business SQL executed in MySQL database, need to configure the slow log in advance, and then collect at once +5. `DC [DB2 Collection]`: **DB2 collection**, used to collect the business SQL executed in DB2 database, need long time to collect +6. `OI [Oracle Inspection]`: **Oracle compatibility evaluation**, used to evaluate the actual compatibility of business SQL collected in Oracle on the source side in MogDB on the target side +7. `MI [MySQL Inspection]`: **MySQL compatibility evaluation**, used to evaluate the actual compatibility of business SQL collected in MySQL on the source side in MogDB on the target side +8. `DI [DB2 Inspection]`: **DB2 compatibility evaluation**, used to evaluate the actual compatibility of business SQL collected in DB2 on the source side in MogDB on the target side +9. `OS [Oracle Simulation]`: **Oracle performance evaluation**, used to evaluate the execution performance of business SQL collected in Oracle on the source side in MogDB on the target side +10. `OIS [Oracle Inspection & Simulation]`: **Oracle compatibility and performance evaluation**, equivalent to OI + OS two tasks at the same time + +Note: + +- Compatibility assessment requires a complete source database structure. It is recommended that MTK is used for migration of the source database structure. SCA can also be used to automatically create a target test database but its compatibility is relatively poor. +- SQL simulation requires a complete source database data and data. It is recommended that MTK is used for migration of the source database structure and data. + +## Supported OSs and Platforms + +SCA supports the following OSs and platforms currently: + +1. Linux x86_64 +2. Linux arm64 (ARM platform does not support DB2 data collection because it does not have a DB2 client) +3. MacOS (MacOS does not support the SHA256 encryption authentication mode of openGauss/MogDB.) + +## Supported Databases + +SCA supports the following source and target databases currently: + +1. Source database: + - Oracle >= 10.2 + - MySQL >= 5.5 + - DB2 >= 11.5 + - File: MySQL slow-log +2. Target database: + - MogDB/openGauss >= 2.0 + - PostgreSQL >= 13.0 + +**Note**: Whether SCA supports a platform does not have relevance to whether SCA supports a database. A database running on other platforms, such as Windows/AIX can be supported by SCA only when the the host network and port are connected between the database and SCA. diff --git a/product/en/docs-sca/v5.0/release-notes.md b/product/en/docs-sca/v5.0/release-notes.md new file mode 100644 index 00000000..e0ee182b --- /dev/null +++ b/product/en/docs-sca/v5.0/release-notes.md @@ -0,0 +1,50 @@ +--- +title: Release Notes +summary: Release Notes +author: hongyedba +date: 2021-09-30 +--- + +# Release Notes + +## v5.0.0 + +- [sca_linux_arm64](https://cdn-mogdb.enmotech.com/sca/SCA_v5.0.0/sca_linux_arm64) +- [sca_linux_x86_64](https://cdn-mogdb.enmotech.com/sca/SCA_v5.0.0/sca_linux_x86_64) +- [sca_macos_x86_64](https://cdn-mogdb.enmotech.com/sca/SCA_v5.0.0/sca_macos_x86_64) +- [sample_report](https://cdn-mogdb.enmotech.com/sca/SCA_v5.0.0/SCA_sample_report_v5.0.zip) + +### Feature + +- Code logic refactoring, command options and usage have changed considerably +- Support MySQL connecting database collection, through the database table of slow log information, or through the server-side local slow log +- Support DB2 data collection, collection mode is similar to Oracle, need to run for a long time, the default collection time is one week +- Supports DB2 SQL compatibility analysis, provided that the target MogDB database needs to be prepared in advance +- Support for export of Oracle SQL detail list files (sql_detail_list.csv) +- Adjust Oracle data collection logic, remove unnecessary object information and system configuration information +- Adjust the repository structure, only keep the basic information of the source database, SQL compatibility audit, SQL performance comparison and other related structures + +## v4.1.0 + +- [SCA Usage_v4.1.0.pdf](https://cdn-mogdb.enmotech.com/sca/SCA_v4.1.0/SCA使用说明_v4.1.0.pdf) +- [sca_linux_arm64](https://cdn-mogdb.enmotech.com/sca/SCA_v4.1.0/sca_linux_arm64) +- [sca_linux_x86_64](https://cdn-mogdb.enmotech.com/sca/SCA_v4.1.0/sca_linux_x86_64) +- [sca_macos_x86_64](https://cdn-mogdb.enmotech.com/sca/SCA_v4.1.0/sca_macos_x86_64) + +### Feature + +- Support SQL compatibility analysis of the MySQL database based on the slow log and general log. +- Support customization of SQL conversion rules. + +## v4.0.0 + +- [SCA Usage_v4.0.0.pdf](https://cdn-mogdb.enmotech.com/sca/SCA_v4.0.0/SCA使用说明_v4.0.0.pdf) +- [sca_linux_arm64](https://cdn-mogdb.enmotech.com/sca/SCA_v4.0.0/sca_linux_arm64) +- [sca_linux_x86_64](https://cdn-mogdb.enmotech.com/sca/SCA_v4.0.0/sca_linux_x86_64) +- [sca_macos_x86_64](https://cdn-mogdb.enmotech.com/sca/SCA_v4.0.0/sca_macos_x86_64) + +### Feature + +- Integrate a newly designed offline analysis report. +- Support data collection, compatibility analysis, and performance assessment of a single executable program. +- Support the SHA256 encryption authentication mode of openGauss/MogDB in the Linux OS. diff --git a/product/en/docs-sca/v5.0/result.md b/product/en/docs-sca/v5.0/result.md new file mode 100644 index 00000000..97951f42 --- /dev/null +++ b/product/en/docs-sca/v5.0/result.md @@ -0,0 +1,168 @@ +--- +title: SCA Result +summary: SCA Result +author: hongyedba +date: 2021-09-30 +--- + +# SCA Result + +The SCA result includes: + +- **Collection result**: The data collection result in the source database (Oracle) will be automatically packaged into a ZIP file, and a clear file position prompt will be provided at the end of the collection. +- **Analysis result**: An analysis report is generated after the analysis is complete in the target MogDB/openGauss database. The report is stored in an independent folder, in the offline HTML format, and can be copied for reading at will. + +## Collection Result + +The data collection result is automatically packaged into a ZIP file and stored in the current directory of the program by default. + +The collection result prompts the following information: + +``` +2022-02-15 19:20:40.301126 INFO [runMe.py:356] +==================== [ Summary Information ] ====================+ +2022-02-15 19:20:40.301184 INFO [runMe.py:357] | Task Name File Name File Size | +2022-02-15 19:20:40.301222 INFO [runMe.py:358] | --------------------- ------------------------------ ---------- | +2022-02-15 19:20:40.301260 INFO [runMe.py:360] | SCA_SESSION_SQL sca_sql_information.dat 3.65 KB | +2022-02-15 19:20:40.301294 INFO [runMe.py:360] | SCA_SESSION_SQL_PERF sca_sql_performance.dat 3.29 KB | +2022-02-15 19:20:40.301326 INFO [runMe.py:360] | SCA_MYSQL_USER_HOST sca_mysql_user_host.dat 1815 B | +2022-02-15 19:20:40.301357 INFO [runMe.py:360] | SCA_DATABASE sca_database.dat 163 B | +2022-02-15 19:20:40.301387 INFO [runMe.py:361] +=================================================================+ + + >>> Final Result is: + >>> ---------------------------------------------- + >>> /Users/hongyedba/Desktop/SCA_MySQL_test.zip +``` + +## Analysis Report + +Both compatibility analysis and SQL performance simulation will generate an analysis report, which are stored in specified data directories by default. You can also use `-r` to specify the output directory of the report. + +### Report Entry + +In the analysis report directory, you can click `index.html` to view the analysis report through the default browser Google Chrome. + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-1.png) + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-2.png) + +### SQL Compatibility Summary + +The SQL compatibility summary page shows the compatibility analysis result. The table lists all SQLs collected from the system and whether they are supported in MogDB by user name, program name, and module name. + +Note: The content of this table varies slightly from database to database. + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-3.png) + +### SQL Rewrite Rule + +The SQL rewrite rule page shows the SQL rewrite rules involved in the analysis. + +The usage field shows the trigger situation of a rule. + +- Match indicates the number of rule hits in a SQL. +- Count indicates the number of SQLs that match a rule. + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-4.png) + +### SQL Complexity Distribution + +The SQL complexity distribution page shows the SQL complexity distribution. +The current judgment standard of complexity distribution is as follows: + +1. The more the number of tables that a SQL involves, the higher the complexity. +2. The more the number of times for using the connect by syntax in a SQL, the higher the complexity. In this situation, the execution performance problem occurs probably. +3. The more the number of user-defined functions used in a SQL, the higher the complexity. Because the logic complexity in a user-defined function is not clear, the SQL complexity is high if many user-defined functions are used in a SQL. +4. The longer the time taken for executing a function in Oracle, the higher the SQL complexity. + +The complexity of each SQL is determined according to the above four standards. If the SQL complexity is higher, the SQL execution performance needs to be paid more attention to after migration. Only in this way can service faults be avoided due to performance problems. + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-5.png) + +### SQL Performance Comparison (Performance Comparison Summary) + +The SQL performance comparison summary page shows the following information: + +1. Basic performance comparison information, basic configuration related to performance comparison, and related thresholds used in comparison +2. SQL performance is summarized by such dimensions as general, up, down, not supported, and timeout to analyze the impact of all kinds of SQLs on the overall workload. + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-6.png) + +### SQL Performance Comparison (Top by Workload/SQL, Timeout) + +In SQL performance comparison, the content formats of the Top by Workload, Top by SQL, and Timeout pages are similar. The following uses the Top by Workload page as an example. +The table lists 100 SQLs that affect the performance most. The SQL FMS field uses the hyperlink format, which can be clicked to view the SQL analysis details. +The SQL performance impact can be assessed from two dimensions: + +1. SQL impact: the proportion of SQLs that has performance impact when single SQL is executed +2. Load impact: the impact of the current SQL on the performance change of the overall SQL workload and the overall SQL performance in terms of the total number of its execution times. + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-7.png) + +### SQL Performance Comparison (SQL Details) + +The SQL details page shows the following information: + +1. SQL execution information: SQL execution information in Oracle and MogDB + + Oracle execution information is from the dynamic performance view, and MogDB execution information is from actual SQL execution. + +2. SQL text: SQL execution text in Oracle and actual execution text in MogDB + +3. SQL binding variable: SQL binding variable in Oracle + + The binding variable will be applied to the SQL execution text in MogDB to simulate service execution in MogDB. + +4. Oracle execution plan: SQL execution plan in Oracle, which is from the dynamic performance view + +5. MogDB execution plan: SQL execution plan in MogDB, which is from actual execution. + + The program automatically analyzes the MogDB execution plan and marks out the potential performance problems. + +6. MogDB object information: structures and statistics of SQL-involved objects in MogDB + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-8.png) + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-9.png) + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-10.png) + +### Supported SQL List + +In the root directory where the report is located, the `sql_detail_list.csv` file records all supported SQLs involved in the SQL compatibility evaluation, automatic rewriting policies of partial SQLs during the evaluation, and rewritten SQL script. + +The content of the fields in the file varies slightly, mainly depending on the database. + +#### Oracle + +1. **schema_name**: specifies the schema of SQLs to be executed. In Oracle, this field refers to the user. +2. **sql_type**: specifies the SQL type. You need to make it clear whether the SQLs collected are system SQLs or service SQLs. The values are: USER, SYSTEM_CATALOG, SYSTEM_COMMAND. +3. **module**: specifies the client module for executing SQL statements. +4. **action**: specifies the client action for executing SQL statements. +5. **mogdb_error**: specifies the SQL execution error code in MogDB. +6. **mogdb_error_message**: specifies the SQL execution error message in MogDB. +7. **sql_text**: specifies the original SQL script. +8. **transform_matched**: specifies the automatic rewriting rules of SQLs. +9. **sql_rewrite**: specifies the rewritten SQL script. + +#### MySQL + +1. **schema_name**: specifies the schema of SQLs to be executed. In MySQL, this field refers to the database. +2. **sql_type**: specifies the SQL type. You need to make it clear whether the SQLs collected are system SQLs or service SQLs. The values are: USER, SYSTEM_CATALOG, SYSTEM_COMMAND. +3. **user_host**: specifies the host information of the MySQL client user who executes SQLs and the corresponding execution client. +4. **mysql_error**: specifies the SQL execution situation in MySQL. If the execution result is 0, the SQL execution is successful. Otherwise, the execution error is reported. +5. **mogdb_error**: specifies the SQL execution error code in MogDB. +6. **mogdb_error_message**: specifies the SQL execution error message in MogDB. +7. **sql_text**: specifies the original SQL script. +8. **transform_matched**: specifies the automatic rewriting rules of SQLs. +9. **sql_rewrite**: specifies the rewritten SQL script. + +#### DB2 + +1. **schema_name**: specifies the schema of SQLs to be executed. +2. **sql_type**: specifies the SQL type. You need to make it clear whether the SQLs collected are system SQLs or service SQLs. The values are: USER, SYSTEM_CATALOG, SYSTEM_COMMAND. +3. **stmt_type**: specifies the types of SQL statements recorded in DB2. +4. **mogdb_error**: specifies the SQL execution error code in MogDB. +5. **mogdb_error_message**: specifies the SQL execution error message in MogDB. +6. **sql_text**: specifies the original SQL script. +7. **transform_matched**: specifies the automatic rewriting rules of SQLs. +8. **sql_rewrite**: specifies the rewritten SQL script. diff --git a/product/en/docs-sca/v5.0/toc.md b/product/en/docs-sca/v5.0/toc.md new file mode 100644 index 00000000..bad73671 --- /dev/null +++ b/product/en/docs-sca/v5.0/toc.md @@ -0,0 +1,15 @@ + + +# Documentation + +## SCA Documentation + ++ [Overview](/overview.md) ++ [Usage](/usage.md) ++ [Command Options](/command_options.md) ++ [Result](/result.md) ++ [Release Notes](/release-notes.md) ++ Usage Examples + + [Oracle to MogDB Evaluation](/oracle_to_mogdb.md) + + [MySQL to MogDB Evaluation](/mysql_to_mogdb.md) + + [DB2 to MogDB Evaluation](/db2_to_mogdb.md) \ No newline at end of file diff --git a/product/en/docs-sca/v5.0/usage.md b/product/en/docs-sca/v5.0/usage.md new file mode 100644 index 00000000..917185ab --- /dev/null +++ b/product/en/docs-sca/v5.0/usage.md @@ -0,0 +1,70 @@ +--- +title: SCA Usage +summary: SCA Usage +author: hongyedba +date: 2021-09-30 +--- + +# SCA Usage + +## Deployment Procedure + +SCA is already packaged as a binary executable, no additional deployment operations are required. + +SCA can be directly used only when the database can be connected through the network after the program file is uploaded. + +## Common Commands + +**Note**: The following uses the Linux OS of the x86-64 architecture as an example. For other ARM platforms or the MacOS system, the commands need to be modified accordingly. + +* Apply for a License (when the software is run for the first time, you need to apply for a license online first) + +```shell +# You need to enter the user email during the run +# The requested license data will be sent to the entered email address. +# Copy the license data and write it to the license.json file in the same directory as the SCA +./sca_linux_x86_64 -T L +``` + +* Initialize the repository (for the same target MogDB database, you only need to initialize the repository on the first run) + +```shell +./sca_macos_x86_64 -T i -H -P -N -U -E --user --password +``` + +* Oracle data collection (no repository required) + +```shell +# For test, you can add the following parameters to speed up SQL collection: -q 0.001 -Q 60 -m off +./sca_linux_x86_64 -T OC -s SCOTT -h -p -n -u -e +``` + +* Slow log collection from specified MySQL + +```shell +./sca_linux_x86_64 -T MC -d --slow-log= +``` + +* Automatic collection from a specified MySQL server + +```shell +./sca_linux_x86_64 -T MC -d -h -p -n -u -e +``` + +* Perform Oracle compatibility evaluation (repository is initialized and repository login information is default) + +```shell +./sca_linux_x86_64 -T OI -d -n +``` + +* SQL simulation only (repository is initialized and repository user and password information is default) + +```shell +./sca_linux_x86_64 -T OS -h -p -n -d +``` + +* Simultaneous SQL compatibility and performance evaluation (repository initialized) + +```shell +./sca_linux_x86_64 -T OIS -h -p -n -u -e -d +``` diff --git a/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md b/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md index 2b101a8d..4413bc16 100644 --- a/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md +++ b/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/4-installing-mogdb.md @@ -282,7 +282,6 @@ date: 2021-04-2 ``` tar -xvf MogDB-2.1.0-CentOS-x86_64.tar tar -xvf MogDB-2.1.0-CentOS-64bit-om.tar.gz - tar -xf MogDB-2.1.0-CentOS-64bit.tar.bz2 ``` 5. 进入到工具脚本存放目录下。 diff --git a/product/zh/docs-sca/v5.0/command_options.md b/product/zh/docs-sca/v5.0/command_options.md index 5975f917..d2ac6e7b 100644 --- a/product/zh/docs-sca/v5.0/command_options.md +++ b/product/zh/docs-sca/v5.0/command_options.md @@ -263,7 +263,7 @@ License 文件的位置。 源或目标库数据库名称,默认继承 -N 选项值。 -在 SQL 分析任务总,指定目标库名称,通常是使用 MTK 或其他数据迁移工具,进行数据库结构和数据迁移时,在 MogDB 端创建的目标数据库。 +在 SQL 分析任务中,指定目标库名称,通常是使用 MTK 或其他数据迁移工具,进行数据库结构和数据迁移时,在 MogDB 端创建的目标数据库。 需要注意的是,资料库用户默认需要对目标库有完全的操作权限,默认资料库是管理员权限。 diff --git a/product/zh/docs-sca/v5.0/result.md b/product/zh/docs-sca/v5.0/result.md index 50666950..8f6b765b 100644 --- a/product/zh/docs-sca/v5.0/result.md +++ b/product/zh/docs-sca/v5.0/result.md @@ -18,7 +18,7 @@ SCA 结果分为两类: 采集完成之后的结果提示信息如下: -```bash +``` 2022-02-15 19:20:40.301126 INFO [runMe.py:356] +==================== [ Summary Information ] ====================+ 2022-02-15 19:20:40.301184 INFO [runMe.py:357] | Task Name File Name File Size | 2022-02-15 19:20:40.301222 INFO [runMe.py:358] | --------------------- ------------------------------ ---------- | @@ -126,7 +126,7 @@ SQL详情页面展示如下几个方面的内容: #### Oracle 1. schema_name: 执行 SQL 的 Schema 信息,在 Oracle 中一般对应于用户 -2. sql_type: SQL 类型,区分 MySQL 中采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND +2. sql_type: SQL 类型,区分采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND 3. module: 执行 SQL 语句的客户端 module 4. action: 执行 SQL 语句的客户端 action 5. mogdb_error: MogDB 中的 SQL 执行错误码 @@ -138,7 +138,7 @@ SQL详情页面展示如下几个方面的内容: #### MySQL 1. schema_name: 执行 SQL 的 Schema 信息,在 MySQL 中一般对应于数据库 -2. sql_type: SQL 类型,区分 MySQL 中采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND +2. sql_type: SQL 类型,区分采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND 3. user_host: 执行 SQL 的 MySQL 客户端用户和对应的执行客户端主机信息 4. mysql_error: SQL 在 MySQL 中的执行情况,如果是 0 则表明 SQL 执行成功,非 0 表示在 MySQL 中执行报错 5. mogdb_error: MogDB 中的 SQL 执行错误码 @@ -150,7 +150,7 @@ SQL详情页面展示如下几个方面的内容: #### DB2 1. schema_name: 执行 SQL 的 Schema 信息 -2. sql_type: SQL 类型,区分 MySQL 中采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND +2. sql_type: SQL 类型,区分采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND 3. stmt_type: DB2 中记录的 SQL 语句类型 4. mogdb_error: MogDB 中的 SQL 执行错误码 5. mogdb_error_message: MogDB 中的 SQL 执行报错信息 diff --git a/product/zh/docs-sca/v5.0/toc.md b/product/zh/docs-sca/v5.0/toc.md index ccad39a7..5d77129e 100644 --- a/product/zh/docs-sca/v5.0/toc.md +++ b/product/zh/docs-sca/v5.0/toc.md @@ -9,7 +9,7 @@ + [命令选项](/command_options.md) + [结果说明](/result.md) + [发布记录](/release-notes.md) -+ [使用示例] ++ 使用示例 + [Oracle到MogDB评估](/oracle_to_mogdb.md) + [MySQL到MogDB评估](/mysql_to_mogdb.md) + [DB2到MogDB评估](/db2_to_mogdb.md) -- Gitee From 96d1b7b850053320e9e34afa1e9e9fc236fd7853 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Thu, 10 Mar 2022 19:25:18 +0800 Subject: [PATCH 3/6] fix issue --- product/en/docs-sca/v5.0/command_options.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/product/en/docs-sca/v5.0/command_options.md b/product/en/docs-sca/v5.0/command_options.md index e58bcf6b..ea9bbc57 100644 --- a/product/en/docs-sca/v5.0/command_options.md +++ b/product/en/docs-sca/v5.0/command_options.md @@ -320,5 +320,4 @@ When the CPU usage is greater than 90% or the remaining space of the file system Specifies the MySQL slow query log file. -When the collection program cannot access the target MySQL database and the collection program is not running on the MySQL server, you can manually retrieve the MySQL slow log from the target database and use the current option to specify the slow log to parse and generate the corresponding collection data, which can be used for subsequent MySQL SQL compatibility evaluation tasks. - +When the collection program cannot access the target MySQL database and the collection program is not running on the MySQL server, you can manually retrieve the MySQL slow log from the target database and use the current option to specify the slow log to parse and generate the corresponding collection data, which can be used for subsequent MySQL SQL compatibility evaluation tasks. \ No newline at end of file -- Gitee From c05c66609a5226aecd992855aa46e54fc990e2fa Mon Sep 17 00:00:00 2001 From: travelliu Date: Fri, 11 Mar 2022 03:04:37 +0000 Subject: [PATCH 4/6] feat(sca): release sca 5.0 --- src/utils/config.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/utils/config.js b/src/utils/config.js index eee65302..0d3bc1fd 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -106,6 +106,12 @@ const allVersions = { } }, mdb: null, + sca: { + 'v5.0': { + value: 'v5.0', + label: 'v5.0', + disabled: false + }, sca: { 'v4.1': { value: 'v4.1', -- Gitee From fa5dba3fd11df650b24dd065b599a71d2eac5c75 Mon Sep 17 00:00:00 2001 From: travelliu Date: Fri, 11 Mar 2022 03:12:19 +0000 Subject: [PATCH 5/6] fix(sca): config.js --- src/utils/config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/config.js b/src/utils/config.js index 0d3bc1fd..845b5a38 100644 --- a/src/utils/config.js +++ b/src/utils/config.js @@ -111,8 +111,7 @@ const allVersions = { value: 'v5.0', label: 'v5.0', disabled: false - }, - sca: { + }, 'v4.1': { value: 'v4.1', label: 'v4.1', -- Gitee From 91b9c3cf4a16fbf7ce20679ea7161470aaef44ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E5=8F=B6DBA?= Date: Fri, 11 Mar 2022 04:35:05 +0000 Subject: [PATCH 6/6] =?UTF-8?q?=E8=B0=83=E6=95=B4SCA=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E6=96=87=E6=A1=A3oracle=5Fto=5Fmogdb.md=E4=B8=AD=E7=9A=84?= =?UTF-8?q?=E6=89=80=E9=9C=80=E6=9D=83=E9=99=90=E7=9A=84=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product/en/docs-sca/v5.0/oracle_to_mogdb.md | 3 +++ product/zh/docs-sca/v5.0/oracle_to_mogdb.md | 3 +++ 2 files changed, 6 insertions(+) diff --git a/product/en/docs-sca/v5.0/oracle_to_mogdb.md b/product/en/docs-sca/v5.0/oracle_to_mogdb.md index bda2b43e..170fa9ca 100644 --- a/product/en/docs-sca/v5.0/oracle_to_mogdb.md +++ b/product/en/docs-sca/v5.0/oracle_to_mogdb.md @@ -27,8 +27,11 @@ Related Tool: The permissions required for the collection user are as follows. > SELECT ANY DICTIONARY +> > CREATE PROCEDURE +> > EXECUTE ON DBMS_LOB +> > SELECT ON GV_$SQL_PLAN ### Related Commands diff --git a/product/zh/docs-sca/v5.0/oracle_to_mogdb.md b/product/zh/docs-sca/v5.0/oracle_to_mogdb.md index a3eb56df..fec427e5 100644 --- a/product/zh/docs-sca/v5.0/oracle_to_mogdb.md +++ b/product/zh/docs-sca/v5.0/oracle_to_mogdb.md @@ -27,8 +27,11 @@ date: 2022-03-07 采集用户所需权限如下: > SELECT ANY DICTIONARY +> > CREATE PROCEDURE +> > EXECUTE ON DBMS_LOB +> > SELECT ON GV_$SQL_PLAN ### 相关命令 -- Gitee