Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Changing default shell Linux/Unix
  • Jai Shree Ram Oracle
  • scripts to take listener.log backup Linux/Unix
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • Oracle Material from OTN Oracle
  • Explain Plan Output 2 Oracle
  • good linux notes Linux/Unix
  • Building Our Own Namespaces with “Create Context” Oracle
  • Rollback force for distributed transactions Oracle
  • DBA_HIST_SQLSTAT contents Oracle
  • Zip and unzip with tar Linux/Unix
  • Distributed Transaction Troubleshooting. Oracle
  • segment_wise_space.sql segspace.sql Segment wise space usage (allocated and used) Oracle
  • Creating never expiring DB user accounts in Oracle Oracle

tblwopk.sql /* Find Tables Without PK */

Posted on 02-Aug-2005 By Admin No Comments on tblwopk.sql /* Find Tables Without PK */

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

Oracle, SQL scripts

Post navigation

Previous Post: find_pk.sql /* Find Primary Key */
Next Post: db_status.sql

Related Posts

  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • Recovering lost SYS password Oracle
  • SCRIPT TO LIST RECURSIVE DEPENDENCY BETWEEN OBJECTS UTLDTREE.sql Oracle
  • New Latest Param.sql for finding all hidden parameters also Oracle
  • Rename Oracle Instance Name Oracle
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (400)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (18)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (348)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • Running PDB on single node in RAC09-Apr-2026
  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • tuning commmand for cpu, ip and memory stats Linux/Unix
  • sql_plan9i.sql Oracle
  • oracle 10g on linux Linux/Unix
  • Index Range Scan Oracle
  • All Hints for Oracle Databases Oracle
  • find_err.sql for finding errors from dba_errors. Oracle
  • Search and replace editor command in vi Linux/Unix
  • Removing first line Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme