Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • To check whether standby is recovering properly or not?? Oracle
  • Flowers Resize datafiles Oracle
  • Jai Shree Ram Oracle
  • good linux notes Linux/Unix
  • Load testing on Oracle 19C RAC with HammerDB Oracle
  • Mutating Table Error while using database trigger Oracle
  • Default User Profile Oracle
  • sesswait.sql Oracle
  • Passing from Unix to PLSQL using bind variables Linux/Unix
  • create database link syntax Oracle
  • UTL_FILE test program Oracle
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • OPENING A STANDBY DATABASE IN READ-ONLY MODE Oracle
  • Good links for x$ tables in oracle. Oracle
  • Gathering statistics with DBMS_STATS Oracle

fkwoind.sql fkwoindex.sql

Posted on 28-Mar-2006 By Admin No Comments on fkwoind.sql fkwoindex.sql

set pagesize 300

set linesize 205

set head on

set echo off

spool fkwoind

accept usrid prompt ‘Enter User Name : ‘

col “Cons Name” format a30 heading “Cons Name” word_wrapped

col status format a10 heading status

col “Cons Type” format a12 heading “Cons Type”

col “Column Name” format a30 heading “Column Name”

col “Cons Desc” format a50 heading “Cons Desc” word_wrapped

REM Find all FK Constraints, that does not have column position in constraint and in index matching

select /*+ rule */ b.table_name, b.constraint_name “FK-Cons|Name”,

substr(a.column_name, 1, 30) “Column Name”, a.position, b.status

from dba_cons_columns a, dba_constraints b

where a.constraint_name = b.constraint_name

and a.owner = b.owner

and a.owner = upper(‘&usrid’)

and b.constraint_type = ‘R’

and (b.table_name, a.column_name, a.position) not in

( select table_name, column_name, column_position

from dba_ind_columns

where table_owner = a.owner

)

order by b.table_name, b.constraint_name, a.position;

REM Find all FK Constraints, that does not have index on it.

select /*+ rule */ b.table_name, b.constraint_name “FK-Cons|Name”,

substr(a.column_name, 1, 30) “Column Name”, b.status

from dba_cons_columns a, dba_constraints b

where a.constraint_name = b.constraint_name

and a.owner = b.owner

and a.owner = upper(‘&usrid’)

and b.constraint_type = ‘R’

and (b.table_name, a.column_name) not in

( select table_name, column_name

from dba_ind_columns

where table_owner = a.owner

)

order by b.table_name, b.constraint_name, a.position;

spool off

Oracle, SQL scripts

Post navigation

Previous Post: usnsql.sql Displays information about UNDO segments with sql statements
Next Post: tblwopk.sql tablewopk.sql

Related Posts

  • OPENING A STANDBY DATABASE IN READ-ONLY MODE Oracle
  • reset Sequence Oracle
  • Implementing Listener Security Oracle
  • Good notes for shared pool Oracle
  • metalink all dynamic view reference notes. Oracle
  • How to find who is using which Rollback segment and how many rows or blocks in that rollback segments, 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
  • import-export with multiple files Oracle
  • How to know Number of CPUs on Sun Box Linux/Unix
  • pvm_pre_change.sql Oracle
  • Load SPM baseline from AWR Oracle
  • oracle fast start failover best practice Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • Oracle Data Direct to TAPE Oracle
  • Generate SSH without password authentication. Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme