oracle list primary key
-- Primary key in a table
SELECT * FROM ALL_CONSTRAINTS -- or DBA_CONSTRAINTS or UESR_CONSTRAINTS
WHERE TABLE_NAME= 'table_name' AND CONSTRAINT_TYPE = 'P';
-- With columns names:
SELECT c.OWNER, c.TABLE_NAME, c.CONSTRAINT_NAME, c.CONSTRAINT_TYPE,
col.COLUMN_NAME
FROM ALL_CONSTRAINTS c
JOIN ALL_CONS_COLUMNS col ON c.TABLE_NAME = col.TABLE_NAME
AND c.CONSTRAINT_NAME = col.CONSTRAINT_NAME
WHERE c.TABLE_NAME= 'table_name' AND c.CONSTRAINT_TYPE = 'P'
ORDER BY c.TABLE_NAME, c.CONSTRAINT_NAME, col.COLUMN_NAME;