Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • get_aix_vmstat.ksh Oracle
  • cp_filesystem.sql Oracle
  • Very Good Oralce Internal Tuning Book Oracle
  • Privilege to describe the table. Oracle
  • upload.html PHP/MYSQL/Wordpress
  • SYSOPER Mystery Oracle
  • RMAN : Consistent Backup, Restore and Recovery using RMAN Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • Find sort details from Db find_sort.sql Oracle
  • DBMS_UTILITY.ANALYZE_SCHEMA Oracle
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • Goog notes on X$ tables Oracle
  • How to analyze statspack or AWR report. Oracle
  • mutex in Oracle 10.2.0.2 or Oracle 10g Oracle
  • rm_backup_arch_file.ksh Linux/Unix

Year: 2006

find_open_cur.sql Find open cursorts per session

Posted on 10-Mar-2006 By Admin No Comments on find_open_cur.sql Find open cursorts per session

set lines 132 set pages 300 column numopencursors format d8 column machine format a30 column osuser format a20 column username format a20 SELECT s.sid, v.value as numopencursors ,s.machine ,s.osuser,s.username FROM V$SESSTAT v, V$SESSION s WHERE v.statistic# = 3 and v.sid = s.sid ;

Oracle, SQL scripts

TRUNCATE Privs

Posted on 10-Mar-2006 By Admin No Comments on TRUNCATE Privs

To truncate a table or cluster, the table or cluster must be in your schema or you must have DROP ANY TABLE system privilege.

Oracle, SQL scripts

Single character replacement in Unix

Posted on 08-Mar-2006 By Admin No Comments on Single character replacement in Unix

uocdbprod21->WEBARCH@(/db2/oradata)ls -rlt /db?/oradata/WEBP18F /db6/oradata/WEBP18F: total 0 /db5/oradata/WEBP18F: total 0 /db3/oradata/WEBP18F: total 0 /db4/oradata/WEBP18F: total 0 /db2/oradata/WEBP18F: total 0 uocdbprod21->WEBARCH@(/db2/oradata)

Linux/Unix, shell

Create type and Grant on it.

Posted on 06-Mar-2006 By Admin No Comments on Create type and Grant on it.

conn cs/XXX Create TYPE VARCHAR2_ARRAY AS VARRAY(5000) OF VARCHAR2(50); Grant execute on VARCHAR2_ARRAY to r_exec_cs;

Oracle, SQL scripts

Flowers Resize datafiles

Posted on 02-Mar-2006 By Admin No Comments on Flowers Resize datafiles

In flowers we resize datafile using following command: alter database resize datafile ‘/path1/filename.dbf’ resize 500M; this will change that datafles ‘SIZE’ column and allocate that much space for that datafile. If you are having standby database pls make sure that enough space is available for that file expansion.

Oracle, rman-dataguard

age_alert.ksh aging out alert.log

Posted on 28-Feb-2006 By Admin No Comments on age_alert.ksh aging out alert.log

!/bin/ksh . /export/home/oracle/envs/oracle_env_PNETP save_date=`date +%Y%m%d%H%M` # Set ORATAB variable if [ -f /etc/oratab ] ; then ORATAB=/etc/oratab else if [ -f /var/opt/oracle/oratab ] ; then ORATAB=/var/opt/oracle/oratab else echo “” echo “`date` Cannot find oratab!” echo “” exit 2 fi fi export ORATAB # search the alert log for errors for all databases # for ORACLE_SID…

Read More “age_alert.ksh aging out alert.log” »

Linux/Unix, shell

cur_sql.sql

Posted on 27-Feb-2006 By Admin No Comments on cur_sql.sql

spool cur_sql set lines 132 set pages 300 col USR format a14 col PAR heading “Parsing ID” format 9999999 col ELA heading “ELP time(Sec)” format 9999999.0 col HASH heading “Hash Value” col USR heading “Parsing User” col T heading “SQL Text having Elapsed time > 1 sec” break on HASH on USR on ELA skip…

Read More “cur_sql.sql” »

Oracle, SQL scripts

avail.sh ( find filesystem spae usage)

Posted on 23-Feb-2006 By Admin No Comments on avail.sh ( find filesystem spae usage)

df -k | grep -i “/EMCdb”|awk ‘{tot += $2; used += $3; avail += $4;} END {print “Total”,tot/1024/1024,”Used “,used/1024/1024,”Avail “avail/102 4/1024, “Avail % ” avail*100/tot, “Used % ” used*100/tot}’ df -k | grep -i “/testdb”|awk ‘{tot += $2; used += $3; avail += $4;} END {print “Total”,tot/1024/1024,”Used “,used/1024/1024,”Avail “avail/10 24/1024, “Avail % ” avail*100/tot, “Used…

Read More “avail.sh ( find filesystem spae usage)” »

Linux/Unix, shell

Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry

Posted on 22-Feb-2006 By Admin No Comments on Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry

. $ENV_FILE echo “Started Analyze Schema of $SCHEMA_NAME at `date +%D-%T`” $ORACLE_HOME/bin/sqlplus -s DBMS_STATS.DEFAULT_DEGREE, cascade => TRUE, granularity=> ‘ALL’ ); EOF echo “Ended at `date +%D-%T`” – Script End Also, configure cron for execution on every sunday 11.00 PM as following. 00 11 * * 0 /export/home/oracle/oraprocs/analyze_schema.ksh /oracle/app/oracle/oraprocs/ora_SID.env CIF > /export/home/oracle/oraprocs/logs/analyze_schema_CIF.log 2> /export/home/oracle/oraprocs/logs/analyze_schema_CIF.err

Oracle, SQL scripts

Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry

Posted on 22-Feb-2006 By Admin No Comments on Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry

Follwing is the script for manually gathering Stats using DBMS_STATS. Execution will be like ./analyze_schema.ksh /oracle/app/oracle/oraprocs/ora_SID.env CIF – Script Start #!/usr/bin/ksh ########## Configuration ############# ENV_FILE=$1 SCHEMA_NAME=$2

Oracle, SQL scripts

Posts pagination

Previous 1 … 7 8 9 … 11 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
  • Zip and unzip with tar Linux/Unix
  • How to specify 2 arch location to avoid any kind of DB hanging. Oracle
  • telnet listening Linux/Unix
  • To see only files and/or folders using LS command Linux/Unix
  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • Another Tuning Article for subheap of shared pool Oracle
  • database trigger failing Oracle
  • move_arch_files.ksh Linux/Unix

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme