database-administrationdatabase-backupsoracle19crman

after restroring tablespace table or view not exists


I've Oracle CDB with PDB

In the PDB I created a tablespace then I created a table over this tablespace

after that, I login into RMAN for the CDB database then I make a backup using

backup database ;

then I drop the table using

drop table table1 purge

then I login to the RMAN FOR PDB and making the following command

alter tablespace mytablesapce offline ; 
restore tablespace mytablesapce  ; 
recover tablespace mytablesapce  ;
alter tablespace mytablesapce online ; 

every thing until now is correct

but the problem is when I'm trying to select from table1 give me

the table or view does not exist

Also, I tried to restore all database but the same problem

could you help me, thank you

I've Oracle CDB with PDB

In the PDB I created a tablespace then I created a table over this tablespace

after that, I login into RMAN for the CDB database then I make a backup using

backup database ;

then I drop the table using

drop table table1 purge

then I login to the RMAN FOR PDB and making the following command

alter tablespace mytablesapce offline ; 
restore tablespace mytablesapce  ; 
recover tablespace mytablesapce  ;
alter tablespace mytablesapce online ; 

every thing until now is correct

but the problem is when I'm trying to select from table1 give me

the table or view does not exist

Also, I tried to restore all database but the same problem

could you help me, thank you


Solution

  • The reason why your current method not work because:

    1. You take tablespace offline
    2. You restore tablespace (it return to your latest backup of that tablespace).
    3. You recover your tablespace - It means that Oracle Instance will apply all changes made to that Tablespace and that recover will consisting of action Dropping table.

    Solution: You have to use "Point In Time" recovery method! And that point should be the time when your (full) database backup takes place (or at least right in front of dropping action). The RMAN frame should be:

    run {
    set until SCN=<specify SCN here>;
    restore database;
    recover database;
    alter database open resetlogs;
    }
    

    Good luck!