Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • How does one SELECT a value from a table into a Unix variable? From SQL to Shell Linux/Unix
  • fkwoind.sql fkwoindex.sql Oracle
  • standard Monitoring – 1 Oracle
  • cur_sql.sql Oracle
  • New OFA for 11g Oracle
  • cif crons Linux/Unix
  • Oracle Material from OTN Oracle
  • .profile Linux/Unix
  • Unix command for system configuration Linux/Unix
  • remove archfiles only when it is applied to DR rm_archfiles.sh Linux/Unix
  • All Hints for Oracle Databases Oracle
  • how to find VIP from ifconfig Linux/Unix
  • Oracle Release Explaination Oracle
  • Composite Index creation tip from Vivek Oracle
  • How to check current redo log progress redo_progress.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

  • In Addition to previous note, following grants needed on PERFSTAT user. Oracle
  • oracle Dba site Oracle
  • find_cons.sql Oracle
  • How to start CRS manually Oracle
  • How To Resolve Stranded DBA_2PC_PENDING Entries ID 401302.1 (Very Good prooven) Oracle
  • pvm_pre_change.sql 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 (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (0)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • 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

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Reading config file from other folder inside class Python/PySpark
  • 10g RAC: Troubleshooting CRS Root.sh Problems Oracle
  • 272332.1 CRS 10g Diagnostic Collection Guide Oracle
  • Virtual Indexes in Oracle Oracle
  • Kernel Parameters for Solaris Linux/Unix
  • replacing ^M character when passing files from Windows to Unix Linux/Unix
  • find_longsql.sql Oracle
  • VIvek Encryption Package and Its Usage Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme