Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • 284785.1 How to check RAC Option is currently linked into the Oracle Binary Oracle
  • Set Role explaination. Oracle
  • chk_space_SID.ksh Linux/Unix
  • mutex in Oracle 10.2.0.2 or Oracle 10g Oracle
  • Gather Stats manually using DBMS_STATS after disabling DBMS_SCHEDULER jobs as previous entry Oracle
  • dbms_job.submit example Oracle
  • Order by with ROWNUM Oracle
  • column level grant syntax Oracle
  • Oracle 11g Environment Setup Oracle
  • Roles and Stored Procs II Oracle
  • Processes parameter and its dependencies on OS kernel parameters Linux/Unix
  • sid_wise_cursor.sql find open cursor basis on username or SID Oracle
  • V$ROLLSTAT status is Full Oracle
  • Specify the Rollback segment to use in Transaction Oracle
  • checking redhat linux version Linux/Unix

Some useful Unix Commands

Posted on 05-Oct-2006 By Admin No Comments on Some useful Unix Commands

(1) Find all SQL files that contain “dba” pattern in current directory.

find . -name “*sql” -print | xargs grep -i “dba”

(2) script to kill all Oracle background processes for a database. This is a common Unix script used by Oracle DBAs when a database is

locked up, and Server Manager cannot be used to stop the database in a more “gentle” fashion.

ps -ef|grep “ora_”|grep -v grep|grep $ORACLE_SID|awk ‘{print $2}’|xargs kill -9

Also, you can alias above long command to make it handy as following:

alias nuke_oracle=”ps -ef|grep ‘ora_’|grep -v grep|grep $ORACLE_SID|awk ‘{ print $2 }’|xargs kill -9″

(3)

nohup run_sql.ksh > logfile.lst 2>&1 &

nohup: Submits the task so that it continues to run even after you disconnect your terminal session.

run_sql.ksh : Specifies the Unix shell script that you want to run in the background.

> logfile.lst : Redirects standard output to the specified file.

2 > &1 : Redirects standard error messages to the standard output device. The 2 represents the standard error device, and 1 represents the standard output device.

& : Runs the task in the background. You need to have a space in front of the trailing ampersand (&) character, and it’s that & that causes the task to run as a background task.

Linux/Unix, shell

Post navigation

Previous Post: Logic to chech # of parameters command line parameters
Next Post: Validating ORACLE_SID againt oratab file.

Related Posts

  • fdisk -l explaination about Primary-Logical-Extended Partitions Linux/Unix
  • ipcs -l Linux/Unix
  • Jai Shree Ram Linux/Unix
  • copying/removing directory with all its subdirectory Linux/Unix
  • Reading parameter file and printing Linux/Unix
  • find_du.ksh to find # of files, their sizes in current folder and its subdolder Linux/Unix

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
  • How to find the real execution plan and binds used in that explain plan in Oracle 10g?? Oracle
  • Drop all SPM baselines for SQL handle Oracle
  • column level grant syntax Oracle
  • How to change hostname in Linux Linux/Unix
  • Zip and unzip with tar Linux/Unix
  • How to sort list of files on basis of their sizes. Linux/Unix
  • Metalink Note: Note:250655.1 : ADDM Basics USING THE AUTOMATIC DATABASE DIAGNOSTIC MONITOR Oracle
  • pvm_pre_change.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme