Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • temp_use.sql diplays usage of temp ts Oracle
  • Composite Index creation tip from Vivek Oracle
  • Korn Shell Arithmatic Linux/Unix
  • How can I tell if ASO is installed ? Oracle
  • proc.sql Oracle
  • db_status.sql Oracle
  • Gathering statistics with DBMS_STATS Oracle
  • oracle 11g RAC on vmware Oracle
  • oradebug ipcrm ipcs Oracle
  • move_arch_files.ksh Linux/Unix
  • Giving Grant on v$DATABASE Oracle
  • Clean up Oracle
  • True Session Wait Activity in Oracle 10g Verygood Oracle
  • _B_TREE_BITMAP_PLANS issue during 8.1.7 to 9.2.0.8 upgrade Oracle
  • currwaitobj.sql SQl_ID and SQL statement you can get from currwaitobj.sql 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

  • 751131.1 New Article Error 2819 While Requesting a Systemstate Dump Oracle
  • Oracle10g – Using SQLAccess Advisor (DBMS_ADVISOR) with the Automatic Workload Repository Oracle
  • JSON/XML Types in Oracle Oracle
  • Export With Query Another Example. Oracle
  • Exadata Basics Oracle
  • Goog notes on X$ tables 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 (395)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (343)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • TRUNCATE table and disabling referential constraints. Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • Check_recovery.sh program to run sqlplus and return its values remotely. Linux/Unix
  • shutdown linux Linux/Unix
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • create a folder in multiple places Linux/Unix
  • Search and replace pattern Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme