set pagesize 300
set linesize 205
set head on
set echo off
spool tblwopk
accept usrid prompt ‘Enter User Name : ‘
REM Find all tables that does not have primary key on them.
select /*+ rule */ a.table_name
from dba_tables a
where a.owner = upper(‘&usrid’)
and a.table_name not in
( select b.table_name
from dba_constraints b
where b.table_name = a.table_name
and b.owner = a.owner
and b.constraint_type = ‘P’
)
order by a.table_name;
spool off