Oracle Database Recycle Bin

Source: Internet
Author: User
For Oracle databases, to ensure data security, we need to set the database recycle bin function, which is enabled by default. Follow these steps:

For Oracle databases, to ensure data security, we need to set the database recycle bin function, which is enabled by default. Follow these steps:

For Oracle databases, to ensure data security, we need to set the database recycle bin function, which is enabled by default. Follow these steps to view and modify the settings.

1. Check whether the database's recycle bin is configured for the database (recyclebin function)

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 enabled. If it is off, we need to enable the recycle bin function of the database by running the command.

Enable and disable the recyclebin command

Enable reclebin command

View status

SQL> show parameter recyclebin;

NAME TYPE VALUE

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

Recyclebin string OFF

The modification will be in the on status. You must specify scope = spfile because this parameter cannot be modified in the memory.

SQL> alter system set recyclebin = on scope = spfile;

System altered

The status has been changed. We need to restart the database to make the parameter take effect.

SQL> alter system set recyclebin = on scope = spfile;

System altered

3. Disable the database recycle bin function (because spfile is modified, it takes effect only after the database is restarted)

SQL> alter system set recyclebin = on scope = spfile;

System altered

4. Clear the data in the recycle bin.

Clear all data in the recycle bin

SQL> purge recyclebin;

Done

Clear a specific table

SQL> purge table dept;

Done

5. The data restoration function (the most important) is to enable the database recycle bin function to prevent accidental deletion and recycle data.

Flashback table BONUS to before drop;

Data restoration by renaming

Flashback table SALGRADE to before drop rename to SALGRADE_bak;

Modify the table name in the database

Alter table SALGRADE_bak rename to SALGRADE

Oracle 11g installation manual on RedHat Linux 5.8 _ x64 Platform

Installing Oracle 12C in Linux-6-64

Install Oracle 11gR2 (x64) in CentOS 6.4)

Steps for installing Oracle 11gR2 in vmwarevm

Install Oracle 11g XE R2 In Debian

,

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.