Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Good Link from metalink 1 Oracle
  • Finding Oracle Patches with opatch Oracle
  • Physical Standby switchover with session active Oracle
  • Oracle Connections expire_time and firewall Oracle
  • Find nth max and min. Oracle
  • Optimizer SORT Operations Oracle
  • Oracle Metalink useful notes Oracle
  • How to know Number of CPUs on Sun Box Linux/Unix
  • Nice notes on wait events Oracle
  • adding new line after specific pattern using sed Linux/Unix
  • Processes Parameter decision Oracle
  • How to see which patches are applied. Oracle
  • how to find OS block size Oracle
  • Windows based Command line mailing program like mailx (Sednmail for windows) PHP/MYSQL/Wordpress
  • fkwoind.sql fkwoindex.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

  • How to Use DBMS_STATS to Move Statistics to a Different Database Oracle
  • create database syntax Oracle
  • Processes Parameter decision Oracle
  • Exadata Basics Oracle
  • TOP-N Sql to find Nth max or Top N rows Oracle
  • Oracle Recommended Patches — Oracle Database ID 756671.1 Oracle

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (392)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (341)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025
  • V$INSTANCE of Oracle in MYSQL24-Jul-2025
  • Day to day MYSQL DBA operations (Compared with Oracle DBA)24-Jul-2025
  • MYSQL and Oracle Comparison for Oracle DBA24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Vivek Tuning for Row Locks. Oracle
  • newupload.html PHP/MYSQL/Wordpress
  • chk_space_SID.ksh Linux/Unix
  • Single character replacement in Unix Linux/Unix
  • Good Site for Oracle Internals Oracle
  • Validating ORACLE_SID againt oratab file. Linux/Unix
  • proper cpu stats Linux/Unix
  • nfs mount command Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme