Ahmed Abd El Latif DBA Blog
Sunday, April 12, 2009
Find all tables with no primary key in a specific schema
Script:
select TABLE_NAME
from DBA_TABLES
WHERE OWNER='SCOTT'
MINUS
select TABLE_NAME
from DBA_CONSTRAINTS
where owner='SCOTT' and CONSTRAINT_TYPE='P';
Sample output
TABLE_NAME
-----------
BONUS
PLAN_TABLE
SALGRADE
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment