Recycle Bin for Oracle Database

Source: Internet
Author: User

For the Oracle database, in order to ensure the security of data, we need to set up the database of the Recycle Bin function, the default function is open. We can view and modify them through the following steps

1 See if the database has a Recycle Bin (recyclebin feature)

Show parameter RecycleBin;

Sql> Show parameter RecycleBin;

NAME TYPE VALUE

------------------------------------ -----------   

RecycleBin string on

2 If this value is on, it indicates that the Recycle Bin function has been turned on, and if it is off , Then we need to open the database Recycle Bin function through the command.

command to turn recyclebin on and off

Turn on the reclebin command

View status

Sql> Show parameter RecycleBin;

NAME TYPE VALUE

------------------------------------ ----------- ------------------------------

RecycleBin string OFF

The modification will be on, and it is important to note that you want to specify scope=spfileBecause this parameter cannot be modified in memory.

Sql> alter system set Recyclebin=on Scope=spfile;

System Altered

The state has been modified and we need to restart the database to make the parameters effective

Sql> alter system set Recyclebin=on Scope=spfile;

System Altered

3 Turn off the Recycle Bin feature of the database ( because the SPFile is modified , the database will need to be restarted for it to take effect )

Sql> alter system set Recyclebin=on Scope=spfile;

System Altered

4 emptying the data inside the recycle bin

Empty all data inside the Recycle Bin

Sql> purge RecycleBin;

Done

Clear a specific table

Sql> Purge Table dept;

Done

5 Data Restore function (most important), the function of turning on the Recycle Bin of the database is to prevent accidental deletion, can collect data.

Flashback table BONUS to before drop ;

Restore data in a renamed manner

Flashback table salgrade to before Drop rename to Salgrade_bak ;

Modify table names in a database

Alter table salgrade_bak rename to Salgrade

Recycle Bin for Oracle Database

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.