In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
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 the Recycle Bin recycle bin in the database, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
In principle, the Recycle Bin (Recycle Bin) is a data dictionary table that places database object information drop by the user. The object deleted by the user has not been deleted by the database and will still take up space. Unless it is due to manual Purge by the user or cleared by the database because there is not enough storage space.
In the Oracle 10g database, a recycle bin (Recycle Bin) database object was introduced.
The Recycle Bin, as its name implies, is the storage of deleted things. In principle, it is a data dictionary table that places the database object information deleted by the user (drop). The object deleted by the user has not been deleted by the database and will still take up space. Unless it is due to manual Purge by the user or cleared by the database because there is not enough storage space. With such a function, the database can reduce a lot of unnecessary trouble.
If a table is deleted, objects associated with the table, such as indexes, constraints, and other dependent objects, are prefixed with the bin$$.
I. start and shut down
You can use the following query statement to view the current status of the Recycle Bin:
SQL > SHOW PARAMETER RECYCLEBIN
NAME TYPE VALUE
Recyclebin string ON
Or
SQL > SELECT NAME, VALUE FROM V$PARAMETER WHERE NAME='recyclebin'
NAME VALUE
--
Recyclebin on
A return value of "on" indicates that the Recycle Bin is started, and "off" indicates that it is closed.
Of course, you can start or close each session (session) and system (system) in the Recycle Bin as follows:
ALTER SYSTEM SET recyclebin = ON
ALTER SESSION SET recyclebin = ON
ALTER SYSTEM SET recyclebin = OFF
ALTER SESSION SET recyclebin = OFF
Second, get the contents of the Recycle Bin
You can use any of the following statements to get the objects in the Recycle Bin:
SELECT * FROM RECYCLEBIN
SELECT * FROM USER_RECYCLEBIN
SELECT * FROM DBA_RECYCLEBIN
Third, restore
You can restore deleted objects using the following syntax:
FLASHBACK TABLE TO BEFORE DROP RENAME TO
Note: RENAME here is an optional command to rename deleted objects.
4. Empty the Recycle Bin
The emptying here includes two situations: first, you can clear it conditionally; second, you can empty it all. Let's first take a look at how conditional emptying can be done:
a. Clear a specific table:
PURGE TABLE
b. Clear a specific index:
PURGE INDEX
c. Clear the objects associated with the tablespace:
PURGE TABLESPACE
d. Clear a specific user's tablespace object:
PURGE TABLESPACE USER
e. Empty the Recycle Bin: (RECYCLEBIN is synonymous with USER_RECYCLEBIN)
PURGE RECYCLEBIN
f. When a table is drop, it is emptied directly from the Recycle Bin.
DROP TABLE PURGE
5. Query recyclebin information of the Recycle Bin
Set lines 200
Col owner for a15
Col object_name for a30
Col original_name for a30
Col operation for a9
Col type for a8
Col droptime for a19
Col ts_name for a15
Select owner,object_name, original_name, operation, type, droptime, ts_name
From dba_recyclebin
The above is all the contents of the article "how to use the Recycle Bin recycle bin in the Database". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.