Search code examples
oracletemp-tables

oracle temporary table in read only environment


Our database environment contains a primary and a reporting site which is synchronized. primary is read/write and reporting read only. For creating reports I am only allowed to use the reporting site. Now I want to use temporary tables. I can create them on primary site and the synchronization mechanism moves it to reporting site. But due to missing permissons I cant fill them. Is there a way (role concept, special permissions...) that makes it possible in Oracle to use temporary tables even the environment is read only? By the way, we are using Oracle 11.


Solution

  • (I'm working on the assumption you are using Standby database not your own home grown option)

    Oracle 11 you are in trouble :-)

    With 12.1 and above, we have a thing called temporary undo ( see https://docs.oracle.com/database/121/ADMIN/undo.htm#CEGJGIAE )

    With temporary undo, the process you are following will work because both the redo and undo are housed in your temp tablespace on your read only environment.

    Perhaps a better option is to upgrade to 19c, where we have a thing call standby DML redirect where we intercept the DML aiming at the standy, redirect it to the primary which is then replayed back to the standby.

    You can get an overview of these here

    https://youtu.be/-B9eorpmikU