How do I query the partition being used in Oracle?
You can use the following SQL statement to query the partitions that are being used:
SELECT DISTINCT TABLE_NAME, PARTITION_NAME
FROM USER_TAB_PARTITIONS
WHERE TABLE_NAME IN (
SELECT TABLE_NAME
FROM USER_TABLES
WHERE TABLE_NAME = 'YOUR_TABLE_NAME'
);
Please replace YOUR_TABLE_NAME with the name of the table you want to query. This SQL statement will return all partitions currently in use in the specified table.