Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Creating never expiring DB user accounts in Oracle Oracle
  • Histogram Overview Oracle
  • get_vmstat_solaris Oracle
  • adding new line after specific pattern using sed Linux/Unix
  • Good link for LIO in Oracle ( Logical IOs) Oracle
  • Oracle 11g Environment Setup Oracle
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Goldengate document from Porus Oracle
  • Add new columns in dataframe Python/PySpark
  • tblwopk.sql /* Find Tables Without PK */ Oracle
  • find_cons.sql Oracle
  • myfile Oracle
  • sid_wise_sql.sql Oracle
  • Nice notes on wait events Oracle
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle

Category: SQL scripts

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…

Read More “tblwopk.sql /* Find Tables Without PK */” »

Oracle, SQL scripts

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…

Read More “find_pk.sql /* Find Primary Key */” »

Oracle, SQL scripts

fkwoindex.sql /* Find FK without Index */

Posted on 02-Aug-2005 By Admin No Comments on fkwoindex.sql /* Find FK without Index */

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…

Read More “fkwoindex.sql /* Find FK without Index */” »

Oracle, SQL scripts

findx.sql /* Find Indexes on specified USER.TABLE_NAME */

Posted on 02-Aug-2005 By Admin No Comments on findx.sql /* Find Indexes on specified USER.TABLE_NAME */

accept usrnm prompt “Enter The User Name -> ” accept tblnm prompt “Enter The Table Name -> ” select index_name, substr(column_name,1,15) “Colm Name”, column_position “Position” from dba_ind_columns where table_name = upper(‘&tblnm’) and table_owner = upper(‘&usrid’) order by index_name, column_position;

Oracle, SQL scripts

tab.sql

Posted on 02-Aug-2005 By Admin No Comments on tab.sql

select table_name, tablespace_name from dba_tables where owner = upper(‘&usrnm’) order by table_name /

Oracle, SQL scripts

login.sql

Posted on 02-Aug-2005 By Admin No Comments on login.sql

REM Author : Paresh Mehta REM Created : June 4, 2004 REM Purpose : Change the look of sql prompt (for 9i). set echo off set numwidth 9 set linesize 100 set pagesize 24 Set head off set time on set timing on define _PVMUSRNM=”” column USERNAME new_value _PVMUSRNM; column name new_value _PVMDBSTR; select username…

Read More “login.sql” »

Oracle, SQL scripts

block_ident.sql

Posted on 02-Aug-2005 By Admin No Comments on block_ident.sql

select /*+ all_rows */ distinct owner, segment_name, segment_type from dba_extents where file_id = &filid and &blkid between block_id and block_id+blocks-1;

Oracle, SQL scripts

eplan.sql

Posted on 02-Aug-2005 By Admin No Comments on eplan.sql

truncate table plan_table; EXPLAIN PLAN SET STATEMENT_ID = ‘pvm’ FOR select distinct owner, segment_name, segment_type from dba_extents where file_id = &filid and &blkid between block_id and block_id+blocks-1; — syntax for viewing information from plan_table SELECT LPAD(‘ ‘,2*(LEVEL-1))||operation||’ ‘||options ||’ ‘||object_name ||’ ‘|| DECODE(id, 0, ‘Cost = ‘||position) “Query Plan” FROM plan_table START WITH id =…

Read More “eplan.sql” »

Oracle, SQL scripts

refre.sql

Posted on 02-Aug-2005 By Admin No Comments on refre.sql

REM Author : Paresh Mehta REM Created : June 4, 2004 REM Purpose : Change the look of sql prompt (for 9i). set echo off set numwidth 9 set linesize 100 set pagesize 24 Set head off set time on set timing on define _PVMUSRNM=”” column USERNAME new_value _PVMUSRNM; column name new_value _PVMDBSTR; select username…

Read More “refre.sql” »

Oracle, SQL scripts

ext#.sql

Posted on 02-Aug-2005 By Admin No Comments on ext#.sql

/* USER_EXTENTS describes the extents comprising the segments owned by the current user’s objects. This view does not display the OWNER, FILE_ID, BLOCK_ID, or RELATIVE_FNO columns. Column Datatype NULL Description ————————————————————————————————————— OWNER VARCHAR2(30) Owner of the segment associated with the extent SEGMENT_NAME VARCHAR2(81) Name of the segment associated with the extent PARTITION_NAME VARCHAR2(30) Object Partition…

Read More “ext#.sql” »

Oracle, SQL scripts

Posts pagination

Previous 1 … 30 31 32 … 35 Next

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
  • ext#.sql Oracle
  • Facts about SCN and Rollback Segment Oracle
  • Oracle 11g RAC on OEL 5 and Vmware 2 Oracle
  • findinfo.sql (SQL for getting CPU and Active session info) Oracle
  • DB Console Mainenance. Oracle
  • Giving Grant on v$DATABASE Oracle
  • sid_wise_sql.sql Oracle
  • Check SQL Server edition SQL Server

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme