I need to read data from the dmp file every hour to create a dashbord, this is the only way to get the data, and I have no experience with oracle, What are the steps required to read data from Python?
CodePudding user response:
I, on the other hand, don't know Python.
However: .dmp files are result of Oracle Data Pump Export (probably; unless you've used the original EXP utility). They can be read (and then imported into an Oracle database) using Import utility. As .dmp files aren't textual, you can't just "read" them; their format is proprietary and undocumented, so ... YMMV.
Perhaps you'd want to check Intelligent Converters; they say they
have investigated Oracle dump format and released a collection of tools to read and export data to the most popular data sources. This is OraDump Export Kit, product to convert Oracle dump files into Microsoft SQL, Microsoft Access, Microsoft Excel, MySQL and CSV. It does direct reading from dump file, so Oracle components are not required.
It is not free; currently, pricing starts at $149.
Furthermore, even if you choose that (or any other tool which is capable of reading a .dmp file), its result is still another file; let's say, a CSV - so you'll have to read that file format and create a dashboard.
All that leads to another thought: why wouldn't you, for example, use Oracle Application Express which is installed within the Oracle database, reads data directly from Oracle and is capable of creating various web pages?
I understand - if you know Python, you want to use it but ... maybe it is just not the right tool for this task.
CodePudding user response:
From comments:
we don't have an access to the main database
This is an XY-problem; because you do not have access to the database you are trying to read the dump file. The solution should not be to read the dump file, it should be to talk to the DBA and the owner of the database and get access to the database (even if it is only read access to the database).
If you cannot get access to the database then you should be asking, should I be allowed access to the backups? The answer is probably going to be NO, if you aren't allowed to access the live data in the main database then you should not be allowed anywhere near the backups that would be required for disaster recovery and may contain data without the access controls that the live database would apply.
If you are allowed to use the backups then:
- Create a new database instance.
- Restore the database from the backup.
- Connect your python code to that new instance.
- Talk to the DBA and, in future, get them to skip steps 1 & 2 and setup a replica database where all the changes are pushed from the main database to your replica without having to go through the backup & restore cycle.