Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Find sort details from Db find_sort.sql Oracle
  • checking redhat linux version Linux/Unix
  • Restoring a user’s original password 1051962.101 Oracle
  • Query to Generate aggregate on every 30 mins. Oracle
  • cold backup scripts to copy locally Linux/Unix
  • create database syntax Oracle
  • usnsql.sql Displays information about UNDO segments with sql statements Oracle
  • 751131.1 New Article Error 2819 While Requesting a Systemstate Dump Oracle
  • Formatter Explain plan Output 1 Oracle
  • Search and replace pattern Linux/Unix
  • Temporary Tablespace Information and restriction. Oracle
  • ORA-4031 issue and solution on 09-MAY-2008 Oracle
  • Another export with Query Oracle
  • arch_configUOCIOTTO.ora Oracle
  • chk_space_SID.ksh Linux/Unix

find_pk.sql /* Find Primary Key */

Posted on 02-Aug-2005 By Admin No Comments on find_pk.sql /* Find Primary Key */

set pagesize 300

set linesize 205

set head on

set echo off

spool tblwopk

accept usrid prompt ‘Enter User Name : ‘

accept table_name prompt ‘Enter Table Name : ‘

column PrimaryKey format a80 heading ‘Follwoing Are Primary Keys’

select substr(a.column_name, 1, 20) || ‘ Position : ‘ || to_char(a.position) PrimaryKey

from dba_cons_columns a, dba_constraints b

where b.table_name = upper(‘&TABLE_NAME’)

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

and a.constraint_name = b.constraint_name

and b.constraint_type = ‘P’

order by a.position;

Oracle, SQL scripts

Post navigation

Previous Post: fkwoindex.sql /* Find FK without Index */
Next Post: tblwopk.sql /* Find Tables Without PK */

Related Posts

  • Default User Profile Oracle
  • get_vmstat_linux Oracle
  • Insert cause enqueue locks Oracle
  • CPU Core related projections AWS
  • crtgr.sql /* For creating trigger from data dictionary */ Oracle
  • Database logon trigger issue 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 (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Find Multiple levels of object dependencies : depen.sql Oracle
  • process id based files and processes Linux/Unix
  • Find Stale DR Physical Standby Oracle
  • cache buffer chain latch Oracle
  • Implementing Listener Security Oracle
  • How does one overcome the Unix 2 Gig file limit? Linux/Unix
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle
  • fuser to check who is using diretory Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme