Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • Search and Replace vi editor command. Linux/Unix
  • Sending SQLPLUS output in HTML format Oracle
  • Very clear article about oracle dataguard Oracle
  • database trigger failing Oracle
  • find_log_switch.sql Find log switches in graphical manner Oracle
  • Good Oracle Architecture In Short and point to point Oracle
  • Export Oracle data and Compress at same time Oracle
  • ipcs -l Linux/Unix
  • Changing the Global Database Name Oracle
  • usnsql.sql Displays information about UNDO segments with sql statements Oracle
  • runsql_once.ksh Linux/Unix
  • oracle fast start failover best practice Oracle
  • How to hide author name in WordPress BLOG PHP/MYSQL/Wordpress
  • 556976.1 Oracle Clusterware: Components installed Oracle
  • TABLE SIZING WITH DB_BLOCK ARCHITECTURE Reference : Metalink note : 10640.1 Oracle

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

  • To seee semaphores and shared memory segments in Solaris Linux/Unix
  • Useful Solaris Commands on 28-SEP-2005 Linux/Unix
  • Search and Replace vi editor command. Linux/Unix
  • Important Solaris Commands Linux/Unix
  • proper cpu stats Linux/Unix
  • Changing default shell 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 (387)
  • PHP/MYSQL/Wordpress (10)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (336)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • 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
  • Reading config file from other folder inside class24-Sep-2024
  • Python class import from different folders22-Sep-2024
  • Transfer SQL Profiles from One database to other database.05-Sep-2024
  • Load testing on Oracle 19C RAC with HammerDB18-Jan-2024
  • Add new columns in dataframe30-Sep-2023

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Unix command for system configuration Linux/Unix
  • CPU speed on solaris Linux/Unix
  • OEM-Commnds Oracle
  • Korn Shell Arithmatic Linux/Unix
  • Oracle 10g for solaris 10 Oracle
  • Restoring a user’s original password 1051962.101 Oracle
  • oracle_env_10g_CADEV Linux/Unix
  • refre.sql Oracle

Copyright © 2025 pvmehta.com.

Powered by PressBook News WordPress theme