Just a package for simple extracting data from Oracle database
Project description
oradump
OraDump is a simple class for extracting data from Oracle database. It works over the native Oracle client, so you'll have the fastest and convenient way to get your data dumped.
Requirements
- Since it works directly with native Oracle client, you need to have installed 12.2c(or higher) version of it on your computer.
- Path to BIN directory of Oracle client have to be in PATH variable.
- Set ENV variable
NLS_LANG
to encoding which used on your Oracle server. LikeAMERICAN_AMERICA.AL32UTF8
- Installed Python 3.6 or higher.
Installation
pip install oradump
Usage
Before utilize OraDump you need to prepare SQL-statement that will be used for retrieving data.
For values that will be changing you set placeholders like that {start_date}
. So you'll have SQL script, but like as a template.
Example:
select
field_1,
id,
first_name,
last_name,
birth_day,
....
field_N ,
from scheme.employees
where birth_day = to_date('{date}', 'dd.mm.yyyy')
from oradump import OraDump
By now, you can get data only in csv format. So to achieve this, you need to call dump
or dump_gziped
(if want get it compressed) functions.
dump
example:
rows_cnt = OraDump.dump(conn_str, template, csv, params)
-
conn_str - connection string that you specify when you connect to Oracle instance by native client(sqlplus). Like
user/password@(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL=TCP)(HOST=XXX.XXX.XXX.XXX)(PORT=1521)))(CONNECT_DATA = (SERVICE_NAME=SID.alias)))
-
template - SQL template described above
-
csv - path to target csv file
-
params - parameters passing into SQL template and substituting into according placeholders.
dump_gziped
example:
rows_cnt = OraDump.dump_gziped(conn_str, template, gzip, params, del_orig=False)
- gzip - path to target gziped csv file
- del_orig - whether if you want to delete csv file that OraDump gets before compressing.
purposes of rest of parameters are the same as in dump
If all went successful number of retrieved rows is returned.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file oradump-1.0.7.tar.gz
.
File metadata
- Download URL: oradump-1.0.7.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 403c6bd0b4ed944d8c4e255a0e7a1bcc5bd57757428be233ce286f0a233a4540 |
|
MD5 | 0a37a4f38d6a14c8bf36611b3e9ac619 |
|
BLAKE2b-256 | bd991ae77430688549beda7efb952a8225f2e15826e298e56968116b55e0dece |
File details
Details for the file oradump-1.0.7-py3-none-any.whl
.
File metadata
- Download URL: oradump-1.0.7-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/28.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.5rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ed6004b24b98e7eb90c2f19bb59431136d0cf62e8e17f4431668e3b286347b5 |
|
MD5 | 7587241aba8161bb947ab863db4ac069 |
|
BLAKE2b-256 | 57880e5bbd4bc7e0d35c0d603342868b5b178535e69704f2327d41d9ebd4e7c8 |