View Tablespaces in PL/SQL: Complete Guide

In PL/SQL, you can view existing table spaces using the following method:

  1. You can use the following SQL query to list all tablespaces in the current database:
SELECT tablespace_name
FROM dba_tablespaces;
  1. The following PL/SQL code block can be used to display the names of all tablespaces:
BEGIN
  FOR ts IN (SELECT tablespace_name FROM dba_tablespaces) LOOP
    DBMS_OUTPUT.PUT_LINE(ts.tablespace_name);
  END LOOP;
END;

Using the above method, you can view the names of the tablespaces currently in the database.

bannerAds