Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Oracle Release Explaination Oracle
  • oracle 10g on linux Linux/Unix
  • Oracle Internal Good Websites 1 Oracle
  • find_err.sql for finding errors from dba_errors. Oracle
  • How to find pinned objects from shared pool. (pinned via dbms_shared_pool.keep) Oracle
  • pvmehta.com SQL scripts
    Find which sessions is accessing object that prevent your session to have exclusive locks in Oracle Oracle
  • Locktree.sql Oracle
  • Small sample shell program Linux/Unix
  • T-SQL Vs PL/SQL Syntax SQL Server
  • Zip and unzip with tar Linux/Unix
  • Temporary tablespace explaination Oracle
  • How to sort list of files on basis of their sizes. Linux/Unix
  • Find Plan Hash value fphv.sql Oracle
  • reset Sequence Oracle
  • SAN 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

  • CPU Core related projections AWS
  • find the files that are 1 day old. Linux/Unix
  • Logic to chech # of parameters command line parameters Linux/Unix
  • More info about /proc folder and its relation with processes. Linux/Unix
  • Removing Ctrl-M from end of line using vi Linux/Unix
  • scp with ssh2 Linux/Unix

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (399)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (150)
  • SQL scripts (347)
  • SQL Server (6)
  • Uncategorized (3)
  • Videos (0)

Recent Posts

  • find_arc.sql09-Apr-2026
  • pvm_pre_change.sql08-Apr-2026
  • find_encr_wallet.sql08-Apr-2026
  • find_pdbs.sql08-Apr-2026
  • Creating a Container Database using dbaascli08-Apr-2026
  • track_autoupgrade_copy_progress.sql01-Apr-2026
  • refre.sql for multitenant01-Apr-2026
  • prepfiles.sh for step by step generating pending statistics files10-Mar-2026
  • tracksqltime.sql05-Mar-2026
  • Complete Git Tutorial for Beginners25-Dec-2025

Archives

  • 2026
  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • backspace in SQL Plus not working then..? Linux/Unix
  • Load testing on Oracle 19C RAC with HammerDB Oracle
  • Reclaim temp tablespace for oracle 8, 8i Oracle
  • Remove DOS CR/LFs (^M) Linux/Unix
  • Debugging Shell FIles Linux/Unix
  • Search and replace pattern Linux/Unix
  • Find average Row Length and other table size calculation. metalink notes Oracle
  • Kernel Parameters for Solaris Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme