Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
### MDBExtractor

**Prerequisites**

- The source MongoDB instance needs to be up and running.

- To extract data from traditional MongoDB log file, enable logging --
the so-called slow operations at the MongoDB instance level - by
executing the following command *db.setProfilingLevel(0, -1)*

- To extract data from db.system.profile collection or its dump file,
enable traditional profiling, by executing the following command
*db.setProfilingLevel(2*)

- The configuration file \$MR_CONFIG_DIR/MDBExtractConfig.json with the
required parameter settings is created.

**Configuration File:**

{

\"OUTPUT_DIR\" : \"\<name and location of the output file\>\",

\"INPUT_FILE\" : \"\<name and location of the input file\>\"
\"COMMANDS_LOGGING\" : \"\<true\|false\>\",

\"INCLUDE_DATABASES\" : \<list of databases\>,

\"INCLUDE_COMMANDS\" : \<commands\>,

\"EXCLUDE_COMMANDS\" : \<commands\>,

\"EXECUTION_PLAN_TRACING\" : \<level of details\>,

\"OUTPUT_MODE\" : \"\<output format\>\"

}

- **OUTPUT_DIR** (default: standard output) defines the directory of the
output files.

<!-- -->

- **INPUT_FILE** (default: standard input) defines the input log file
generated by a MongoDB Instance with profiling enabled.

- **COMMANDS_LOGGING** (default:  \"true\") defines the commands that
will be reported.  If \"false\", only commands will be reported.\
If set to \"true\", every command found by the extractor will be
additional logged in console.log used for mongosh script generation.

- **INCLUDE_DATABASES** provides a list of databases in a JSON array,
which will be traced. This parameter cannot be used simultaneously
with EXCLUDE_DATABASES

- **EXCLUDE_DATABASES** provides a list of databases in a JSON array,
which will NOT be traced. This parameter cannot be used simulateously
with INCLUDE_DATABASES

<!-- -->

- **INCLUDE_COMMANDS** provides a JSON array with the list of commands,
which will be extracted.

- **EXCLUDE_COMMANDS** provides a JSON array with the list of commands,
which will be ignored.

- **EXECUTION_PLAN_TRACING** provides explain() commands, if set to a
non-zero value. Otherwise only runCommand will be provided in the
output.

- **OUTPUT_MODE** defines the output format. If set to JSON, the output
will be formatted in sequence of JSON documents. If set to SCRIPT, the
output is formatted in NodeJS script, which can be consumed by
mongosh.

**MDBApplier**

**Prerequisites**

- The target Oracle Database with [[Oracle API for
MongoDB]{.underline}](https://docs.oracle.com/en/database/oracle/mongodb-api/mgapi/overview-oracle-database-api-mongodb.html#GUID-1CF44843-6294-45F0-8065-B9E8034D6CB1) is
enabled.

- A subset of the data is defined representing all collections which
will be traced.

- The configuration file \$MR_CONFIG_DIR/MDBApplierConfig.json with the
required parameter settings is created.

**Parameters for MDBApplier**

**Configuration File**

{

\"INPUT_FILE\" : \"\<name and location of the input file\>\",

\"DB_NAME\" : \"\<name of the database\>\",

\"LOG_FILE\" : \"\<log file location and name\>\",

\"LOG_LEVEL\" : \"\<level of details\>\",

\"INTERACTIVITY_LEVEL\" : \"\<level of interactivity\>\"

**\"CONNECT_STRING\"** : \"\<connect_string\>\"

}

- **INPUT_FILE** (default: standard input) defines the input log file
generated by a MDBExtractor.

- **DB_NAME** defines the target database name.

- **CONNECT_STRING** (mandatory) defines the connect string for a target
MongoDB or Oracle API for MongoDB Instance.

- **LOG_FILE** (default: standard diagnostic output) is the name of log
file used.

- **LOG_LEVEL** (default: 0) defines the level of logging details. 0
provides only a summary of initialization and processing information;
1 additionally errors will be logged, 2 in addition all the commands
will be logged.

- **INTERACTIVITY_LEVEL** (default: silent) defines the level of
interactivity. Its default value means, that Applier will work in
silent mode, and will not ask for anything. It is usefull, when the
tool is working as a background process. "BASIC" means, that Applier
will ask for confirmation after displaying the summary of settings and
before applying of any command. "FULL" means that Applier will ask
also for confirmation before applying any command to a target system.
It is useful, when we want to test only few commands.

Note:

- Parameters in **bold** are mandatory!

- The sequence of the parameters is not important.