pythonoracle-databasecsvdmp

How can I read oracle dmp file every hour via python


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?


Solution

  • 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:

    1. Create a new database instance.
    2. Restore the database from the backup.
    3. Connect your python code to that new instance.
    4. 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.