From fa51db3117c3e040d54a205fe596a5e37faa52f5 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Fri, 18 Feb 2022 17:42:05 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=9B=B4=E6=96=B0orafce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../v2.1/reference-guide/oracle-plugins/orafce-user-guide.md | 2 +- .../v2.1/reference-guide/oracle-plugins/orafce-user-guide.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md b/product/en/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md index 81e8a23b..10f445e2 100644 --- a/product/en/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md +++ b/product/en/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md @@ -42,7 +42,7 @@ Check all schemas: Check functions where some functions include parameters and some functions do not include parameters. The parameter type is boolean. ```sql -\df +\df dbms_output.* ``` Example of functions that do not include parameters: diff --git a/product/zh/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md b/product/zh/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md index 61f471af..29649bca 100644 --- a/product/zh/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md +++ b/product/zh/docs-mogdb/v2.1/reference-guide/oracle-plugins/orafce-user-guide.md @@ -42,7 +42,7 @@ create extension orafce; 检查函数,其中函数分为有参数、无参数,参数类型为boolean。 ```sql -\df +\df dbms_output.* ``` 无参: -- Gitee From b318923d99478ea943191b890d2bf58422289f79 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Mon, 21 Feb 2022 11:23:01 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=A1=A8=E5=92=8C=E7=B3=BB=E7=BB=9F=E8=A7=86=E5=9B=BE=E6=A6=82?= =?UTF-8?q?=E8=BF=B0=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../overview-of-system-catalogs-and-system-views.md | 2 +- .../overview-of-system-catalogs-and-system-views.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md b/product/en/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md index 45338f13..f7475b4a 100644 --- a/product/en/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md +++ b/product/en/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md @@ -86,7 +86,7 @@ DROP VIEW IF EXISTS test_view; DROP TABLE IF EXISTS table1; ``` -### DELETE VEW +### DELETE VIEW ```sql CREATE TABLE IF NOT EXISTS table1(id int, a char(6), b varchar(6), c varchar(6)); diff --git a/product/zh/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md b/product/zh/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md index 741e909d..43fddeaa 100644 --- a/product/zh/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md +++ b/product/zh/docs-mogdb/v2.1/reference-guide/system-catalogs-and-system-views/overview-of-system-catalogs-and-system-views.md @@ -95,7 +95,7 @@ DROP VIEW IF EXISTS test_view; DROP TABLE IF EXISTS table1; ``` -### DELETE VEW +### DELETE VIEW ```sql CREATE TABLE IF NOT EXISTS table1(id int, a char(6), b varchar(6), c varchar(6)); -- Gitee From ee43ad9cc9c67c1e78608ad1544f1065ef3e07e4 Mon Sep 17 00:00:00 2001 From: travelliu Date: Mon, 28 Feb 2022 14:19:17 +0800 Subject: [PATCH 3/7] build: modify gitee build script --- nginx.conf | 5 +++++ scripts/build_pdf.sh | 37 ++++++++++++++++++++++++++++++++++++- scripts/gitee_build_pr.sh | 16 ++++++++++++---- 3 files changed, 53 insertions(+), 5 deletions(-) diff --git a/nginx.conf b/nginx.conf index a82019a5..bbbb7e08 100644 --- a/nginx.conf +++ b/nginx.conf @@ -42,9 +42,14 @@ http { proxy_ignore_client_abort on; server { listen 80; + # server_name docs.mogdb.io; charset utf-8; root /usr/share/nginx/html/; index index.html; + error_page 404 /404; + location / { + try_files $uri $uri/ =404; + } } include /etc/nginx/conf.d/*.conf; } diff --git a/scripts/build_pdf.sh b/scripts/build_pdf.sh index f9295f6c..187a5a31 100755 --- a/scripts/build_pdf.sh +++ b/scripts/build_pdf.sh @@ -36,6 +36,8 @@ only_build_mogdb=no # 只 构建 mogha~ 文档 only_build_mogha=no +# 只 构建 mogha~ 文档 +only_build_manager=no function h1() { @@ -223,6 +225,32 @@ function generate_mtk_pdf() { done } +managerDocsVersions=("v1.0") + + +declare -A managerZnTitle=( \ + ["toc"]="MogDB-Manager-指南" \ +) + +declare -A managerEnTitle=( \ + ["toc"]="MogDB-Manager-Reference" \ +) + +function generate_manager_pdf() { + for(( i=0;i<${#mogdbDocsLanguages[@]};i++)) + do + language=${mogdbDocsLanguages[i]} + for(( j=0;j<${#managerDocsVersions[@]};j++)) + do + version=${managerDocsVersions[j]} + if [[ "$language" == "zh" ]]; then + _generate_docs_pdf "docs-manager" $language $version managerZnTitle + elif [[ "$language" == "en" ]]; then + _generate_docs_pdf "docs-manager" $language $version managerEnTitle + fi + done + done +} scaDocsVersions=("v4.0" "v4.1") declare -A scaZnTitle=( \ @@ -360,6 +388,7 @@ function _usage() --mvd build mvd docs pdf --mtk build mtk docs pdf --mogha build mogha docs pdf + --manager build manager docs pdf --nobuild not build pdf --tex build tex file -u | --upload upload build pdf to oss @@ -376,7 +405,7 @@ Optnum=$# # NOTE: This requires GNU getopt. On Mac OS X and FreeBSD, you have to install this # separately; see below. -TEMP=$(getopt -o h,u --long help,mtk,sca,mvd,nobuild,mogha,mogdb,upload,tex \ +TEMP=$(getopt -o h,u --long help,mtk,sca,mvd,nobuild,mogha,mogdb,manager,upload,tex \ -n 'buld_pdf' -- "$@") if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi @@ -394,6 +423,7 @@ while true; do --mvd ) build_all=no;only_build_mvd=yes; shift ;; --mogha ) build_all=no;only_build_mogha=yes;shift ;; --mogdb ) build_all=no;only_build_mogdb=yes;shift ;; + --manager ) build_all=no;only_build_manager=yes;shift ;; --tex ) build_tex=yes;shift ;; * ) break ;; esac @@ -429,6 +459,11 @@ if [[ ${nobuild} != "no" ]]; then h1 "Build MogDB " generate_mogdb_pdf fi + # build mogdb pdf + if [[ "${build_all}" == "yes" ]] || [[ "${only_build_manager}" == "yes" ]]; then + h1 "Build MogDB Manager" + generate_manager_pdf + fi fi diff --git a/scripts/gitee_build_pr.sh b/scripts/gitee_build_pr.sh index 53866523..96478eca 100755 --- a/scripts/gitee_build_pr.sh +++ b/scripts/gitee_build_pr.sh @@ -1,5 +1,9 @@ #!/usr/bin/env bash +# export giteePullRequestIid=12 +# export BUILD_DIR=/data/pr +# export giteeSourceBranch=docs-develop + set -e conName="pr_"${giteePullRequestIid} @@ -37,7 +41,7 @@ if [[ ${retCode} != 0 ]]; then exit 1 fi -yarn build +yarn build --verbose # npm run build retCode=$? if [[ ${retCode} != 0 ]]; then @@ -54,7 +58,7 @@ if [ -f ${pr_port_file} ];then else for port in {9001..10000}; do - if [ ` lsof -i:${port} | wc -l` -eq 0 ]; then + if [ `netstat -apn |grep ${port} | wc -l` -eq 0 ]; then pr_port=${port} break fi @@ -66,10 +70,14 @@ if [ ! -n "${pr_port}" ]; then exit 1 fi +cp nginx.conf ${dir}/nginx.conf +sed -i "s/listen 80;/listen ${pr_port};/g" ${dir}/nginx.conf +sed -i "s/# server_name docs.mogdb.io;/server_name docs.mogdb.io;/g" ${dir}/nginx.conf + docker run -d \ - -v `pwd`/nginx.conf:/etc/nginx/nginx.conf \ + -v ${dir}/nginx.conf:/etc/nginx/nginx.conf \ -v ${publicDir}:/usr/share/nginx/html \ - -p ${pr_port}:80 \ + -p ${pr_port}:${pr_port} \ --name ${conName} \ nginx -- Gitee From a985ad2053a19f01aa4b58cc9db9bef51ba15bdd Mon Sep 17 00:00:00 2001 From: travelliu Date: Tue, 1 Mar 2022 17:08:36 +0800 Subject: [PATCH 4/7] mtk: mtk release v2.2.2 --- product/en/docs-mtk/v2.0/release-notes.md | 46 ++++++++++++++++++----- product/zh/docs-mtk/v2.0/release-notes.md | 28 ++++++++++++++ 2 files changed, 65 insertions(+), 9 deletions(-) diff --git a/product/en/docs-mtk/v2.0/release-notes.md b/product/en/docs-mtk/v2.0/release-notes.md index c7a4bdc5..b2eba715 100644 --- a/product/en/docs-mtk/v2.0/release-notes.md +++ b/product/en/docs-mtk/v2.0/release-notes.md @@ -7,19 +7,47 @@ date: 2021-09-13 # Release Notes +## v2.2.2 + +2022-03-01 + +- [mtk_2.2.2_darwin_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_darwin_amd64.tar.gz) +- [mtk_2.2.2_darwin_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_darwin_amd64_db2.tar.gz) +- [mtk_2.2.2_darwin_arm64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_darwin_arm64.tar.gz) +- [mtk_2.2.2_linux_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_linux_amd64.tar.gz) +- [mtk_2.2.2_linux_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_linux_amd64_db2.tar.gz) +- [mtk_2.2.2_linux_arm64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_linux_arm64.tar.gz) +- [mtk_2.2.2_windows_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_windows_amd64.tar.gz) +- [mtk_2.2.2_windows_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_windows_amd64_db2.tar.gz) +- [mtk_checksums.txt](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_checksums.txt) + +### Feat + +- Added check if the orafce plugin is installed and skips some syntax conversions +- Disables 'connect by' syntax conversion for BigDB 2.1.0 +- Optimized the migration of Oracle to openGauss/MogDB constraint renaming logic +- Added Oracle table data character set check + +### Fix + +- Code smell and security issues +- Migration of Oracle to MySQL section issue +- Migrated Some Syntax Conversion Issues from Oracle to MogDB 2.1.0 +- DB2 clob length issue + ## v2.2.1 2022-01-20 -- [mtk_2.2.1_darwin_amd64.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_darwin_amd64.tar.gz) -- [mtk_2.2.1_darwin_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_darwin_amd64_db2.tar.gz) -- [mtk_2.2.1_darwin_arm64.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_darwin_arm64.tar.gz) -- [mtk_2.2.1_linux_amd64.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_linux_amd64.tar.gz) -- [mtk_2.2.1_linux_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_linux_amd64_db2.tar.gz) -- [mtk_2.2.1_linux_arm64.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_linux_arm64.tar.gz) -- [mtk_2.2.1_windows_amd64.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_windows_amd64.tar.gz) -- [mtk_2.2.1_windows_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_2.2.1_windows_amd64_db2.tar.gz) -- [mtk_checksums.txt](https://cdn-mogdb.enmotech.com//mtk/v2.2.1/mtk_checksums.txt) +- [mtk_2.2.1_darwin_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_darwin_amd64.tar.gz) +- [mtk_2.2.1_darwin_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_darwin_amd64_db2.tar.gz) +- [mtk_2.2.1_darwin_arm64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_darwin_arm64.tar.gz) +- [mtk_2.2.1_linux_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_linux_amd64.tar.gz) +- [mtk_2.2.1_linux_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_linux_amd64_db2.tar.gz) +- [mtk_2.2.1_linux_arm64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_linux_arm64.tar.gz) +- [mtk_2.2.1_windows_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_windows_amd64.tar.gz) +- [mtk_2.2.1_windows_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_2.2.1_windows_amd64_db2.tar.gz) +- [mtk_checksums.txt](https://cdn-mogdb.enmotech.com/mtk/v2.2.1/mtk_checksums.txt) ### Feat diff --git a/product/zh/docs-mtk/v2.0/release-notes.md b/product/zh/docs-mtk/v2.0/release-notes.md index 88aa0dba..620b9e1d 100644 --- a/product/zh/docs-mtk/v2.0/release-notes.md +++ b/product/zh/docs-mtk/v2.0/release-notes.md @@ -7,6 +7,34 @@ date: 2021-09-17 # 发布记录 +## v2.2.2 + +2022-03-01 + +- [mtk_2.2.2_darwin_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_darwin_amd64.tar.gz) +- [mtk_2.2.2_darwin_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_darwin_amd64_db2.tar.gz) +- [mtk_2.2.2_darwin_arm64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_darwin_arm64.tar.gz) +- [mtk_2.2.2_linux_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_linux_amd64.tar.gz) +- [mtk_2.2.2_linux_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_linux_amd64_db2.tar.gz) +- [mtk_2.2.2_linux_arm64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_linux_arm64.tar.gz) +- [mtk_2.2.2_windows_amd64.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_windows_amd64.tar.gz) +- [mtk_2.2.2_windows_amd64_db2.tar.gz](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_2.2.2_windows_amd64_db2.tar.gz) +- [mtk_checksums.txt](https://cdn-mogdb.enmotech.com/mtk/v2.2.2/mtk_checksums.txt) + +### Feat + +- 增加检查orafce插件是否安装并跳过部分语法转换 +- 针对MogDB 2.1.0 禁用`connect by`语法转换 +- 优化迁移Oracle到openGauss/MogDB 约束改名逻辑 +- 增加Oracle表数据字符集检查 + +### Fix + +- 代码异味和安全问题 +- 迁移 Oracle 到 MySQL 部分问题 +- 迁移 Oracle to MogDB 2.1.0 部分语法转换问题 +- DB2 clob 长度问题 + ## v2.2.1 2022-01-20 -- Gitee From 7e2396cfb62040bff39d037f42584dc35827a1bf Mon Sep 17 00:00:00 2001 From: travelliu Date: Tue, 1 Mar 2022 09:17:20 +0000 Subject: [PATCH 5/7] fix: The word error --- product/en/docs-mtk/v2.0/release-notes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/product/en/docs-mtk/v2.0/release-notes.md b/product/en/docs-mtk/v2.0/release-notes.md index b2eba715..bb72f4a2 100644 --- a/product/en/docs-mtk/v2.0/release-notes.md +++ b/product/en/docs-mtk/v2.0/release-notes.md @@ -23,8 +23,8 @@ date: 2021-09-13 ### Feat -- Added check if the orafce plugin is installed and skips some syntax conversions -- Disables 'connect by' syntax conversion for BigDB 2.1.0 +- Added check if the `orafce` plugin is installed and skips some syntax conversions +- Disables `connect by` syntax conversion for MogDB 2.1.0 - Optimized the migration of Oracle to openGauss/MogDB constraint renaming logic - Added Oracle table data character set check -- Gitee From d17f21c873565a60f2abb6b5f704491a9a95cca8 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Mon, 7 Mar 2022 16:17:38 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E6=96=B0=E5=A2=9Ek8s=E9=83=A8=E7=BD=B2+?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=BA=90=E7=A0=81=E8=A7=A3=E6=9E=90+?= =?UTF-8?q?=E4=BC=98=E5=8C=96CentOS=E6=A0=87=E5=87=86=E5=AE=89=E8=A3=85?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E8=A6=81=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docker-installation.md | 35 +++++++++++++++++++ .../1-installation-preparation.md | 1 + .../2-environment-requirement.md | 1 + .../container-based-installation.md | 35 +++++++++++++++++++ .../en/docs-mogdb/v2.1/source-code-parsing.md | 10 +++++- .../docker-installation.md | 35 +++++++++++++++++++ .../1-installation-preparation.md | 1 + .../2-environment-requirement.md | 1 + .../container-based-installation.md | 35 +++++++++++++++++++ .../zh/docs-mogdb/v2.1/source-code-parsing.md | 10 +++++- 10 files changed, 162 insertions(+), 2 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md b/product/en/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md index a5adca37..cb7ef165 100644 --- a/product/en/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md +++ b/product/en/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md @@ -302,6 +302,41 @@ As you can see, the original standby database is writable after being switched a
+## Kubernetes-based Deployment + +MogDB 2.1.0 and later supports Kubernetes-based deployment. + +- x86 + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_amd.yaml + pod/mogdb created + ``` + +- arm + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_arm.yaml + pod/mogdb created + ``` + +- Kubernetes connect the pod + + Connect to MogDB through the gsql command in the pod. + + ``` + $ kubectl exec -it mogdb -- bash + root@mogdb:/# su - omm + omm@mogdb:~$ gsql -d postgres + gsql ((MogDB 2.1.0 build 56189e20) compiled at 2022-01-07 18:47:53 commit 0 last mr ) + Non-SSL connection (SSL connection is recommended when requiring high-security) + Type "help" for help. + + MogDB=# + ``` + +
+ ## What's Next MogDB container does not support MogHA and OM tools. It is only used for testing, and currently supports at most one primary node and eight standby nodes. MogDB Enterprise Edition includes MogHA component. The basic functions of the MogDB container and Enterprise Edition are identical. It is recommended that MogDB Enterprise Edition is used in the production environment. diff --git a/product/en/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md b/product/en/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md index 2f9ccb55..0a194ea0 100644 --- a/product/en/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md +++ b/product/en/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md @@ -85,6 +85,7 @@ Table 1 lists the minimum hardware requirements of the MogDB server. When planni | Software | Configuration Description | | :---------------- | :----------------------------------------------------------- | | rdtscp Instruction Set (x86) | Run the `lscpu | grep rdtscp` command to see if the rdtscp instruction set is supported. | +| bmi2 Instruction Set (CentOS) | Run the `lscpu | grep bmi2` command to see if the bmi2 instruction set is supported. | | Tool | bzip2 | ### Operating System Requirements diff --git a/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md b/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md index cfde59df..ce0b3883 100644 --- a/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md +++ b/product/en/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md @@ -23,6 +23,7 @@ The following table describes the minimum hardware requirements of MogDB. When p | Software | Description | | ----------------- | ------------------------------------------------------------ | | rdtscp Instruction Set (x86) | Run the `lscpu | grep rdtscp` command to see if the rdtscp instruction set is supported. | +| bmi2 Instruction Set (CentOS) | Run the `lscpu | grep bmi2` command to see if the bmi2 instruction set is supported. | | Tool | Huawei JDK 1.8.0, psmisc, and bzip2 | | Python | - openEuler: Python 3.7.X is supported.
- CentOS: Python 3.6.X is supported.
- Kirin: Python 3.7.X is supported.
NOTE:
Python needs to be compiled in -enable-shared mode. | diff --git a/product/en/docs-mogdb/v2.1/quick-start/container-based-installation.md b/product/en/docs-mogdb/v2.1/quick-start/container-based-installation.md index fef49cd8..05a364da 100644 --- a/product/en/docs-mogdb/v2.1/quick-start/container-based-installation.md +++ b/product/en/docs-mogdb/v2.1/quick-start/container-based-installation.md @@ -152,6 +152,41 @@ Specifies the database port. The default value is **5432**.
+## Kubernetes-based Deployment + +MogDB 2.1.0 and later supports Kubernetes-based deployment. + +- x86 + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_amd.yaml + pod/mogdb created + ``` + +- arm + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_arm.yaml + pod/mogdb created + ``` + +- Kubernetes connect the pod + + Connect to MogDB through the gsql command in the pod. + + ``` + $ kubectl exec -it mogdb -- bash + root@mogdb:/# su - omm + omm@mogdb:~$ gsql -d postgres + gsql ((MogDB 2.1.0 build 56189e20) compiled at 2022-01-07 18:47:53 commit 0 last mr ) + Non-SSL connection (SSL connection is recommended when requiring high-security) + Type "help" for help. + + MogDB=# + ``` + +
+ ## Sample dataset: Mogila MogDB Container Edition has a built-in sample dataset mogila. Mogila is a database representing a DVD rental store, containing information about films (like title, category, actresses), rental stores (like address, staff members, customers) and rentals, where a customer rents a film from a store through its staff. After installing MogDB Container Edition, you can use the mogila database for various functional tests. diff --git a/product/en/docs-mogdb/v2.1/source-code-parsing.md b/product/en/docs-mogdb/v2.1/source-code-parsing.md index 416787bc..a8002a05 100644 --- a/product/en/docs-mogdb/v2.1/source-code-parsing.md +++ b/product/en/docs-mogdb/v2.1/source-code-parsing.md @@ -75,4 +75,12 @@ You can click the links below to view this series of articles. [AI Technology (Part 4): Metrics Collection, Prediction, and Anomaly Detection](https://www.modb.pro/db/245341) -[AI Technology (Part 5): AI Query Time Prediction](https://www.modb.pro/db/251405) \ No newline at end of file +[AI Technology (Part 5): AI Query Time Prediction](https://www.modb.pro/db/251405) + +[AI Technology (Part 6): DeepSQL](https://www.modb.pro/db/329691) + +## Parsing of Security Management Source Code + +[Parsing of Security Management Source Code (Part 1)](https://www.modb.pro/db/335331) + +[Parsing of Security Management Source Code (Part 2)](https://www.modb.pro/db/337160) \ No newline at end of file diff --git a/product/zh/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md b/product/zh/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md index 88405232..61780bb7 100644 --- a/product/zh/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md +++ b/product/zh/docs-mogdb/v2.1/installation-guide/docker-installation/docker-installation.md @@ -306,6 +306,41 @@ delete from test;
+## Kubernetes部署 + +MogDB 2.1.0版本以后支持Kubernetes部署。 + +- x86 + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_amd.yaml + pod/mogdb created + ``` + +- arm + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_arm.yaml + pod/mogdb created + ``` + +- k8s连接pod + + 进入容器内通过gsql命令登录MogDB。 + + ``` + $ kubectl exec -it mogdb -- bash + root@mogdb:/# su - omm + omm@mogdb:~$ gsql -d postgres + gsql ((MogDB 2.1.0 build 56189e20) compiled at 2022-01-07 18:47:53 commit 0 last mr ) + Non-SSL connection (SSL connection is recommended when requiring high-security) + Type "help" for help. + + MogDB=# + ``` + +
+ ## 后续步骤 MogDB容器版不支持MogHA工具、OM工具,仅用于测试使用,目前最多支持一主八备。MogDB企业版包含MogHA组件。容器版与企业版基础功能完全一致,在生产环境中建议使用MogDB企业版。 diff --git a/product/zh/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md b/product/zh/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md index 656515a8..76429518 100644 --- a/product/zh/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md +++ b/product/zh/docs-mogdb/v2.1/installation-guide/simplified-installation-process/1-installation-preparation.md @@ -87,6 +87,7 @@ date: 2021-06-11 | 软件类型 | 配置描述 | | :------------ | :----------------------------------------------------------- | | rdtscp指令集(x86) | 执行`lscpu | grep rdtscp`命令查看是否支持rdtscp指令集。 | +| bmi2指令集(CentOS) | 执行`lscpu | grep bmi2`命令查看是否支持bmi2指令集。 | | 工具 | bzip2 | ### 操作系统要求 diff --git a/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md b/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md index 1a2bd381..9402821b 100644 --- a/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md +++ b/product/zh/docs-mogdb/v2.1/installation-guide/standard-installation/2-environment-requirement.md @@ -23,6 +23,7 @@ date: 2021-04-2 | 软件类型 | 配置描述 | | ------------- | ------------------------------------------------------------ | | rdtscp指令集(x86) | 执行`lscpu | grep rdtscp`命令查看是否支持rdtscp指令集。 | +| bmi2指令集(CentOS) | 执行`lscpu | grep bmi2`命令查看是否支持bmi2指令集。 | | 工具 | Huawei JDK 1.8.0、psmisc、bzip2 | | Python | - openEuler:支持Python 3.7.X
- CentOS:支持Python 3.6.X
- 麒麟:支持Python 3.7.X
说明:
python需要通过-enable-shared方式编译。 | diff --git a/product/zh/docs-mogdb/v2.1/quick-start/container-based-installation.md b/product/zh/docs-mogdb/v2.1/quick-start/container-based-installation.md index c2ff5a1e..3df3f7c8 100644 --- a/product/zh/docs-mogdb/v2.1/quick-start/container-based-installation.md +++ b/product/zh/docs-mogdb/v2.1/quick-start/container-based-installation.md @@ -148,6 +148,41 @@ MogDB的密码有复杂度要求,密码长度8个字符以上,必须同时
+## Kubernetes部署 + +MogDB 2.1.0版本以后支持Kubernetes部署。 + +- x86 + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_amd.yaml + pod/mogdb created + ``` + +- arm + + ``` + $ kubectl apply -f https://gitee.com/enmotech/enmotech-docker-mogdb/raw/master/2.1.0/k8s_arm.yaml + pod/mogdb created + ``` + +- k8s连接pod + + 进入容器内通过gsql命令登录MogDB。 + + ``` + $ kubectl exec -it mogdb -- bash + root@mogdb:/# su - omm + omm@mogdb:~$ gsql -d postgres + gsql ((MogDB 2.1.0 build 56189e20) compiled at 2022-01-07 18:47:53 commit 0 last mr ) + Non-SSL connection (SSL connection is recommended when requiring high-security) + Type "help" for help. + + MogDB=# + ``` + +
+ ## Mogila样本数据集 MogDB容器版内置了一个样本数据库mogila,该数据库是一个关于DVD出租店信息的数据库,包含有关电影(如标题、类别、女演员)、出租店(如地址、工作人员、客户)和出租的信息,其中一位顾客通过店员从一家商店租了一部影片。安装完MogDB容器版之后,您可以使用mogila数据库进行各种功能测试。 diff --git a/product/zh/docs-mogdb/v2.1/source-code-parsing.md b/product/zh/docs-mogdb/v2.1/source-code-parsing.md index 078b4302..51cbbeea 100644 --- a/product/zh/docs-mogdb/v2.1/source-code-parsing.md +++ b/product/zh/docs-mogdb/v2.1/source-code-parsing.md @@ -75,4 +75,12 @@ date: 2022-02-07 [AI技术(四):指标采集、预测与异常检测](https://www.modb.pro/db/245341) -[AI技术(五):AI查询时间预测](https://www.modb.pro/db/251405) \ No newline at end of file +[AI技术(五):AI查询时间预测](https://www.modb.pro/db/251405) + +[AI技术(六):DeepSQL](https://www.modb.pro/db/329691) + +## 安全管理源码解析 + +[安全管理源码解析(一)](https://www.modb.pro/db/335331) + +[安全管理源码解析(二)](https://www.modb.pro/db/337160) \ No newline at end of file -- Gitee From f06aa41afc4c6f02b40a866f5934fffcb9c1e23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BA=A2=E5=8F=B6DBA?= Date: Tue, 8 Mar 2022 07:57:54 +0000 Subject: [PATCH 7/7] =?UTF-8?q?SCA=20v5.0=20=E7=89=88=E6=9C=AC=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=9B=B4=E6=96=B0=20*=20=E7=A7=BB=E9=99=A4iCloud?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BA=A7=E7=94=9F=E7=9A=84=E4=B8=80=E5=A0=86?= =?UTF-8?q?=202=20=E7=BB=93=E5=B0=BE=E7=9A=84=E5=A4=9A=E4=BD=99=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20*=20=E7=A7=BB=E9=99=A4iCloud=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E4=BA=A7=E7=94=9F=E7=9A=84=E4=B8=80=E5=A0=86=202=20=E7=BB=93?= =?UTF-8?q?=E5=B0=BE=E7=9A=84=E5=A4=9A=E4=BD=99=E6=96=87=E4=BB=B6=20*=20?= =?UTF-8?q?=E7=A7=BB=E9=99=A4SCA=20v5.0=E6=96=87=E6=A1=A3=E4=B8=AD?= =?UTF-8?q?=E7=9A=84=E5=A4=9A=E4=BD=99=E7=A9=BA=E8=A1=8C=20*=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0v5.0=E5=8F=91=E5=B8=83=E8=AE=B0=E5=BD=95=20*=20?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0V5.0=E7=89=88=E6=9C=AC=E7=9A=84SCA=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product/zh/docs-sca/v5.0/command_options.md | 323 ++++++++++++++++++++ product/zh/docs-sca/v5.0/db2_to_mogdb.md | 93 ++++++ product/zh/docs-sca/v5.0/mysql_to_mogdb.md | 105 +++++++ product/zh/docs-sca/v5.0/oracle_to_mogdb.md | 97 ++++++ product/zh/docs-sca/v5.0/overview.md | 58 ++++ product/zh/docs-sca/v5.0/release-notes.md | 50 +++ product/zh/docs-sca/v5.0/result.md | 159 ++++++++++ product/zh/docs-sca/v5.0/toc.md | 15 + product/zh/docs-sca/v5.0/usage.md | 70 +++++ 9 files changed, 970 insertions(+) create mode 100644 product/zh/docs-sca/v5.0/command_options.md create mode 100644 product/zh/docs-sca/v5.0/db2_to_mogdb.md create mode 100644 product/zh/docs-sca/v5.0/mysql_to_mogdb.md create mode 100644 product/zh/docs-sca/v5.0/oracle_to_mogdb.md create mode 100644 product/zh/docs-sca/v5.0/overview.md create mode 100644 product/zh/docs-sca/v5.0/release-notes.md create mode 100644 product/zh/docs-sca/v5.0/result.md create mode 100644 product/zh/docs-sca/v5.0/toc.md create mode 100644 product/zh/docs-sca/v5.0/usage.md diff --git a/product/zh/docs-sca/v5.0/command_options.md b/product/zh/docs-sca/v5.0/command_options.md new file mode 100644 index 00000000..5975f917 --- /dev/null +++ b/product/zh/docs-sca/v5.0/command_options.md @@ -0,0 +1,323 @@ +--- +title: SCA 使用说明 +summary: SCA 使用说明 +author: Hong Rihua +date: 2022-03-07 +--- + +# SCA 命令行选项 + +SCA 为纯命令行工具,所有功能均可通过单一的可执行程序完成。 + +## 通用选项 + +通用选项在三类任务中均有可能会使用。 + +### --help (帮助信息) + +在使用分析程序前,建议仔细阅读帮助信息(命令: `./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 (查看版本) + +查看当前 SCA 的版本信息: + +```shell +hongyedba@localhost ~ % ./sca_linux_x86_64 -v +SCA version: 5.0.0 +``` + +### -T, --type (任务类型) + +默认值: OI + +指定任务类型,目前 SCA 支持如下类型的任务: + +1. `I [Initialize]`: **初始化**,用于初始化 SCA 资料库 +2. `L [Apply License]`: **申请 License**,用于 License 申请的任务 +3. `OC [Oracle Collection]`: **Oracle采集**,用于采集 Oracle 数据库中执行过的业务 SQL,需要长时间采集 +4. `MC [MySQL Collection]`: **MySQL采集**,用于采集 MySQL 数据库中执行过的业务 SQL,需提前配置慢日志,然后一次性采集 +5. `DC [DB2 Collection]`: **DB2采集**,用于采集 DB2 数据库中执行过的业务 SQL,需要长时间采集 +6. `OI [Oracle Inspection]`: **Oracle兼容评估**,用于评估源端 Oracle 中采集到的业务 SQL,在目标端 MogDB 中的实际兼容性 +7. `MI [MySQL Inspection]`: **MySQL兼容评估**,用于评估源端 MySQL 中采集到的业务 SQL,在目标端 MogDB 中的实际兼容性 +8. `DI [DB2 Inspection]`: **DB2兼容评估**,用于评估源端 DB2 中采集到的业务 SQL,在目标端 MogDB 中的实际兼容性 +9. `OS [Oracle Simulation]`: **Oracle性能评估**,用于评估源端 Oracle 中采集到的业务 SQL,在目标端 MogDB 中的执行性能 +10. `OIS [Oracle Inspection & Simulation]`: **Oracle兼容和性能评估**,等同于 OI + OS 两种任务同时进行 + +### -d, --data (数据目录) + +除了资料库初始化(-T I)之外的所有任务类型,都可以指定 -d 数据目录。 + +采集任务会将采集到的数据写入到 -d 指定的数据目录。 + +分析任务会从数据目录中读取数据,将数据插入到资料库表中,最终生成的报告结果默认也会写入到数据目录下。 + +### -D, --data-id (数据编号) + +指定数据编号,然后直接从资料库读取指定编号的数据,而不是重新从数据目录中读取并加载数据。 + +指定 -D 选项后,会跳过加载数据的步骤,直接执行相关的分析任务。 + +### -w, --workers (并发度) + +默认值: 10 + +指定用于运行任务的并发度大小,适量的并发度有助于提高各个任务的运行速度。 + +并发度用于: 文件数据加载到资料库,SQL兼容度评估,SQL复杂度评估,SQL性能模拟等操作中。 + +**注意**: + +* 在SQL模拟任务中,并发度越大,可能导致单条SQL的执行效率下降,需要依据实际生产环境的负载压力选取合理的并发度,通常设置为生产库的平均活跃会话数。 + +### -x, --debug (Debug模式) + +开启 Debug 模式,不会影响正常的分析逻辑,但是会输出大量的日志,通常用于辅助分析程序本身的运行异常。 + +### -l, --logfile (日志文件) + +指定程序日志文件,程序输出会同时输出到终端命令行与日志文件中。 + +### -L, --log-only (仅日志文件) + +指定程序日志文件,程序输出会仅输出到日志文件中。 + +### -F, --force (强制模式) + +是否启用强制模式,强制模式会在资料库初始化场景下生效。 + +在资料库初始化过程中,如果启用强制模式,会先删除资料库,然后重新创建。 + +### -r, --report (报告目录) + +默认值: /report + +指定报告目录,这里的报告包括 `兼容评估` 报告和 `SQL模拟` 报告,都是 html 格式报告,可离线查看。 + +同时,对于 `兼容评估` 任务,还会产生 `sql_detail_list.csv` 文件,记录所有 SQL 的评估结果,以及可能存在的改写方案。 + +### --license (License文件) + +默认值: ./license.json + +License 文件的位置。 + +### --sql-transformer (SQL转换规则) + +【高级用法】 指定从源库到目标库的 SQL 转换规则,使用正则匹配进行转换。 + +## 资料库选项 + +### -H, --repo-host (资料库IP地址) + +默认值: 127.0.0.1 + +资料库数据库 IP 地址。 + +### -P, --repo-port (资料库端口) + +默认值: 5432 + +资料库数据库端口。 + +### -N, --repo-name (资料库名称) + +默认值: sca_db + +资料库数据库名称。 + +### -U, --repo-user (资料库用户) + +默认值: sca_repo + +资料库数据库登录用户。 + +### -E, --repo-password (资料库密码) + +默认值: SCA@password + +资料库数据库登录密码。 + +### --user (管理员用户) + +资料库管理员用户,用于初始化资料库过程中,创建资料库用户,和资料库数据库。 + +### --password (管路员密码) + +资料库管理员用户登录密码,用于初始化资料库过程中,创建资料库用户,和资料库数据库。 + +## 源或目标库连接 + +### -h, --db-host (源或目标库IP地址) + +源或目标库数据库 IP 地址,默认继承 -H 选项值。 + +### -p, --db-port (源或目标库端口) + +源或目标库数据库端口,默认继承 -P 选项值。 + +### -n, --db-name (源或目标库名称) + +源或目标库数据库名称,默认继承 -N 选项值。 + +在 SQL 分析任务总,指定目标库名称,通常是使用 MTK 或其他数据迁移工具,进行数据库结构和数据迁移时,在 MogDB 端创建的目标数据库。 + +需要注意的是,资料库用户默认需要对目标库有完全的操作权限,默认资料库是管理员权限。 + +* 在兼容评估中,只需要目标库有对象结构即可 +* 在SQL模拟中,需要目标库既有对象结构,也有真实对等的全量生产数据,否则性能模拟的结果不具有参考意义 + +### -u, --db-user (源或目标库用户) + +源或目标库数据库登录用户,默认继承 -U 选项值。 + +### -e, --db-password (源或目标库密码) + +源或目标库数据库登录密码,默认继承 -E 选项值。 + +### --target-type (目标库类型) + +指定分析任务总,目标数据库类型,默认为 MOGDB。 + +当前此参数并未完善,仅支持 MOGDB/POSTGRESQL。 + +## 数据采集选项 + +### -q, --sql-days (SQL采集天数) + +指定 SQL 相关数据的采集总天数,由于从会话缓存 GV$SQLAREA 中采集已执行过的 SQL 数据,存在一定的概率漏采,可通过延长采集天数,减小漏采的概率。 + +默认会采集一周 7 天的 SQL 数据。 + +### -Q, --sql-interval (SQL采集间隔) + +指定 SQL 相关数据的采集间隔(单位:秒),默认每 10 分钟采集一次。 + +每次采集到的 SQL 数据会和已采集的数据进行对比去重,避免重复数据太多导致的数据文件过大。 + +### -s, schema-include (Schema白名单) + +指定数据采集的 Schema 白名单,即只采集白名单列表中列出的 Schema 相关数据。 + +### -S, schema-exclude (Schema黑名单) + +指定数据采集的 Schema 黑名单,即不采集黑名单列表中列出的 Schema 相关数据。 + +默认会将 Oracle 系统用户列入 Schema 黑名单中。 + +### -m, enable-monitor (资源监控) + +是否在后台启用资源监控子进程,默认启用。 + +资源监控子进程会定期(间隔 3 秒)查询当前服务器的 CPU 使用率,以及数据目录所在文件系统的剩余空间。 + +当 CPU 使用率高于 90%,或者文件系统剩余空间低于 100MB 时,监控子进程会触发信号,停止采集主进程,避免因为资源问题导致服务器故障。 + +### --slow-log (慢查询日志) + +采集时,指定 MySQL 慢查询日志文件。 + +在采集程序无法访问目标 MySQL 数据库,以及不在 MySQL 服务器上运行采集程序时,可手动将目标库 MySQL 慢日志取出来,使用当前选项指定慢日志即可解析并生成对应的采集数据,可用于后续 MySQL SQL 兼容性评估任务。 diff --git a/product/zh/docs-sca/v5.0/db2_to_mogdb.md b/product/zh/docs-sca/v5.0/db2_to_mogdb.md new file mode 100644 index 00000000..ee5bba40 --- /dev/null +++ b/product/zh/docs-sca/v5.0/db2_to_mogdb.md @@ -0,0 +1,93 @@ +--- +title: DB2到MogDB评估 +summary: DB2到MogDB评估 +author: Hong Rihua +date: 2022-03-07 +--- + +# DB2 到 MogDB 评估 + +## MogDB 环境准备 + +需要自行准备 MogDB/openGauss 数据库环境,用于资料库和目标库,资料库和目标库默认使用同一套环境。 + +## 对象结构迁移 + +- **结构迁移**: 需要在准备好的 MogDB/openGauss 环境中,创建目标库,并将源库中的数据结构迁移到新创建的目标库中。 +- **数据迁移**: 如果想要进行 SQL 性能对比评估,那么除了迁移数据库结构之外,还需要迁移表数据,确保源 DB2 与目标 MogDB/openGauss 库数据规模一致,性能对比才有意义。 + +相关工具: + +- **MTK**: 可使用 MTK 工具完成结构和数据迁移,具体详情请参考: [https://mogdb.io/mtk](https://mogdb.io/mtk) + +## DB2 数据采集 + +### 所需权限 + +采集用户所需权限如下: + +> dbadm + +### 相关命令 + +```shell +./sca_linux_x86_64 -T DC -h -p -n -u -e + +# 命令选项说明: +# -h/p/t/u/e 指定连接的源端 DB2 库的连接方式 +# 考虑到共享缓存中 SQL 内容不一定全面,采集会持续性增量采集,默认采集一周的数据。如果只是做功能性验证,可使用 -q 0.001 -Q 60 选项,即只进行一次 SQL 数据采集。 +``` + +### 采集结果 + +采集完成后,会生成一个 zip 数据包,该数据包可以拷贝到目标库,并解压成数据目录。 + +后续兼容性分析,则依赖此数据包中的数据,且无需再次连接到源 DB2 数据库。 + +## 资料库初始化 + +```shell +# 使用具有管理员权限的 MogDB/openGauss 用户,进行资料库初始化 +# 资料库初始化会默认创建名称为 sca_db 的资料库 +# 可通过 -N 指定资料库名称,-U 指定资料库用户名,-E 指定资料库用户密码 + +./sca_linux_x86_64 -T i -H -P -N sca_db -U sca_repo -E 'SCA@password' --user --password +``` + +## 执行分析任务 + +### 兼容性分析 + +若只做 SQL 兼容性分析,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T DI -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 + +### 性能对比分析 + +若只做 SQL 性能对比分析,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T DS -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 + +### 兼容性分析 + 性能对比分析 + +若需要同时做 SQL 兼容性分析和 SQL 性能对比,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T DIS -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 diff --git a/product/zh/docs-sca/v5.0/mysql_to_mogdb.md b/product/zh/docs-sca/v5.0/mysql_to_mogdb.md new file mode 100644 index 00000000..cdd00f00 --- /dev/null +++ b/product/zh/docs-sca/v5.0/mysql_to_mogdb.md @@ -0,0 +1,105 @@ +--- +title: MySQL到MogDB评估 +summary: MySQL到MogDB评估 +author: Hong Rihua +date: 2022-03-07 +--- + +# MySQL 到 MogDB 评估 + +## MogDB 环境准备 + +需要自行准备 MogDB/openGauss 数据库环境,用于资料库和目标库,资料库和目标库默认使用同一套环境。 + +## 对象结构迁移 + +- **结构迁移**: 需要在准备好的 MogDB/openGauss 环境中,创建目标库,并将源库中的数据结构迁移到新创建的目标库中。 +- **数据迁移**: 如果想要进行 SQL 性能对比评估,那么除了迁移数据库结构之外,还需要迁移表数据,确保源 MySQL 与目标 MogDB/openGauss 库数据规模一致,性能对比才有意义。 + +相关工具: + +- **MTK**: 可使用 MTK 工具完成结构和数据迁移,具体详情请参考: [https://mogdb.io/mtk](https://mogdb.io/mtk) + +## MySQL 数据采集 + +### 所需权限 + +采集用户所需权限如下: + +> root + +### 开启慢 SQL 日志 + +- 需要提前开启慢日志,确保慢日志中记录完整的业务周期数据,建议提前一周开启慢日志 +- 慢 SQL 阈值间隔设置为 0 + +```sql +SET GLOBAL slow_query_log=ON; +SET GLOBAL long_query_time=0.001; +set global log_output='FILE'; -- 也支持 log_output='TABLE', 但内容相对较少 +``` + +### 数据采集 + +建议在慢日志开启后,运行完整业务周期之后,再执行数据采集命令。 + +```shell +./sca_linux_x86_64 -T MC -h -p -n -u -e + +# 命令选项说明: +# -h/p/t/u/e 指定连接的源端 MySQL 库的连接方式 +``` + +### 采集结果 + +采集完成后,会生成一个 zip 数据包,该数据包可以拷贝到目标库,并解压成数据目录。 + +后续兼容性分析,则依赖此数据包中的数据,且无需再次连接到源 MySQL 数据库。 + +## 资料库初始化 + +```shell +# 使用具有管理员权限的 MogDB/openGauss 用户,进行资料库初始化 +# 资料库初始化会默认创建名称为 sca_db 的资料库 +# 可通过 -N 指定资料库名称,-U 指定资料库用户名,-E 指定资料库用户密码 + +./sca_linux_x86_64 -T i -H -P -N sca_db -U sca_repo -E 'SCA@password' --user --password +``` + +## 执行分析任务 + +### 兼容性分析 + +若只做 SQL 兼容性分析,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T OI -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 + +### 性能对比分析 + +若只做 SQL 性能对比分析,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T OS -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 + +### 兼容性分析 + 性能对比分析 + +若需要同时做 SQL 兼容性分析和 SQL 性能对比,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T OIS -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 diff --git a/product/zh/docs-sca/v5.0/oracle_to_mogdb.md b/product/zh/docs-sca/v5.0/oracle_to_mogdb.md new file mode 100644 index 00000000..a3eb56df --- /dev/null +++ b/product/zh/docs-sca/v5.0/oracle_to_mogdb.md @@ -0,0 +1,97 @@ +--- +title: Oracle到MogDB评估 +summary: Oracle到MogDB评估 +author: Hong Rihua +date: 2022-03-07 +--- + +# Oracle 到 MogDB 评估 + +## MogDB 环境准备 + +需要自行准备 MogDB/openGauss 数据库环境,用于资料库和目标库,资料库和目标库默认使用同一套环境。 + +## 对象结构迁移 + +- **结构迁移**: 需要在准备好的 MogDB/openGauss 环境中,创建目标库,并将源库中的数据结构迁移到新创建的目标库中。 +- **数据迁移**: 如果想要进行 SQL 性能对比评估,那么除了迁移数据库结构之外,还需要迁移表数据,确保源 Oracle 与目标 MogDB/openGauss 库数据规模一致,性能对比才有意义。 + +相关工具: + +- **MTK**: 可使用 MTK 工具完成结构和数据迁移,具体详情请参考: [https://mogdb.io/mtk](https://mogdb.io/mtk) + +## Oracle 数据采集 + +### 所需权限 + +采集用户所需权限如下: + +> SELECT ANY DICTIONARY +> CREATE PROCEDURE +> EXECUTE ON DBMS_LOB +> SELECT ON GV_$SQL_PLAN + +### 相关命令 + +```shell +./sca_linux_x86_64 -T OC -s SCOTT -h -p -n -u -e + +# 命令选项说明: +# -s 指定需要采集的 Schema 列表 +# -h/p/t/u/e 指定连接的源端 Oracle 库的连接方式 +# 考虑到共享缓存中 SQL 内容不一定全面,采集会持续性增量采集,默认采集一周的数据。如果只是做功能性验证,可使用 -q 0.001 -Q 60 选项,即只进行一次 SQL 数据采集。 +``` + +### 采集结果 + +采集完成后,会生成一个 zip 数据包,该数据包可以拷贝到目标库,并解压成数据目录。 + +后续兼容性分析,则依赖此数据包中的数据,且无需再次连接到源 Oracle 数据库。 + +## 资料库初始化 + +```shell +# 使用具有管理员权限的 MogDB/openGauss 用户,进行资料库初始化 +# 资料库初始化会默认创建名称为 sca_db 的资料库 +# 可通过 -N 指定资料库名称,-U 指定资料库用户名,-E 指定资料库用户密码 + +./sca_linux_x86_64 -T i -H -P -N sca_db -U sca_repo -E 'SCA@password' --user --password +``` + +## 执行分析任务 + +### 兼容性分析 + +若只做 SQL 兼容性分析,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T OI -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 + +### 性能对比分析 + +若只做 SQL 性能对比分析,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T OS -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 + +### 兼容性分析 + 性能对比分析 + +若需要同时做 SQL 兼容性分析和 SQL 性能对比,则使用如下命令: + +```shell +# 若资料库名称,用户名,密码非默认,则需要使用 -N, -U, -E 选项指定 + +./sca_linux_x86_64 -T OIS -H -P -d +``` + +分析完成后,会在 -d 指定的目录中生成 report,可将 report 离线下载后进行查看。 diff --git a/product/zh/docs-sca/v5.0/overview.md b/product/zh/docs-sca/v5.0/overview.md new file mode 100644 index 00000000..1595a616 --- /dev/null +++ b/product/zh/docs-sca/v5.0/overview.md @@ -0,0 +1,58 @@ +--- +title: SCA 介绍 +summary: SCA 介绍 +author: Hong Rihua +date: 2022-03-07 +--- + +# SCA 介绍 + +SCA 全称 SQL Compatible Analysis,是一款异构数据库迁移前的 SQL 兼容和性能评估工具。 + +可用于异构数据迁移前的兼容性评估,评估源数据库中的实际业务 SQL 在目标库中是否存在语法问题,以及评估两款异构数据库中的 SQL 实际执行的性能差异。 + +本工具目前支持三种源端数据库,包括: Oracle, MySQL, DB2。 + +**适用于**: MogDB(以及其他基于 openGauss 的数据库) + +SCA 程序可运行如下 10 种类型的任务: + +1. `I [Initialize]`: **初始化**,用于初始化 SCA 资料库 +2. `L [Apply License]`: **申请 License**,用于 License 申请的任务 +3. `OC [Oracle Collection]`: **Oracle采集**,用于采集 Oracle 数据库中执行过的业务 SQL,需要长时间采集 +4. `MC [MySQL Collection]`: **MySQL采集**,用于采集 MySQL 数据库中执行过的业务 SQL,需提前配置慢日志,然后一次性采集 +5. `DC [DB2 Collection]`: **DB2采集**,用于采集 DB2 数据库中执行过的业务 SQL,需要长时间采集 +6. `OI [Oracle Inspection]`: **Oracle兼容评估**,用于评估源端 Oracle 中采集到的业务 SQL,在目标端 MogDB 中的实际兼容性 +7. `MI [MySQL Inspection]`: **MySQL兼容评估**,用于评估源端 MySQL 中采集到的业务 SQL,在目标端 MogDB 中的实际兼容性 +8. `DI [DB2 Inspection]`: **DB2兼容评估**,用于评估源端 DB2 中采集到的业务 SQL,在目标端 MogDB 中的实际兼容性 +9. `OS [Oracle Simulation]`: **Oracle性能评估**,用于评估源端 Oracle 中采集到的业务 SQL,在目标端 MogDB 中的执行性能 +10. `OIS [Oracle Inspection & Simulation]`: **Oracle兼容和性能评估**,等同于 OI + OS 两种任务同时进行 + +注意: + +- 兼容评估,需要有完整的源库结构,推荐使用 MTK 工具进行源数据库结构迁移,也可使用 SCA 自动创建测试目标库结构,SCA 创建的目标库兼容性较差 +- SQL模拟,需要有完整的源库数据和数据,推荐使用 MTK 工具进行源数据库结构以及数据迁移 + +## 操作系统与平台支持 + +SCA 目前支持在如下操作系统和平台架构下运行: + +1. Linux x86_64 +2. Linux arm64 (ARM 平台由于没有 DB2 客户端,故不支持 DB2 数据采集) +3. MacOS (MacOS 版本不支持 openGauss/MogDB 中的 SHA256 加密认证方式) + +## 数据库支持 + +SCA 目前支持的源端与目标端数据库类型如下: + +1. 源端: + - Oracle: 不低于 10.2 + - MySQL: 不低于 5.5 + - DB2: 不低于 11.5 + - File: MySQL slow-log + +2. 目标端: + - MogDB/openGauss: 不低于 2.0 + - PostgreSQL: 不低于 13.0 + +**注意**: 平台支持,与数据库支持没有相关性,数据库可以运行在其他平台,如 Windows/AIX 等,只要从数据库到 SCA 运行主机网络与端口互通即可。 diff --git a/product/zh/docs-sca/v5.0/release-notes.md b/product/zh/docs-sca/v5.0/release-notes.md new file mode 100644 index 00000000..21457b79 --- /dev/null +++ b/product/zh/docs-sca/v5.0/release-notes.md @@ -0,0 +1,50 @@ +--- +title: 发布记录 +summary: 发布记录 +author: Hong Rihua +date: 2022-03-07 +--- + +# 发布记录 + +## 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) +- [示例报告](https://cdn-mogdb.enmotech.com/sca/SCA_v5.0.0/SCA_sample_report_v5.0.zip) + +### Feature + +- 代码逻辑重构,命令选项和使用方式有较大改变 +- 支持 MySQL 连库采集,通过数据库表中的慢日志信息采集,或者通过服务器端本地慢日志采集 +- 支持 DB2 数据的连库采集,采集方式与 Oracle 类似,需要长期运行,默认采集一周 +- 支持 DB2 SQL 兼容性分析,前提是需要提前准备好目标 MogDB 数据库 +- 支持 Oracle SQL 详情列表文件的导出 (sql_detail_list.csv) +- 调整 Oracle 数据采集逻辑,移除不必要的对象信息与系统配置信息 +- 调整资料库结构,只保留源库基础信息,SQL兼容审核,SQL性能对比等相关的结构 + +## v4.1.0 + +- [SCA使用说明_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 + +- 支持 MySQL 数据库基于 slow-log 和 general-log 的 SQL 兼容度分析 +- 支持自定义 SQL 转换规则 + +## v4.0.0 + +- [SCA使用说明_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 + +- 集成全新设计的离线分析报告 +- 支持单个可执行程序的数据采集,兼容性分析与性能评估 +- 支持 Linux 系统下的 openGauss/MogDB 数据库的 sha256 密码认证方式 diff --git a/product/zh/docs-sca/v5.0/result.md b/product/zh/docs-sca/v5.0/result.md new file mode 100644 index 00000000..50666950 --- /dev/null +++ b/product/zh/docs-sca/v5.0/result.md @@ -0,0 +1,159 @@ +--- +title: SCA 结果说明 +summary: SCA 结果说明 +author: Hong Rihua +date: 2022-03-07 +--- + +# SCA 结果说明 + +SCA 结果分为两类: + +- **采集结果** : 源库(Oracle)中的数据采集结果,该结果会自动打包为一个 zip 文件,并在采集最后给出明确文件位置提示。 +- **分析结果** : 在目标 MogDB/openGauss 中执行完分析后生成的分析报告,报告为单独一个文件夹,其中为离线 HTML 格式的报告文档,可任意进行拷贝传阅。 + +## 采集结果 + +数据采集结果会自动打包成 zip 数据包,默认存储在程序当前目录下。 + +采集完成之后的结果提示信息如下: + +```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] | --------------------- ------------------------------ ---------- | +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 +``` + +## 分析报告 + +兼容性分析与 SQL 性能模拟均会生成对应的分析报告,分析报告默认位于指定的数据目录中,也可以使用 `-r` 选项指定报告的输出目录。 + +### 报告入口 + +分析报告目录中,`index.html` 为报告的入口,点击该文件,使用默认浏览器(推荐使用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 兼容度汇总 + +SQL 兼容度汇总页面展示本次兼容度分析的相关结果数据,页面表格中按照用户名,程序名,模块名汇总,展示系统中采集到的所有 SQL,以及这些 SQL 在 MogDB 中的支持情况。 + +注意: 不同数据库中,该表格展示的内容也略有差异。 + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-3.png) + +### SQL 改写规则 + +SQL 改写规则页面展示本次分析中涉及到的 SQL 改写相关的规则信息。 + +其中使用情况字段展示该条规则的触发情况: + +- Match 为规则在 SQL 中的命中数量 +- Count 为规则匹配的 SQL 数量 + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-4.png) + +### SQL 复杂度分布 + +SQL 复杂度分布页面展示采集到的 SQL 的复杂度分布情况。 +复杂度分布目前的评判标准如下: + +1. SQL 涉及的表的数量,表数量越多,复杂度越高 +2. SQL 中使用 connect by 语法的次数,使用 connect by 的次数越多,越有可能出现执行性能问题,对应 SQL 的复杂度越高 +3. SQL 中使用自定义函数的数量,自定义函数中的逻辑复杂度不明,所以使用自定义函数越多,SQL 复杂度越高 +4. SQL 在 Oracle 中的实际执行函数,执行耗时越高,则认为对应的 SQL 复杂度越高 + +最终每条 SQL 的复杂度则按照以上 4 个评判标准进行汇总。SQL 复杂度越高,在迁移后越需要关注 SQL 的执行性能,避免性能问题导致的业务故障。 + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-5.png) + +### SQL 性能对比(性能对比汇总) + +SQL 性能对比汇总页面展示两个信息: + +1. 性能对比的基础信息,性能对比的一些基础配置,以及对比时使用到的相关阈值设置 +2. SQL 性能汇总,按照总体,提升,下降,不支持,超时等维度对 SQL 进行汇总,分析各类 SQL 对整体负载的影响 + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-6.png) + +### SQL 性能对比(Top by Workload/SQL, Timeout) + +SQL 性能对比中 Top by Workload, Top by SQL, Timeout 等页面内容格式较为相似,以 Top by Workload 为例进行说明。 + +该列表展示影响最大的 100 条 SQL,其中 SQL FMS 字段为超链接,点击可进一步查看对应 SQL 的分析详情。 + +SQL 的性能影响有两个评估维度: + +1. SQL 影响: 当前 SQL 在单条 SQL 执行情况下的性能变化影响的比例 +2. 负载影响: 当前 SQL 参考其总执行次数,综合评估其对整个 SQL 负载的性能变化,以及对整体 SQL 性能的影响 + +![img](https://cdn-mogdb.enmotech.com/docs-media/sca/result-7.png) + +### SQL 性能对比(SQL 详情) + +SQL详情页面展示如下几个方面的内容: + +1. SQL 执行信息: SQL 在 Oracle 以及 MogDB 中的执行信息,其中 Oracle 中的执行信息来源于动态性能视图,MogDB 中的执行信息来源于实际 SQL 执行。 +2. SQL 文本: SQL 在 Oracle 中的执行文本,以及在 MogDB 中的实际执行文本。 +3. SQL 绑定变量: SQL 在 Oracle 中的绑定变量信息,该绑定变量信息会应用到 MogDB 中执行的 SQL 文本内,使其能在 MogDB 中真实的模拟业务执行。 +4. Oracle 执行计划: SQL 在 Oracle 中的执行计划,该执行计划来源于动态性能视图。 +5. MogDB 执行计划: SQL 在 MogDB 中的执行计划,该执行计划来源于实际执行,程序会自动对 MogDB 中的执行计划进行初步分析,标识出其中潜在的性能问题点。 +6. MogDB 对象信息: SQL 中涉及到的对象在 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) + +### 详细 SQL 支持列表 + +在报告的根目录中,`sql_detail_list.csv` 文件中记录了本次 SQL 兼容度评估涉及到的所有 SQL 的支持情况,以及部分 SQL 在评估过程中的自动化改写策略和改写后的 SQL 文本。 + +文件中的字段内容主要根据数据库的不同,略有差异。 + +#### Oracle + +1. schema_name: 执行 SQL 的 Schema 信息,在 Oracle 中一般对应于用户 +2. sql_type: SQL 类型,区分 MySQL 中采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND +3. module: 执行 SQL 语句的客户端 module +4. action: 执行 SQL 语句的客户端 action +5. mogdb_error: MogDB 中的 SQL 执行错误码 +6. mogdb_error_message: MogDB 中的 SQL 执行报错信息 +7. sql_text: 原始 SQL 文本 +8. transform_matched: SQL 满足的自动化改写规则 +9. sql_rewrite: 经过自动化改写后的 SQL 文本 + +#### MySQL + +1. schema_name: 执行 SQL 的 Schema 信息,在 MySQL 中一般对应于数据库 +2. sql_type: SQL 类型,区分 MySQL 中采集到的 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 执行错误码 +6. mogdb_error_message: MogDB 中的 SQL 执行报错信息 +7. sql_text: 原始 SQL 文本 +8. transform_matched: SQL 满足的自动化改写规则 +9. sql_rewrite: 经过自动化改写后的 SQL 文本 + +#### DB2 + +1. schema_name: 执行 SQL 的 Schema 信息 +2. sql_type: SQL 类型,区分 MySQL 中采集到的 SQL 是系统 SQL 还是用户的业务 SQL,取值为: USER, SYSTEM_CATALOG, SYSTEM_COMMAND +3. stmt_type: DB2 中记录的 SQL 语句类型 +4. mogdb_error: MogDB 中的 SQL 执行错误码 +5. mogdb_error_message: MogDB 中的 SQL 执行报错信息 +6. sql_text: 原始 SQL 文本 +7. transform_matched: SQL 满足的自动化改写规则 +8. sql_rewrite: 经过自动化改写后的 SQL 文本 diff --git a/product/zh/docs-sca/v5.0/toc.md b/product/zh/docs-sca/v5.0/toc.md new file mode 100644 index 00000000..ccad39a7 --- /dev/null +++ b/product/zh/docs-sca/v5.0/toc.md @@ -0,0 +1,15 @@ + + +# 文档 + +## SCA 文档目录 + ++ [简介](/overview.md) ++ [使用说明](/usage.md) ++ [命令选项](/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) diff --git a/product/zh/docs-sca/v5.0/usage.md b/product/zh/docs-sca/v5.0/usage.md new file mode 100644 index 00000000..12c956a7 --- /dev/null +++ b/product/zh/docs-sca/v5.0/usage.md @@ -0,0 +1,70 @@ +--- +title: SCA 使用说明 +summary: SCA 使用说明 +author: Hong Rihua +date: 2022-03-07 +--- + +# SCA 使用说明 + +## 部署步骤 + +程序已打包为二进制可执行文件,无需额外的部署操作。 + +程序文件上传后,确认能正常通过网络连接数据库即可直接使用。 + +## 常用命令 + +注意:以下以 x86-64 架构下的 Linux 系统为例进行说明,其他 ARM 平台或 MacOS 系统需要修改对应的命令名称。 + +* 申请 License (软件第一次运行的时候,需要先联机申请 License) + +```shell +# 运行过程中,需要输入用户邮箱 +# 申请到的 License 数据会发送到输入的邮箱中。 +# 将 License 数据拷贝出来,并写入 SCA 同目录中的 license.json 文件内即可 +./sca_linux_x86_64 -T L +``` + +* 初始化资料库 (对于同一个目标MogDB数据库,只在第一次运行时需要初始化资料库) + +```shell +./sca_macos_x86_64 -T i -H -P -N -U -E --user --password +``` + +* Oracle 数据采集 (无需资料库) + +```shell +# 作为测试用途,可添加如下参数加快 SQL 采集: -q 0.001 -Q 60 -m off +./sca_linux_x86_64 -T OC -s SCOTT -h -p -n -u -e +``` + +* 从指定 MySQL 慢日志采集 + +```shell +./sca_linux_x86_64 -T MC -d --slow-log= +``` + +* 从指定 MySQL 服务器进行自动采集 + +```shell +./sca_linux_x86_64 -T MC -d -h -p -n -u -e +``` + +* 进行 Oracle 兼容评估 (资料库已初始化,且资料库登录信息均为默认值) + +```shell +./sca_linux_x86_64 -T OI -d -n +``` + +* 只进行 SQL 模拟 (资料库已初始化,且资料库用户密码信息均为默认值) + +```shell +./sca_linux_x86_64 -T OS -h -p -n -d +``` + +* 同时进行SQL兼容度与性能评估 (资料库已初始化) + +```shell +./sca_linux_x86_64 -T OIS -h -p -n -u -e -d +``` -- Gitee