Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Distributed Transaction Troubleshooting. Oracle
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • How to find password change date for user Oracle
  • Transfer SQL Profiles from One database to other database. Oracle
  • For Search and replace unix command. Linux/Unix
  • 10g oem configuration Oracle
  • GSQ.sql Oracle
  • Jai Shree Ram Oracle
  • v$backup.status information Oracle
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • find_string_in_database.sql Oracle
  • Nice notes on wait events Oracle
  • To see how much time or progress of long transaction Oracle
  • Directory wise folder wise space usage Linux/Unix
  • Finding Oracle Patches with opatch 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

  • exp syntax in oracle 10g Oracle
  • New OFA for 11g Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • DETERMINING WHICH INSTANCE OWNS WHICH SHARED MEMORY & SEMAPHORE SEGMENTS Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • RAC 11g with vmware Oracle

Leave a Reply Cancel reply

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

Categories

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

Recent Posts

  • load SPM baseline from cursor cache05-Jun-2025
  • Drop all SPM baselines for SQL handle05-Jun-2025
  • Load SPM baseline from AWR05-Jun-2025
  • Drop specific SQL plan baseline – spm05-Jun-2025
  • findinfo.sql (SQL for getting CPU and Active session info)27-May-2025
  • SQL Tracker by SID sqltrackerbysid.sql22-Apr-2025
  • How to connect to Oracle Database with Wallet with Python.21-Mar-2025
  • JSON/XML Types in Oracle18-Mar-2025
  • CPU Core related projections12-Mar-2025
  • Exadata Basics10-Dec-2024

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • DETERMINING WHICH INSTANCE OWNS WHICH SHARED MEMORY & SEMAPHORE SEGMENTS Oracle
  • changing kernel parameter in Oracle Enterpise Linux Linux/Unix
  • send attachment from unix-shell script Linux/Unix
  • Giving Grant on v$DATABASE Oracle
  • Jai Shree Ram PHP/MYSQL/Wordpress
  • scripts to take listener.log backup Linux/Unix
  • Important Script Method for tuning Oracle
  • Proc Compilation Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme