Sử dụng Flashback trong môi trường PDB (Pluggable Database) của Oracle có thể giúp bạn khôi phục lại cơ sở dữ liệu về trạng thái trước đó mà không cần phải thực hiện restore từ bản sao lưu. Dưới đây là các bước để cấu hình và sử dụng Flashback trong môi trường PDB.
- Bật archivelog mode, Bật Flashback
- Create restore point
- Flashback run
BẬT ARCHIVELOG MODE, BẬT FLASHBACK
Thực hiện bật Archivelog mode, Flashback trên CDB => PDB tự động được apply:
sqlplus / as sysdba startup mount alter database archivelog; alter database open; alter database flashback on; sho parameter retention alter system set db_flashback_retention_target=10080 scope=both; select flashback_on from v$database;
CREATE RESTORE POINT
Kết nối vào PDB và thực hiện tạo Restore point
sqlplus / as sysdba alter session set container = pdbduongdb; alter pluggable database pdbduongdb open; create table duong_tab (id number); insert into duong_tab values (1111); commit; create restore point rsp1 guarantee flashback database; select name,scn from v$restore_point; ## Chúng ta cũng có thể tạo restore point từ CDB cho PDB được create restore point rsp222 for pluggable database pdbduongdb guarantee flashback database; drop restore point rsp for pluggable database pdbduongdb;

FLASHBACK RUN
Xoá table duong_tab sau đó thực hiện flashback PDB
select * from duong_tab; drop table duong_tab; select * from duong_tab; alter pluggable database pdbduongdb close immediate; flashback pluggable database pdbduongdb to restore point rsp1; alter pluggable database pdbduongdb open resetlogs; select * from duong_tab;


Như vậy là đã khôi phục lại table thành công.
Xem thêm:
- LAMP là gì? Hướng dẫn cài đặt LAMP
- Comparing Undo Data and Redo Data – So sánh undo vs redo Oracle Database
- Q126 The EMPLOYEES table contains columns EMP_ID of data type NUMBER and HIRE_DATE of data type DATE
- Q72. Which three are located by using environment variables?
- Bảng phân mảnh thì xử lý thế nào? Table FRAGMENTED how to do?

Bikil - Bikini & Lingerie Fashion Responsive Shopify Theme
Ashi - Yoga Pilates, Fitness Shopify Theme
Minimog - Next-gen Multipurpose Shopify theme grade-A
Download Monitor - CSV Importer
Porto | Multipurpose & WooCommerce Theme
Ninja E-Sport - Gaming Elementor Template Kit
Almighty Wordpress Theme
Seporta - Gym & Fitness Trainer Elementor Template Kit
Finess Elementor Template Kit
Groovy Mega Menu
Lunar - Template Kit for eSport & Gaming
Revision - Optimized Personal Blog WordPress Theme
CheerUp - Food, Blog & Magazine for WordPress
Gymsite - Gym Elementor Template Kit
Menica - Wedding Elementor Template Kit
Fodis - Restaurant & Cafe WordPress Theme
jannifer hamis health coach healthy lifestyle blog
Ohio - Creative Portfolio & Agency WordPress Theme
Academy pro wordpress theme
Adaptable Notes Wordpress Theme
Traveler - Travel Booking WordPress Theme
Gloreya - Food Ordering & Delivery Restaurant WordPress Theme