Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use RMAN to perform flashback database operations on PDB

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

Editor to share with you how to use RMAN to perform flashback database operations on PDB. I hope you will get something after reading this article. Let's discuss it together.

You can perform flashback operations on a single PDB in a multi-tenant database. Performing a flashback database operation on a particular PDB only modifies the data in the file associated with that PDB. Other PDB in the CDB is unaffected and is readable and writable. If you use restore points, you can use CDB restore points, PDB restore points, PDB clear restore points, or PDB guaranteed restore points when performing flashback database operations. The steps to perform a flashback database operation on PDB are as follows:

1. Connect to the root container using a public user with sysdba or sysbackup privileges

SQL > conn / as sysdbaConnected.

two。 Make sure the CDB is in the open state

SQL > SELECT open_mode from database access to open models read WRITE

3. Log in to PDB (jypdb) to record the current SCN number, and then delete the data in table T1

SQL > conn jy/jy@jypdbConnected.SQL > SELECT CURRENT_SCN FROM VendabaseShield curent SCN-6024220SQL > select count (*) from T1; COUNT (*)-39SQL > delete from t1ten 39 rows deleted.SQL > commit;Commit complete.SQL > select count (*) from T1; COUNT (*)-0

4. Make sure that the PDB (jypdb) that you want to perform the flashback database is in the close state.

SQL > conn / as sysdbaConnected.SQL > alter pluggable database jypdb close immediate;Pluggable database altered.SQL > select name,open_mode from v$pdbs NAME OPEN_MODE -PDB$SEED READ ONLYJYPDB MOUNTEDTESTPDB READ WRITE

5. Flash PDB (jypdb) back to the state where scn=6024220 is located

RMAN > flashback pluggable database jypdb to scn 6024220 * starting flashback at 18-DEC-17starting full resync of recovery catalogfull resync completeallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=11 instance=jy1 device type=DISKstarting media recoverymedia recovery complete, elapsed time: 00:00:03Finished flashback at 18-DEC-17

6. Set CDB to read-only

RMAN > alter pluggable database jypdb open read only;Statement processed

7. Check whether the result of the flashback database operation meets the requirements

SQL > conn jy/jy@jypdbConnected.SQL > select count (*) from T1; COUNT (*)-39

8. If the flashback operation meets your desired results, you can perform the following two mutually exclusive options:

. Open the database using the resetlogs option. If the current database is read-only, use SQL*Plus to execute the following command:

Alter pluggable database jypdb close immediate;alter pluggable database jypdb open resetlogs

. Use Oracle Data Pump to export the objects you need, and then use RMAN to restore the database to the current time, by reapplying all the changes in the redo log to the database

The database is restored to the current point in time to undo changes made by the flashback database.

RMAN > recover pluggable database jypdb; Starting recover at 18-DEC-17allocated channel: ORA_DISK_1channel ORA_DISK_1: SID=11 instance=jy1 device type=DISKstarting media recoverymedia recovery complete, elapsed time: 00:00:01Finished recover at 18-DEC-17RMAN > alter pluggable database jypdb open read write Statement processedstarting full resync of recovery catalogfull resync complete has read this article, I believe you have a certain understanding of "how to use RMAN to perform flashback database operations on PDB". If you want to know more about it, welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report