From 6cfc2a5a2d07c038f0e13e2a97e66adb89340be4 Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Mon, 14 Feb 2022 16:05:55 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9exporter=EF=BC=8Ccompat-t?= =?UTF-8?q?ools=E7=9B=B8=E5=85=B3=E6=8F=8F=E8=BF=B0=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96mogila=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...mogdb&opengauss-exporter-for-prometheus.md | 26 +- .../open-source-components/compat-tools.md | 410 +----------------- .../container-based-installation.md | 2 +- .../en/docs-mogdb/v2.1/quick-start/mogila.md | 14 +- product/en/docs-mogdb/v2.1/toc.md | 2 +- product/en/docs-mogdb/v2.1/toc_quickstart.md | 2 +- ...mogdb&opengauss-exporter-for-prometheus.md | 18 - .../open-source-components/compat-tools.md | 410 +----------------- .../container-based-installation.md | 4 +- .../zh/docs-mogdb/v2.1/quick-start/mogila.md | 14 +- product/zh/docs-mogdb/v2.1/toc.md | 2 +- product/zh/docs-mogdb/v2.1/toc_quickstart.md | 2 +- 12 files changed, 27 insertions(+), 879 deletions(-) diff --git a/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md b/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md index cc85c9aa..f2e2164f 100644 --- a/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md +++ b/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md @@ -17,17 +17,11 @@ Prometheus exporter for openGauss server metrics.
-## Limit - -- openGauss Password authentication method must be md5 - -
- ## Quick Start This package is available for Docker: -```bash +``` # Start an example database docker run --net=host -it --rm -e GS_PASSWORD=mtkOP@128 enmotech/opengauss # Connect to it @@ -38,23 +32,11 @@ docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localh ## Building and running -### github - -The default make file behavior is to build the binary: - -```bash -go get github.com/enmotech/opengauss_exporter -cd ${GOPATH-$HOME/go}/src/github.com/enmotech/opengauss_exporter -make build -export DATA_SOURCE_NAME="postgresql://login:password@hostname:port/dbname" -./bin/opengauss_exporter -``` - ### gitee The default make file behavior is to build the binary: -```bash +``` go get gitee.com/enmotech/opengauss_exporter cd ${GOPATH-$HOME/go}/src/gitee.com/enmotech/opengauss_exporter make build @@ -123,7 +105,7 @@ In addition, the option `--exclude-databases` adds the possibily to filter the r ### run test -```bash +``` make build cd test;sh test.sh ../bin/opengauss_exporter ``` @@ -140,7 +122,7 @@ grant select on pg_stat_replication to dbuser_monitor; ### primary and standby -```bash +``` docker network create opengauss_network --subnet=172.11.0.0/24 docker run --network opengauss_network --ip 172.11.0.101 \ --privileged=true --name opengauss_primary -h opengauss_primary -p 1111:5432 -d \ diff --git a/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md b/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md index 868e5e05..cf4fa7b6 100644 --- a/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md +++ b/product/en/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md @@ -7,14 +7,6 @@ date: 2021-07-14 # compat-tools -## How to Get the Component - - - -
- -## Introduction - This project is a set of compatibility tools. It aims to provide compatibility for necessary functions and system views created for OSs migrated from other asynchronous databases to MogDB, thereby facilitating the follow-up system maintenance and application modification. The script is executed based on the version information. When you execute the script, it will be executed in terms of the following three situations: @@ -23,404 +15,4 @@ The script is executed based on the version information. When you execute the sc 2. If the version of the object to be created is later than that of the object in the target database, the target database will be upgraded and has the object re-created. 3. If the version of the object to be created is earlier than that of the object in the target database, the creation operation will be skipped. -
- -## Software Architecture - -SQL file - -- runMe.sql: Total scheduling script -- Oracle_Views.sql: Compatible with Oracle database compatibility data dictionaries and views -- Oracle_Functions.sql: Compatible with Oracle database compatibility functions -- Oracle_Packages.sql: Compatible with Oracle database management packages -- MySQL_Views.sql: Compatible with MySQL database compatibility data dictionaries and views //TODO -- MySQL_Functions.sql: Compatible with MySQL database compatibility functions -- DB2_Functions.sql: DB2 database compatibility functions - -
- -## Usage Description - -Execute the SQL script in the MogDB database. - -> Note: All the following actions need to be executed in the directory where the current script is located. - -### Creating All Compatibility Objects - -Create all compatibility objects, including views, functions, management packages, and other objects. - -```bash -# Log in to the default database as a local user. -gsql -f runMe.sql - -# Detailed creation syntax: Pay attention to the test user's permission (the user needs to have the sysadmin permission). -gsql -h 127.0.0.1 -p 5432 -U test -d postgres -f runMe.sql -``` - -### Creating a Single Compatibility Object - -The following uses the Oracle compatibility view as an example. For other compatibility objects, the following method also applies. - -```bash -# Log in to the default database as a local user. -gsql -f Oracle_Views.sql - -# Detailed creation syntax: Pay attention to the test user's permission (the user needs to have the sysadmin permission). -gsql -h 127.0.0.1 -p 5432 -U test -d postgres -f Oracle_Views.sql -``` - -
- -## Results Description - -At the end of script execution, the following two types of content are automatically output. - -1. The compatibility objects involved in this script, and the corresponding operation contents - - ```bash - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: -- Compat Object List: - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: | type | name | version | language | operation | - gsql:Oracle_Functions.sql:1035: NOTICE: |-----------|--------------------------------------------------|---------|----------|---------------------| - gsql:Oracle_Functions.sql:1035: NOTICE: | function | months_between(timestamptz,timestamptz) | 2.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | sys_guid() | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | aggregate | wm_concat(text) | 1.0 | internal | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | nvl2(anyelement,anyelement,anyelement) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | trunc(timestamp,text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | trunc(timestamptz,text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | nanvl(numeric,numeric) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_substr(text,text,int4) | 2.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_substr(text,text,int4,int4,text,int4) | 2.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_instr(text,text,int4,int4,int4,text,int4) | 1.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_replace(text,text,text,int4,int4,text) | 1.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_count(text,text,int4,text) | 2.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | replace(text,text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | ora_hash(anyelement,int4,int4) | 1.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | show(text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | show_parameter(text) | 1.0 | sql | Skip due to version | - ``` - -2. Summary of the runs of the test cases built into this script - - Make sure that all test cases are up to date and that there are no test cases of type `FAILED`. - - ```bash - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: -- Function Test Result: - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: | result_type | case_count | start_time | complete_time | - gsql:Oracle_Functions.sql:1035: NOTICE: |-------------|------------|----------------------------|----------------------------| - gsql:Oracle_Functions.sql:1035: NOTICE: | PASSED | 387 | 2021-11-25 09:42:20.016619 | 2021-11-25 09:42:52.127892 | - gsql:Oracle_Functions.sql:1035: NOTICE: | NULL | 6 | 2021-11-25 09:42:20.016619 | 2021-11-25 09:42:20.016619 | - ``` - -### Query the Created Compatibility Objects and Versions - -```sql -select * from compat_tools.compat_version; -``` - -### Query Test Case Details - -```sql -select * from compat_tools.compat_testing; -``` - -
- -## Oracle Compatibility Views - -Oracle_Views.sql includes the following Oracle compatibility views: - -### Management Views: ALL_\*, DBA_\*, USER_\* - -> `ALL_` views are consistent with `DBA_` views, which are not verified with permission. In later versions, permission check will be performed. - -- [DBA,ALL,USER]_CATALOG -- [DBA,ALL,USER]_CONS_COLUMNS -- [DBA,ALL,USER]_CONSTRAINTS -- [DBA,ALL,USER]_DATA_FILES -- [DBA,ALL,USER]_DEPENDENCIES -- [DBA,ALL,USER]_IND_COLUMNS -- [DBA,ALL,USER]_IND_PARTITIONS -- [DBA,ALL,USER]_IND_STATISTICS -- [DBA,ALL,USER]_INDEX_USAGE -- [DBA,ALL,USER]_INDEXES -- [DBA,ALL,USER]_OBJECTS -- [DBA,ALL,USER]_PART_INDEXES -- [DBA,ALL,USER]_PART_TABLES -- [DBA,ALL,USER]_PROCEDURES -- [DBA,ALL,USER]_SEGMENTS -- [DBA,ALL,USER]_SEQUENCES -- [DBA,ALL,USER]_SOURCE -- [DBA,ALL,USER]_SYNONYMS -- [DBA,ALL,USER]_TAB_COL_STATISTICS -- [DBA,ALL,USER]_TAB_COLS -- [DBA,ALL,USER]_TAB_COLUMNS -- [DBA,ALL,USER]_TAB_COMMENTS -- [DBA,ALL,USER]_TAB_MODIFICATIONS -- [DBA,ALL,USER]_TAB_PARTITIONS -- [DBA,ALL,USER]_TAB_STATISTICS -- [DBA,ALL,USER]_TABLES -- [DBA,ALL,USER]_TABLESPACES -- [DBA,ALL,USER]_TRIGGER_COLS -- [DBA,ALL,USER]_TRIGGERS -- [DBA,ALL,USER]_TYPES -- [DBA,ALL,USER]_VIEWS -- [DBA,ALL,USER]_JOBS -- [DBA,ALL,USER]_JOBS_RUNNING -- [DBA,ALL]_USERS -- DBA_SOURCE_ALL -- NLS_DATABASE_PARAMETERS -- NLS_INSTANCE_PARAMETERS -- NLS_SESSION_PARAMETERS - -### Other Short-Name Views - -- DICTIONARY -- DICT -- COLS -- IND -- OBJ -- TAB -- DUAL (For 2.0 and above) - -### Dynamic Performance Views: GV,V - -- [GV,V]$DATAFILE -- [GV,V]$LOCK -- [GV,V]$PARAMETER -- [GV,V]$PARAMETER_VALID_VALUES -- [GV,V]$SESSION -- [GV,V]$SESSTAT -- [GV,V]$SPPARAMETER -- [GV,V]$SYSSTAT -- [GV,V]$TABLESPACE -- [GV,V]$VERSION -- [GV,V]$NLS_PARAMETERS -- [GV,V]$NLS_VALID_VALUES - -### Views of Unified Permission Query - -- DBA_DETAIL_PRIVILEGES -- DBA_ALL_PRIVILEGES -- DBA_ALL_PRIVILEGES_SQL - -
- -## Oracle Compatibility Functions - -### Character Functions - -- regexp_substr(text,text,int4) -- regexp_substr(text,text,int4,int4,text,int4) -- Note: The **p_subexpr** parameter is not supported. -- regexp_instr(text,text,int4,int4,text,int4) -- regexp_replace(text,text,text,int4,int4,text) -- regexp_count(text,text,int4,text) -- replace(text,text) - -### Time Functions - -- months_between(timestamp, timestamp) -- trunc(timestamp, text) -- trunc(timestamptz, text) -- round(timestamptz,text) - -### Number Functions - -- nanvl(numeric,numeric) - -### Aggregate Functions - -- wm_concat(text) - -### NULL-Related Functions - -- nullif(anyelement, anyelement) -- nvl2(anyelement, anyelement, anyelement) - -### Other Functions - -- sys_guid() -- ora_hash(anyelement,bigint,bigint) -- show(text) - provides functions similar to "show xxx" in Oracle for viewing related parameters. -- show_parameter(text) - provides functions as show(text) -- dump(anynonarray) - -
- -## Oracle Management Packages - -### DBMS_METADATA - -- get_ddl(object_type, object_name, schema_name) - -### DBMS_OUTPUT - -- enable(size) -- disable() -- get_line(line, status) -- get_lines(lines, numlines) -- new_line() -- put(text) -- put_line(text) - -### DBMS_RANDOM - -- initialize(int4) -- deprecated in Oracle -- normal() -- random() -- deprecated in Oracle -- seed(int4) -- seed(text) -- string(char,int4) -- terminate() -- deprecated in Oracle -- value() -- value(numeric,numeric) - -For details about how to use DBMS_RANDOM to generate random data (number, string, and date), see [DBMS_RANDOM](DBMS-RANDOM). - -### DBMS_JOB - -- broken(int8,bool,timestamp) -- change(int8,text,timestamp,text,int4,bool) -- instance(int8,int4,bool) -- interval(int8,text) -- next_date(int8,timestamp) -- remove(int8) -- run(int8,bool) -- submit(int8,text,timestamp,text,bool,int4,bool) -- user_export(int8,text) -- what(int8,text) - -
- -## MySQL Compatibility Functions - -### NULL-Related Functions - -> Note: The effect of **ifnull** is equivalent to the general function **coalesce**. If conditions allow, it is recommended to modify SQL to use the **coalesce** function, which is supported in almost all databases. - -- ifnull(text,text) -- ifnull(numeric,numeric) -- ifnull(timestamp,timestamp) -- ifnull(timestamptz,timestamptz) -- isnull(text) -- Note: If the default **A** compatibility mode is used when creating the database in MogDB, then the **''** empty string will also be recognized as a **NULL** value -- isnull(numeric) -- isnull(timestamptz) - -### Condition Control Functions - -- if(bool,text,text) -- if(bool,numeric,numeric) -- if(bool,timestamptz,timestamptz) - -### Character Functions - -- find_in_set(text,text) -- find_in_set(text,text[]) -- field(text,text[]) -- elt(int4,text[]) -- strcmp(text,text) -- insert(text,int8,int8,text) -- lcase(text) -- ucase(text) -- space(int4) -- mid(text,int8,int8) -- locate(text,text,int4) -- to_base64(text) -- from_base64(text) - -### Numerical Functions - -- field(numeric,numeric[]) -- log10(numeric) -- log10(float8) -- rand(int4) - -### Time Functions - -- unix_timestamp(timestamp) -- unix_timestamp(timestamptz) -- from_unixtime(int8) -- from_unixtime(numeric) -- from_unixtime(numeric,text) -- to_days(timestamp) -- to_seconds(timestamp) -- to_seconds(timestamptz) -- timediff(timestamptz,timestamptz) -- time_to_sec(time) -- sec_to_time(int4) -- date_format(timestamp, text) -- date_format(timestamptz, text) -- timestampdiff(text,timestamptz,timestamptz) -- Note: The Schema prefixed with **pg_catalog.** must be used, and the first unit parameter must be wrapped in single quotes -- str_to_date(text,text) -- Due to the difference in time types between MySQL and MogDB, this compatible function is not completely compatible. For details, please refer to the use case description section at the end of the corresponding function. - -### Other Functions - -- uuid() -- Provide hash calculation uuid based on random value + timestamp -- uuid_to_bin(uuid, int4) -- bin_to_uuid(bytea, int4) - -
- -## DB2 Compatibility Functions - -### NULL-Related Functions - -> Note: The effect of **value** is equivalent to the general function **coalesce**. If conditions allow, it is recommended to modify SQL to use the **coalesce** function, which is supported in almost all databases. - -- value(text,text) -- value(numeric,numeric) -- value(timestamp,timestamp) -- value(timestamptz,timestamptz) - -### Character Functions - -- posstr(text,text) -- locate_in_string(text,text,int4,int4,text) -- regexp_match_count(text,text,int4,text,text) - -### Time Functions - -- year (text) -- year (timestamptz) -- year (interval) -- month (text) -- month (timestamptz) -- month (interval) -- quarter (timestamptz) -- week (timestamptz) -- day (text) -- day (timestamptz) -- day (interval) -- hour (text) -- hour (timestamptz) -- hour (interval) -- minute (text) -- minute (timestamptz) -- minute (interval) -- second (text) -- second (timestamptz) -- second (interval) -- days (timestamptz) -- dayofyear (timestamptz) -- dayofweek (timestamptz) -- dayofweek_iso (timestamptz) -- dayname (timestamptz) -- monthname (timestamptz) -- midnight_seconds (timestamptz) -- next_day (timestamptz,text,text) -- next_month (timestamptz) -- next_quarter (timestamptz) -- next_week (timestamptz) -- next_year (timestamptz) -- last_day (timestamptz) -- first_day (timestamptz) -- this_month (timestamptz) -- this_quarter (timestamptz) -- this_week (timestamptz) -- this_year (timestamptz) -- days_between (timestamptz,timestamptz) -- years_between (timestamptz,timestamptz) -- ymd_between (timestamptz,timestamptz) +Please refer to [compat-tools repository page](https://gitee.com/enmotech/compat-tools) for details on how to obtain and use component. 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 4c5e639f..fef49cd8 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 @@ -189,7 +189,7 @@ MogDB=#\dt MogDB=# ``` -For detailed introduction and query example of mogila sample dataset, please refer to [sample dataset: Mogila](mogila). +For detailed introduction and query example of mogila sample dataset, please refer to [Using Sample Dataset Mogila](mogila).
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 678da5ad..1c58de7e 100644 --- a/product/en/docs-mogdb/v2.1/quick-start/mogila.md +++ b/product/en/docs-mogdb/v2.1/quick-start/mogila.md @@ -1,13 +1,13 @@ --- -title: Sample Dataset Mogila -summary: Sample Dataset Mogila +title: Using Sample Dataset Mogila +summary: Using Sample Dataset Mogila author: Guo Huan date: 2022-02-11 --- -# Sample Dataset: Mogila +# Using Sample Dataset Mogila MogDB provides a sample dataset Mogila, which is a database representing a DVD rental store (remember those?!), containing information about films (like title, category, actresses), rental stores (like address, staff members, customers) and rentals @@ -53,7 +53,7 @@ The image below shows an overview of the Mogila database tables and views. Here 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. - + mogila=# \dt List of relations Schema | Name | Type | Owner | Storage @@ -74,7 +74,7 @@ The image below shows an overview of the Mogila database tables and views. Here public | staff | table | mogdb | {orientation=row,compression=no} public | store | table | mogdb | {orientation=row,compression=no} (15 rows) - + mogila=# ``` @@ -133,7 +133,7 @@ The image below shows an overview of the Mogila database tables and views. Here 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. - + mogila=# \dt List of relations Schema | Name | Type | Owner | Storage @@ -154,7 +154,7 @@ The image below shows an overview of the Mogila database tables and views. Here public | staff | table | mogdb | {orientation=row,compression=no} public | store | table | mogdb | {orientation=row,compression=no} (15 rows) - + mogila=# ``` diff --git a/product/en/docs-mogdb/v2.1/toc.md b/product/en/docs-mogdb/v2.1/toc.md index f01e3beb..7001bf96 100644 --- a/product/en/docs-mogdb/v2.1/toc.md +++ b/product/en/docs-mogdb/v2.1/toc.md @@ -32,7 +32,7 @@ + Use Middleware to Access MogDB + [Use WebLogic to Configure MogDB Data Sources](/quick-start/mogdb-access/use-middleware-to-access-mogdb/weblogic-configures-mogdb(postgresql)-data-source-reference.md) + [Use WebSphere to Configure MogDB Data Sources](/quick-start/mogdb-access/use-middleware-to-access-mogdb/websphere-configures-mogdb(postgresql)-data-source-reference.md) - + [Sample Dataset: Mogila](/quick-start/mogila.md) + + [Using Sample Dataset Mogila](/quick-start/mogila.md) + Installation Guide + [Container Installation](/installation-guide/docker-installation/docker-installation.md) + Simplified Installation Process diff --git a/product/en/docs-mogdb/v2.1/toc_quickstart.md b/product/en/docs-mogdb/v2.1/toc_quickstart.md index 8611ae4e..b67333a9 100644 --- a/product/en/docs-mogdb/v2.1/toc_quickstart.md +++ b/product/en/docs-mogdb/v2.1/toc_quickstart.md @@ -12,4 +12,4 @@ + Use Middleware to Access MogDB + [Use WebLogic to Configure MogDB Data Sources](/quick-start/mogdb-access/use-middleware-to-access-mogdb/weblogic-configures-mogdb(postgresql)-data-source-reference.md) + [Use WebSphere to Configure MogDB Data Sources](/quick-start/mogdb-access/use-middleware-to-access-mogdb/websphere-configures-mogdb(postgresql)-data-source-reference.md) -+ [Sample Dataset: Mogila](/quick-start/mogila.md) ++ [Using Sample Dataset Mogila](/quick-start/mogila.md) diff --git a/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md b/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md index 9ef02c10..82c8b64e 100644 --- a/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md +++ b/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/4-mogdb&opengauss-exporter-for-prometheus.md @@ -17,12 +17,6 @@ date: 2021-06-02
-## 限制 - -- openGauss密码认证方式必须为md5 - -
- ## 快速开始 本软件包适用于Docker: @@ -38,18 +32,6 @@ docker run --net=host -e DATA_SOURCE_NAME="postgresql://postgres:password@localh ## 构建及运行 -### github - -make命令默认构建二进制文件: - -``` -$ go get github.com/enmotech/opengauss_exporter -$ cd ${GOPATH-$HOME/go}/src/github.com/enmotech/opengauss_exporter -$ make build -$ export DATA_SOURCE_NAME="postgresql://login:password@hostname:port/dbname" -$ ./bin/opengauss_exporter -``` - ### gitee make命令默认构建二进制文件: diff --git a/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md b/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md index 09124ff8..47608323 100644 --- a/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md +++ b/product/zh/docs-mogdb/v2.1/about-mogdb/open-source-components/compat-tools.md @@ -7,14 +7,6 @@ date: 2021-07-14 # compat-tools -## 组件获取 - - - -
- -## 介绍 - 本项目是一个兼容工具集合,旨在为从其他异构数据库,迁移到 MogDB 之后的系统,创建必要的函数,以及系统视图的兼容。为后续的系统运维与应用改造提供便利。 脚本中带有版本控制,直接运行脚本时,会根据如下三种情况进行处理: @@ -23,404 +15,4 @@ date: 2021-07-14 2. 若待创建对象版本高于目标数据库中的对象版本,则进行升级重建 3. 若待创建对象版本不高于目标数据库中的对象版本,则跳过创建 -
- -## 软件架构 - -SQL文件: - -* runMe.sql: 总调度脚本 -* Oracle_Views.sql: Oracle数据库兼容性数据字典及视图 -* Oracle_Functions.sql: Oracle数据库兼容性函数 -* Oracle_Packages.sql: Oracle数据库管理包兼容 -* MySQL_Views.sql: MySQL数据库兼容性数据字典及视图 //TODO -* MySQL_Functions.sql: MySQL数据库兼容性函数 -* DB2_Functions.sql: DB2数据库兼容性函数 - -
- -## 使用说明 - -直接在MogDB数据库中执行sql文本。 - -> 注意:以下所有操作需要在当前脚本所在的目录中执行。 - -### 创建所有兼容性对象 - -创建所有兼容性对象,包括:视图,函数,管理包等。 - -``` -# 本地用户,默认库登录 -gsql -f runMe.sql - -# 详细创建语法,注意 test 用户权限(需要具有 sysadmin 权限) -gsql -h 127.0.0.1 -p 5432 -U test -d postgres -f runMe.sql -``` - -### 创建单一类兼容对象 - -以下以 Oracle 兼容性视图为例,其他兼容性对象脚本,也可以以此方式创建。 - -``` -# 本地用户,默认库登录 -gsql -f Oracle_Views.sql - -# 详细创建语法,注意 test 用户权限(需要具有 sysadmin 权限) -gsql -h 127.0.0.1 -p 5432 -U test -d postgres -f Oracle_Views.sql -``` - -
- -## 结果说明 - -脚本运行结束后,会自动输出以下两类内容: - -1. 本次脚本中涉及到的兼容对象,以及对应的操作内容 - - ``` - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: -- Compat Object List: - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: | type | name | version | language | operation | - gsql:Oracle_Functions.sql:1035: NOTICE: |-----------|--------------------------------------------------|---------|----------|---------------------| - gsql:Oracle_Functions.sql:1035: NOTICE: | function | months_between(timestamptz,timestamptz) | 2.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | sys_guid() | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | aggregate | wm_concat(text) | 1.0 | internal | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | nvl2(anyelement,anyelement,anyelement) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | trunc(timestamp,text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | trunc(timestamptz,text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | nanvl(numeric,numeric) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_substr(text,text,int4) | 2.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_substr(text,text,int4,int4,text,int4) | 2.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_instr(text,text,int4,int4,int4,text,int4) | 1.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_replace(text,text,text,int4,int4,text) | 1.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | regexp_count(text,text,int4,text) | 2.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | replace(text,text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | ora_hash(anyelement,int4,int4) | 1.0 | plpgsql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | show(text) | 1.0 | sql | Skip due to version | - gsql:Oracle_Functions.sql:1035: NOTICE: | function | show_parameter(text) | 1.0 | sql | Skip due to version | - ``` - -2. 本次脚本中内置的测试用例的运行汇总 - - 确认所有测试用例都是最新执行,并且没有类型为 `FAILED` 的测试用例即可。 - - ``` - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: -- Function Test Result: - gsql:Oracle_Functions.sql:1035: NOTICE: -- ===================================================================== - gsql:Oracle_Functions.sql:1035: NOTICE: | result_type | case_count | start_time | complete_time | - gsql:Oracle_Functions.sql:1035: NOTICE: |-------------|------------|----------------------------|----------------------------| - gsql:Oracle_Functions.sql:1035: NOTICE: | PASSED | 387 | 2021-11-25 09:42:20.016619 | 2021-11-25 09:42:52.127892 | - gsql:Oracle_Functions.sql:1035: NOTICE: | NULL | 6 | 2021-11-25 09:42:20.016619 | 2021-11-25 09:42:20.016619 | - ``` - -### 查询已创建的兼容对象及版本 - -```sql -select * from compat_tools.compat_version; -``` - -### 查询测试用例详情 - -```sql -select * from compat_tools.compat_testing; -``` - -
- -## Oracle 兼容视图 - -Oracle_Views.sql 包含如下几类 Oracle 兼容性视图: - -### 管理视图: ALL_\*, DBA_\*, USER_\* - -> `ALL_` 视图当前与 `DBA_` 视图一致,并未做权限检验,后期版本将会考虑权限校验。 - -* [DBA,ALL,USER]_CATALOG -* [DBA,ALL,USER]_CONS_COLUMNS -* [DBA,ALL,USER]_CONSTRAINTS -* [DBA,ALL,USER]_DATA_FILES -* [DBA,ALL,USER]_DEPENDENCIES -* [DBA,ALL,USER]_IND_COLUMNS -* [DBA,ALL,USER]_IND_PARTITIONS -* [DBA,ALL,USER]_IND_STATISTICS -* [DBA,ALL,USER]_INDEX_USAGE -* [DBA,ALL,USER]_INDEXES -* [DBA,ALL,USER]_OBJECTS -* [DBA,ALL,USER]_PART_INDEXES -* [DBA,ALL,USER]_PART_TABLES -* [DBA,ALL,USER]_PROCEDURES -* [DBA,ALL,USER]_SEGMENTS -* [DBA,ALL,USER]_SEQUENCES -* [DBA,ALL,USER]_SOURCE -* [DBA,ALL,USER]_SYNONYMS -* [DBA,ALL,USER]_TAB_COL_STATISTICS -* [DBA,ALL,USER]_TAB_COLS -* [DBA,ALL,USER]_TAB_COLUMNS -* [DBA,ALL,USER]_TAB_COMMENTS -* [DBA,ALL,USER]_TAB_MODIFICATIONS -* [DBA,ALL,USER]_TAB_PARTITIONS -* [DBA,ALL,USER]_TAB_STATISTICS -* [DBA,ALL,USER]_TABLES -* [DBA,ALL,USER]_TABLESPACES -* [DBA,ALL,USER]_TRIGGER_COLS -* [DBA,ALL,USER]_TRIGGERS -* [DBA,ALL,USER]_TYPES -* [DBA,ALL,USER]_VIEWS -* [DBA,ALL,USER]_JOBS -* [DBA,ALL,USER]_JOBS_RUNNING -* [DBA,ALL]_USERS -* DBA_SOURCE_ALL -* NLS_DATABASE_PARAMETERS -* NLS_INSTANCE_PARAMETERS -* NLS_SESSION_PARAMETERS - -### 其他短名称视图 - -* DICTIONARY -* DICT -* COLS -* IND -* OBJ -* TAB -* DUAL (For 2.0 and above) - -### 动态性能视图: GV,V - -* [GV,V]$DATAFILE -* [GV,V]$LOCK -* [GV,V]$PARAMETER -* [GV,V]$PARAMETER_VALID_VALUES -* [GV,V]$SESSION -* [GV,V]$SESSTAT -* [GV,V]$SPPARAMETER -* [GV,V]$SYSSTAT -* [GV,V]$TABLESPACE -* [GV,V]$VERSION -* [GV,V]$NLS_PARAMETERS -* [GV,V]$NLS_VALID_VALUES - -### 权限统一查询视图 - -* DBA_DETAIL_PRIVILEGES -* DBA_ALL_PRIVILEGES -* DBA_ALL_PRIVILEGES_SQL - -
- -## Oracle 兼容函数 - -### 字符函数 - -* regexp_substr(text,text,int4) -* regexp_substr(text,text,int4,int4,text,int4) -- 注意: 最后一个参数 p_subexpr 不支持 -* regexp_instr(text,text,int4,int4,text,int4) -* regexp_replace(text,text,text,int4,int4,text) -* regexp_count(text,text,int4,text) -* replace(text,text) - -### 时间函数 - -* months_between(timestamp, timestamp) -* trunc(timestamp, text) -* trunc(timestamptz, text) -* round(timestamptz,text) - -### 数字函数 - -* nanvl(numeric,numeric) - -### 聚合函数 - -* wm_concat(text) - -### NULL 值相关函数 - -* nullif(anyelement, anyelement) -* nvl2(anyelement, anyelement, anyelement) - -### 其他函数 - -* sys_guid() -* ora_hash(anyelement,bigint,bigint) -* show(text) -- 提供类似 Oracle 中 show xxx 查看相关参数的功能 -* show_parameter(text) -- 等同于 show(text) -* dump(anynonarray) - -
- -## Oracle 管理包 - -### DBMS_METADATA - -* get_ddl(object_type, object_name, schema_name) - -### DBMS_OUTPUT - -* enable(size) -* disable() -* get_line(line, status) -* get_lines(lines, numlines) -* new_line() -* put(text) -* put_line(text) - -### DBMS_RANDOM - -* initialize(int4) -- deprecated in Oracle -* normal() -* random() -- deprecated in Oracle -* seed(int4) -* seed(text) -* string(char,int4) -* terminate() -- deprecated in Oracle -* value() -* value(numeric,numeric) - -关于如何使用DBMS_RANDOM在MogDB数据库中生成随机数(数字、字符串和日期),请参见[DBMS_RANDOM](DBMS-RANDOM)。 - -### DBMS_JOB - -- broken(int8,bool,timestamp) -- change(int8,text,timestamp,text,int4,bool) -- instance(int8,int4,bool) -- interval(int8,text) -- next_date(int8,timestamp) -- remove(int8) -- run(int8,bool) -- submit(int8,text,timestamp,text,bool,int4,bool) -- user_export(int8,text) -- what(int8,text) - -
- -## MySQL 兼容函数 - -### NULL 相关函数 - -> 注意: ifnull 效果等同于通用函数 coalesce,在条件允许的情况下,建议修改 SQL 使用 coalesce 函数,该函数几乎在各个数据库中均支持 - -- ifnull(text,text) -- ifnull(numeric,numeric) -- ifnull(timestamp,timestamp) -- ifnull(timestamptz,timestamptz) -- isnull(text) -- 注意: MogDB 中如果创建数据库时,使用默认的 A 兼容模式,那么 '' 空字符串也会被识别为 NULL 值 -- isnull(numeric) -- isnull(timestamptz) - -### 条件控制函数 - -- if(bool,text,text) -- if(bool,numeric,numeric) -- if(bool,timestamptz,timestamptz) - -### 字符函数 - -- find_in_set(text,text) -- find_in_set(text,text[]) -- field(text,text[]) -- elt(int4,text[]) -- strcmp(text,text) -- insert(text,int8,int8,text) -- lcase(text) -- ucase(text) -- space(int4) -- mid(text,int8,int8) -- locate(text,text,int4) -- to_base64(text) -- from_base64(text) - -### 数字函数 - -- field(numeric,numeric[]) -- log10(numeric) -- log10(float8) -- rand(int4) - -### 时间函数 - -- unix_timestamp(timestamp) -- unix_timestamp(timestamptz) -- from_unixtime(int8) -- from_unixtime(numeric) -- from_unixtime(numeric,text) -- to_days(timestamp) -- to_seconds(timestamp) -- to_seconds(timestamptz) -- timediff(timestamptz,timestamptz) -- time_to_sec(time) -- sec_to_time(int4) -- date_format(timestamp, text) -- date_format(timestamptz, text) -- timestampdiff(text,timestamptz,timestamptz) -- 注意: 使用必须带 pg_catalog. 前缀Schema,第一个单位参数必须使用单引号包裹 -- str_to_date(text,text) -- 由于 MySQL 与 MogDB 中时间类型的差异,本兼容函数并非完全一致性的兼容,详细请查阅对应函数尾部的用例描述部分 - -### 其他函数 - -- uuid() -- 提供基于 随机值+时间戳 的哈希计算 uuid -- uuid_to_bin(uuid, int4) -- bin_to_uuid(bytea, int4) - -
- -## DB2 兼容函数 - -### NULL 相关函数 - -> 注意: value 效果等同于通用函数 coalesce,在条件允许的情况下,建议修改 SQL 使用 coalesce 函数,该函数几乎在各个数据库中均支持 - -- value(text,text) -- value(numeric,numeric) -- value(timestamp,timestamp) -- value(timestamptz,timestamptz) - -### 字符函数 - -- posstr(text,text) -- locate_in_string(text,text,int4,int4,text) -- regexp_match_count(text,text,int4,text,text) - -### 时间函数 - -- year (text) -- year (timestamptz) -- year (interval) -- month (text) -- month (timestamptz) -- month (interval) -- quarter (timestamptz) -- week (timestamptz) -- day (text) -- day (timestamptz) -- day (interval) -- hour (text) -- hour (timestamptz) -- hour (interval) -- minute (text) -- minute (timestamptz) -- minute (interval) -- second (text) -- second (timestamptz) -- second (interval) -- days (timestamptz) -- dayofyear (timestamptz) -- dayofweek (timestamptz) -- dayofweek_iso (timestamptz) -- dayname (timestamptz) -- monthname (timestamptz) -- midnight_seconds (timestamptz) -- next_day (timestamptz,text,text) -- next_month (timestamptz) -- next_quarter (timestamptz) -- next_week (timestamptz) -- next_year (timestamptz) -- last_day (timestamptz) -- first_day (timestamptz) -- this_month (timestamptz) -- this_quarter (timestamptz) -- this_week (timestamptz) -- this_year (timestamptz) -- days_between (timestamptz,timestamptz) -- years_between (timestamptz,timestamptz) -- ymd_between (timestamptz,timestamptz) +组件获取及使用方法详见[compat-tools仓库页面](https://gitee.com/enmotech/compat-tools)。 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 77e57322..c2ff5a1e 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,7 +148,7 @@ MogDB的密码有复杂度要求,密码长度8个字符以上,必须同时
-## Mogila样本数据库 +## Mogila样本数据集 MogDB容器版内置了一个样本数据库mogila,该数据库是一个关于DVD出租店信息的数据库,包含有关电影(如标题、类别、女演员)、出租店(如地址、工作人员、客户)和出租的信息,其中一位顾客通过店员从一家商店租了一部影片。安装完MogDB容器版之后,您可以使用mogila数据库进行各种功能测试。 @@ -185,7 +185,7 @@ MogDB=#\dt MogDB=# ``` -有关mogila样本数据库的详细介绍及查询示例,请参考[样本数据库:Mogila](mogila)。 +有关mogila样本数据集的详细介绍及查询示例,请参考[使用样本数据库集Mogila](mogila)。
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 62990570..ee7598ef 100644 --- a/product/zh/docs-mogdb/v2.1/quick-start/mogila.md +++ b/product/zh/docs-mogdb/v2.1/quick-start/mogila.md @@ -1,13 +1,13 @@ --- -title: 样本数据库:Mogila -summary: 样本数据库:Mogila +title: 使用样本数据集Mogila +summary: 使用样本数据集Mogila author: Guo Huan date: 2022-01-20 --- -# 样本数据库:Mogila +# 使用样本数据集Mogila MogDB提供了一个样本数据库Mogila,该数据库是一个关于DVD出租店信息的数据库,包含有关电影(如标题、类别、女演员)、出租店(如地址、工作人员、客户)和出租的信息。您可以使用Mogila数据库进行各种功能测试。 @@ -52,7 +52,7 @@ Mogila适用于MogDB 2.1.0及更高版本。 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. - + mogila=# \dt List of relations Schema | Name | Type | Owner | Storage @@ -73,7 +73,7 @@ Mogila适用于MogDB 2.1.0及更高版本。 public | staff | table | mogdb | {orientation=row,compression=no} public | store | table | mogdb | {orientation=row,compression=no} (15 rows) - + mogila=# ``` @@ -132,7 +132,7 @@ Mogila适用于MogDB 2.1.0及更高版本。 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. - + mogila=# \dt List of relations Schema | Name | Type | Owner | Storage @@ -153,7 +153,7 @@ Mogila适用于MogDB 2.1.0及更高版本。 public | staff | table | mogdb | {orientation=row,compression=no} public | store | table | mogdb | {orientation=row,compression=no} (15 rows) - + mogila=# ``` diff --git a/product/zh/docs-mogdb/v2.1/toc.md b/product/zh/docs-mogdb/v2.1/toc.md index 60d326f5..298c2a00 100644 --- a/product/zh/docs-mogdb/v2.1/toc.md +++ b/product/zh/docs-mogdb/v2.1/toc.md @@ -32,7 +32,7 @@ + 使用中间件访问MogDB + [WebLogic配置MogDB数据源参考](/quick-start/mogdb-access/use-middleware-to-access-mogdb/weblogic-configures-mogdb(postgresql)-data-source-reference.md) + [WebSphere配置MogDB数据源参考](/quick-start/mogdb-access/use-middleware-to-access-mogdb/websphere-configures-mogdb(postgresql)-data-source-reference.md) - + [样本数据库:Mogila](/quick-start/mogila.md) + + [使用样本数据集Mogila](/quick-start/mogila.md) + 安装指南 + [容器化安装](/installation-guide/docker-installation/docker-installation.md) + 极简安装 diff --git a/product/zh/docs-mogdb/v2.1/toc_quickstart.md b/product/zh/docs-mogdb/v2.1/toc_quickstart.md index de3366a8..3e02d63e 100644 --- a/product/zh/docs-mogdb/v2.1/toc_quickstart.md +++ b/product/zh/docs-mogdb/v2.1/toc_quickstart.md @@ -12,4 +12,4 @@ + 使用中间件访问MogDB + [WebLogic配置MogDB数据源参考](/quick-start/mogdb-access/use-middleware-to-access-mogdb/weblogic-configures-mogdb(postgresql)-data-source-reference.md) + [WebSphere配置MogDB数据源参考](/quick-start/mogdb-access/use-middleware-to-access-mogdb/websphere-configures-mogdb(postgresql)-data-source-reference.md) -+ [样本数据库:Mogila](/quick-start/mogila.md) \ No newline at end of file ++ [使用样本数据集Mogila](/quick-start/mogila.md) \ No newline at end of file -- Gitee From 5926bceb876cbbcdd90f7a54e15f4bf2554fac2b Mon Sep 17 00:00:00 2001 From: spaceoddity91719 Date: Mon, 14 Feb 2022 16:34:49 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=BA=90=E7=A0=81?= =?UTF-8?q?=E8=A7=A3=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- product/en/docs-mogdb/v2.1/source-code-parsing.md | 2 ++ product/zh/docs-mogdb/v2.1/source-code-parsing.md | 2 ++ 2 files changed, 4 insertions(+) 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 1efbcbd2..61707aad 100644 --- a/product/en/docs-mogdb/v2.1/source-code-parsing.md +++ b/product/en/docs-mogdb/v2.1/source-code-parsing.md @@ -60,3 +60,5 @@ You can click the links below to view this series of articles. [openGauss database source code parsing series of articles - AI Technology (Part 3): Index Recommendation](https://www.modb.pro/db/210235) [openGauss database source code parsing series of articles - AI Technology (Part 4): Metrics Collection, Prediction, and Anomaly Detection](https://www.modb.pro/db/245341) + +[openGauss database source code parsing series of articles - AI Technology (Part 5): AI Query Time Prediction](https://www.modb.pro/db/251405) \ No newline at end of file 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 ad49e859..9a403378 100644 --- a/product/zh/docs-mogdb/v2.1/source-code-parsing.md +++ b/product/zh/docs-mogdb/v2.1/source-code-parsing.md @@ -60,3 +60,5 @@ date: 2022-02-07 [openGauss数据库源码解析系列文章——AI技术(三):智能索引推荐](https://www.modb.pro/db/210235) [openGauss数据库源码解析系列文章——AI技术(四):指标采集、预测与异常检测](https://www.modb.pro/db/245341) + +[openGauss数据库源码解析系列文章——AI技术(五):AI查询时间预测](https://www.modb.pro/db/251405) \ No newline at end of file -- Gitee