We have previously introduced: For a detailed introduction of the Oracle database flashback personality, this article willFlashback of Oracle 10 Gb DatabaseThe configuration and usage are summarized for your reference. You can directly apply the configuration without understanding it.
Run the following SQL statement:
- Sqlplus sys/passwd @ tns_name as sysdba
-
- SQL> shutdown immediate; // closes the database
-
- SQL> startup mount; // start the Database Control file to connect the instance to the database. There are also two unmount methods to start the database instance. open the control file to locate and open the data file and log file, and start the database.
-
- SQL> alter database archivelog; // starts Archiving
-
- SQL> alter datbase flashback on;
-
- SQL> select flashback_on from v $ database; // view the startup result. If the flashback_on value is on, the startup is successful.
-
- SQL> show parameter recyclebin; // if you want to use the flashback of a table, the recyclebin recycle bin must be enabled.
In this way, the flash back of the Oracle 10 Gb database is configured.
If you want to use the database to flash back, you need to execute the following code:
- Sqlplus sys/passwd @ tns_name as sysdba
-
- SQL> shutdown immediate; // closes the database
-
- SQL> startup mount; // start the Database Control file to connect the instance to the database. There are also two unmount methods to start the database instance. open the control file to locate and open the data file and log file, and start the database.
-
- SQL> flashback database to timestamp to_timestamp ('2017-08-08 09-14-01 ', 'yyyy-mm-dd hh24: mi: ss'); // flash back to the database
-
- SQL> alter database open resetlogs; // The resetlogs or noresetlogs must be added to the end of open or a ora-01589 error will be reported
To flash back the table, the Code is as follows:
- flashback table table_name to timestamp to_timestamp('2011-08-08 09-14-01','yyyy-mm-dd hh24:mi:ss'');
Flashback after the table is deleted:
- flashback table table_name to before drop;
If a ora-38305 error occurs at this time. Run the following command first:
- alter table table_name enable row movement;
Here is an introduction to the configuration and usage of flash back for Oracle 10g databases. If you want to learn more about Oracle databases, you can read the article: http://database.51cto.com/oracle/, and I believe you can bring it to you!