Think Foward Logo Tested on Oracle 7 Tested on Oracle 8.0 Tested on Oracle 8i Tested on Oracle 9i Tested on Oracle 10g

Shell Script

Number Of CPUS

Updated: 24-Nov-2004
Version: 1.0

Description

A UNIX platform independent script which displays the number of CPUS on a server

Parameters


SQL Source

REM Copyright (C) Think Forward.com 1998- 2005. All rights reserved. 
#!/bin/sh # # ncpu - display the number of active/enabled/online CPUs # PATH=$PATH:/usr/sbin # for psrinfo, sysctl uname=`uname` case "$uname" in AIX) lsdev -C -c processor -S Available|grep -c . # wc -l formats funny ;; *BSD|*bsd|Darwin) sysctl -n hw.ncpu ;; HP-UX) # does this work for non-root users? ioscan -fnkC processor|grep -c '^processor' ;; IRIX*) # IRIX, IRIX64 hinv -c processor|head -1|awk '{print $1}' ;; Linux) if test -f /proc/cpuinfo; then grep -c '^processor' /proc/cpuinfo else echo "$0: no /proc/cpuinfo" 2>&1 exit 1 fi ;; OSF1|SunOS) psrinfo|grep -c on-line ;; *) echo "$0: unknown uname '$uname'" 2>&1 exit 1 ;; esac exit 0

Return to Index of SQL Scripts


Site Map

General Information : Home | Company Profile | Contact Us | Legal
Database Support : Proactive Support | Pay Per Incident Support
Expert Services : High Availability | Creative Solutions | Training
Build Services : Oracle Installations | Revive your Oracle Setup | Low Cost Development
Free Oracle Resources: DBA Scripts | Oracle Links