Scroll ignore | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
About Collectors
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|
...
Pre-requisites
Python 3.6 8 - 3.1011
Access to K Landing Directory
Access toOracle (see section below)
...
The collector requires a set of parameters to connect to and extract metadata from Oracle
FIELD | FIELD TYPE | DESCRIPTION | EXAMPLE |
---|---|---|---|
username | string | Username to log into Oracle | “myuser” |
password | string | Password to log into Oracle |
|
dsn | string | Datasource Name for Oracle, this can be one of the following forms <tnsname> | “preprod” |
oracle_client_path | string | Full path to the location of the Oracle Client libraries | “/tmp/drivers/lib/oracleinstantclient_11_9” |
oracle_major_version | string | We currently support 11g and 12c and 12c+ for 12c greater, 11g has different SQL scripts so be very careful when setting this value | 12c |
database_name | string | The database name as onboarded in K, it is important that it matches so the objects are created correctly | “mykdatabase” |
host_name | string | The host name as onboarded in K, it is important that it matches so the objects are created correctly | “mykhost” |
wallet_path | string | If you use Oracle wallets, then this is the location of the wallet, ensure that the sqlnet.ora file references the wallet locaton correctly. The DIRECTORY location needs to change to the fully qualified path to the wallet itself (the unzipped wallet location). By default the value is ?/network/admin this should be updated to match the wallet_path value If you do not use wallets, leave this blank. | “/tmp/drivers/oracle/wallet” |
meta_only | boolean | If you do not want to enable auditing, option to extract meta only | false |
output_path | string | Absolute path to the output location where files are to be written | “/tmp/output” |
mask | boolean | To enable masking or not | true |
compress | boolean | To gzip the output or not | true |
These parameters can be added directly into the run or you can use pass the parameters in via a JSON file. The following is an example you can use that is included in the example run code below.
...
Code Block | ||
---|---|---|
| ||
import os import argparse from kada_collectors.extractors.utils import load_config, get_hwm, publish_hwm, get_generic_logger from kada_collectors.extractors.oracle import Extractor get_generic_logger('root') # Set to use the root logger, you can change the context accordingly or define your own logger _type = 'oracle' dirname = os.path.dirname(__file__) filename = os.path.join(dirname, 'kada_{}_extractor_config.json'.format(_type)) parser = argparse.ArgumentParser(description='KADA Oracle Extractor.') parser.add_argument('--config', '-c', dest='config', default=filename, help='Location of the configuration json, default is the config json in the same directory as the script.') parser.add_argument('--name', '-n', dest='name', default=_type, help='Name of the collector instance.') args = parser.parse_args() start_hwm, end_hwm = get_hwm(_typeargs.name) ext = Extractor(**load_config(args.config)) ext.test_connection() ext.run(**{"start_hwm": start_hwm, "end_hwm": end_hwm}) publish_hwm(_type, end_hwm) |
...