Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews DB Oracle Interviews:Concepts and ArchitectureData AccessDatabase ArchitectureDatabase ManagementDatabase Security OracleDistributed ProcessingFlexfieldForms ReportsGeneral OracleMemory ManagementMTO-SAP Financial AccountingOCIOracle AOLOracle AROracle Backup RecoveryOracle D2KOracle DatabaseOracle Database DeveloperOracle DB OptimizationOracle DBAOracle DeveloperOracle ETLOracle Forms 3.0Oracle Forms 4.0Oracle GLOracle PL-SQLOracle RMANOracle ScenariosOracle SecurityOracle SQLOracle System ArchitectureOracle Technology Network (OTN)Programmatic ConstructsRAC (Real Application Clusters)SQL Plus
Copyright © 2018. All Rights Reserved
Oracle Database Interview Question:
How To View the Dropped Tables in Your Recycle Bin?
Submitted by: AdministratorYou can look what's in your recycle bin through the predefined view called RECYCLEBIN. You can use the SELECT statement to list the dropped tables as shown in the following script:
SQL> connect HR/globalguideline
Connected.
SQL> CREATE TABLE emp_dept_90
2 AS SELECT * FROM employees WHERE department_id=90;
Table created.
SQL> SELECT COUNT(*) FROM emp_dept_90;
COUNT(*)
----------
3
SQL> DROP TABLE emp_dept_90;
Table dropped.
SQL> COL original_name FORMAT A14
SQL> SELECT object_name, original_name, droptime
2 FROM recyclebin;
<pre>OBJECT_NAME ORIGINAL_NAME DROPTIME
------------------------------ ------------- ---------------
BIN$uaSS/heeQuys53HgXRhEEQ==$0 EMP_DEPT_10 06-04-01:18:57:
BIN$gSt95r7ATKGUPuALIHy4dw==$0 EMP_DEPT_10 06-04-01:19:59:
BIN$bLukbcgSQ6mK1P2QVRf+fQ==$0 EMP_DEPT_90 06-04-01:20:47:</pre>
As you can use the EMP_DEPT_10 was dropped twice. If the same table was dropped multiple times, you need to restore by using the object name in the recycle bin with FLASHBACK statement.
Note that RECYCLEBIN is just an alias of USER_RECYCLEBIN.
Submitted by: Administrator
SQL> connect HR/globalguideline
Connected.
SQL> CREATE TABLE emp_dept_90
2 AS SELECT * FROM employees WHERE department_id=90;
Table created.
SQL> SELECT COUNT(*) FROM emp_dept_90;
COUNT(*)
----------
3
SQL> DROP TABLE emp_dept_90;
Table dropped.
SQL> COL original_name FORMAT A14
SQL> SELECT object_name, original_name, droptime
2 FROM recyclebin;
<pre>OBJECT_NAME ORIGINAL_NAME DROPTIME
------------------------------ ------------- ---------------
BIN$uaSS/heeQuys53HgXRhEEQ==$0 EMP_DEPT_10 06-04-01:18:57:
BIN$gSt95r7ATKGUPuALIHy4dw==$0 EMP_DEPT_10 06-04-01:19:59:
BIN$bLukbcgSQ6mK1P2QVRf+fQ==$0 EMP_DEPT_90 06-04-01:20:47:</pre>
As you can use the EMP_DEPT_10 was dropped twice. If the same table was dropped multiple times, you need to restore by using the object name in the recycle bin with FLASHBACK statement.
Note that RECYCLEBIN is just an alias of USER_RECYCLEBIN.
Submitted by: Administrator
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.