Home >> FAQs/Tutorials >> Oracle DBA FAQ

Oracle DBA FAQ - Managing Oracle Database Tables

By: FYIcenter.com

Part:   1  2  3  4  5  

(Continued from previous part...)

How To Turn On or Off Recycle Bin for the Session?

If you want to control the recycle bin feature in your own session, you can use the ALTER SESSION statement to turn on or off. Here is an example SQL script:

SQL> connect HR/fyicenter
Connected.

SQL> SELECT COUNT(*) FROM recyclebin;
  COUNT(*)
----------
         0

SQL> ALTER SESSION SET recyclebin = off;
Session altered.

SQL> CREATE TABLE emp_dept_90 
  2  AS SELECT * FROM employees WHERE department_id=90;
Table created.

SQL> DROP TABLE emp_dept_90;
Table dropped.

SQL> SELECT COUNT(*) FROM recyclebin;
  COUNT(*)
----------
         0

Warning: Turning off the recycle bin feature in your session will give yourself hard times on recovering dropped tables.

How To List All Tables in Your Schema?

If you log in with your Oracle account, and you want to get a list of all tables in your schema, you can get it through the USER_TABLES view with a SELECT statement, as shown in the following SQL script:

SQL> connect HR/fyicenter
Connected.

SQL> SELECT table_name, status, num_rows FROM USER_TABLES;
TABLE_NAME                     STATUS     NUM_ROWS
------------------------------ -------- ----------
REGIONS                        VALID             4
LOCATIONS                      VALID            23
DEPARTMENTS                    VALID            27
JOBS                           VALID            19
EMPLOYEES                      VALID           107
JOB_HISTORY                    VALID            10
COUNTRIES                      VALID            25

7 rows selected.

Part:   1  2  3  4  5  

Related Articles:

More...


Other Tutorials/FAQs:

More...


Related Resources:

More...


Selected Jobs:

More...