Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Display the top 5 salaries for each department using single SQL Oracle
  • scripts to take listener.log backup Linux/Unix
  • DBMS_Shared_pool pinning triggers Oracle
  • Some useful Unix Commands Linux/Unix
  • Implementing Listener Security Oracle
  • ORA-8031 issue and solution if it is occuring due to truncate. Oracle
  • TNSNAMES entries details Oracle
  • Benefits and Usage of RMAN with Standby Databases Oracle
  • My Test Case On 21-OCT-2005 Oracle
  • tab.sql Oracle
  • Oracle10g – Using SQLAccess Advisor (DBMS_ADVISOR) with the Automatic Workload Repository Oracle
  • sesswait.sql Oracle
  • Create type and Grant on it. Oracle
  • get_vmstat_linux Oracle
  • find checksum of a file. Linux/Unix

Author: Admin

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

sesswait.sql

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

set pages 300 set lines 151 column event format a30 column p1_detail format a25 column p2_detail format a15 column p3_detail format a5 column sid format a15 column wait_time format 999999 column seconds_in_wait format 999999999 column state format a30 word_wrapped select A.SID ||’,’ || A.seq# sid , A.EVENT, A.P1TEXT || ‘=’ || A.P1 p1_detail, A.P2TEXT ||…

Read More “sesswait.sql” »

Oracle, SQL scripts

Wait time tuning research

Posted on 02-Aug-2005 By Admin No Comments on Wait time tuning research

http://www.dba-oracle.com/art_otn_waits.htm v$session.paddr = v$process.addr v$session.sid = v$session_wait.sid v$session.sql_address = v$sqlarea.address v$session.sql_hash_value = v$sqlarea.hash_value v$session.sql_id = v$sqlares.sql_id v$session.server shows Dedicated or MTS configuration. The fields module and action of v$session can be set with dbms_application_info.set_module. The field client_info can be set with dbms_application_info.set_client_info Join sid with v$sesstat if you want to get some statistical information for…

Read More “Wait time tuning research” »

Oracle, SQL scripts

crtgr.sql /* For creating trigger from data dictionary */

Posted on 02-Aug-2005 By Admin No Comments on crtgr.sql /* For creating trigger from data dictionary */

SET LONG 1000000 UNDEFINE trigger_name SET PAGES 0 SET FEEDBACK OFF SET LINES 132 set echo off set numwidth 9 Set head off set verify off set time off set timing off COLUMN text FORMAT A302 word_wrapped COLUMN spool_name NEW_VALUE spool_name NOPRINT SELECT lower(trigger_name||’.ctr’) spool_name FROM dba_triggers WHERE trigger_NAME = UPPER(‘&&trigger_name’); SPOOL &spool_name select ‘CREATE…

Read More “crtgr.sql /* For creating trigger from data dictionary */” »

Oracle, SQL scripts

eplan9i.sql

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

set pages 300 set lines 100 truncate table plan_table; EXPLAIN PLAN SET STATEMENT_ID = ‘pvm’ FOR SELECT * FROM emp; SELECT rpad(cardinality, 10, ‘ ‘) || ‘ ‘ || rpad(cost, 10, ‘ ‘) || ‘ ‘ || lpad(‘ ‘,level-1)||operation||’ ‘|| options||’ ‘||object_name “Rows Cost Plan” FROM PLAN_TABLE CONNECT BY prior id = parent_id AND prior…

Read More “eplan9i.sql” »

Oracle, SQL scripts

Rename Oracle Instance Name

Posted on 02-Aug-2005 By Admin No Comments on Rename Oracle Instance Name

Renaming oracle instance (from UOCTEST to UAS) Note : Remember to rename datafile, logfile, controlfile, parameterfile and passwordfile. Aslo need to change listener. ******** Parameter File *************************** (1) check whether instance is using SPFIlE. using “show parameter spfile” (2) SQL> connect / as sysdba SQL> “create pfile from spfile” in 10g by default it will…

Read More “Rename Oracle Instance Name” »

Oracle, SQL scripts

PLSQL Table Syntax 2

Posted on 02-Aug-2005 By Admin No Comments on PLSQL Table Syntax 2

DECLARE TYPE EmpTabTyp IS TABLE OF emp%ROWTYPE INDEX BY BINARY_INTEGER; emp_tab EmpTabTyp; BEGIN /* Retrieve employee record. */ SELECT * INTO emp_tab(7468) FROM emp WHERE empno = 7468; END;

Oracle, SQL scripts

Posts pagination

Previous 1 … 50 51 52 … 56 Next

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
  • RAC with RHEL4 and 11g Oracle
  • Pending Transaction Neighbors Script Oracle
  • Oracle Release Explaination Oracle
  • Another export with Query Oracle
  • backspace in SQL Plus not working then..? Linux/Unix
  • Example of How To Resize the Online Redo Logfiles Note:1035935.6 Oracle
  • DBMS_UTILITY.ANALYZE_SCHEMA Oracle
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme