Sunday, March 31, 2013

Find out database size

Below query to use we can find  out database size.

For Non-RAC database:

select DATA.TOTAL/1024/1024 "DataFile Size Mb",
       LOG.TOTAL/1024/1024 "Redo Log Size Mb",
       CONTROL.TOTAL/1024/1024 "Control File Size Mb",
       (DATA.TOTAL + LOG.TOTAL + CONTROL.TOTAL)/1024/1024 "Total Size Mb" from dual,
        (select sum(a.bytes) TOTAL from dba_data_files a) DATA,
        (select sum(b.bytes) TOTAL from v$log b) LOG,
        (select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;


For RAC database:

select DATA.TOTAL/1024/1024 "DataFile Size Mb",
LOG.TOTAL/1024/1024 "Redo Log Size Mb",
CONTROL.TOTAL/1024/1024 "Control File Size Mb",
(DATA.TOTAL + LOG.TOTAL + CONTROL.TOTAL)/1024/1024 "Total Size Mb" from dual,
(select sum(a.bytes) TOTAL from dba_data_files a) DATA,
(select sum(b.bytes) TOTAL from gv$log b) LOG,
(select sum((cffsz+1)*cfbsz) TOTAL from x$kcccf c) CONTROL;



Thursday, March 28, 2013

OS Specific Commands



OS
SWAP
RAM
OS VERSION
AIX
/usr/sbin/lsps -a
/usr/sbin/lsattr -HE -l sys0 -a realmem
oslevel
HP PA-RISC
swapinfo -a
grep "Physical:" /var/adm/syslog/syslog.log
uname -a
HP Itanium
swapinfo -a
/usr/contrib/bin/machinfo | grep -i Memory
uname -a
Tru64
swapon -s
vmstat -P
/usr/sbin/sizer -v
Solaris
swap -l
/usr/sbin/prtconf | grep -i memory
uname -r
Linux
free
free
uname -a
Mac OS X
# df -h /
# /usr/sbin/system_profiler SPHardwareDataType | grep Memory
# sw_vers


OS
LOCATION
COMMAND TO SEARCH
AIX
automatically configured
do 'env' for LINK_CNTRL,
To determine if AIX is 64 bit enabled do 'genkex | grep 64' or 'genkex | grep call'
HP
/stand/system or use SAM -->Kernel Configuration
/etc/sysdef, /usr/sbin/kmtune (kmtune desupported in 11.31, use /usr/sbin/kctune -v), or /usr/sbin/kcweb -F
Tru64
/etc/sysconfigtab
/sbin/sysconfig -q ipc or /sbin/sysconfig -q vm or /sbin/sysconfig -q proc
Solaris
/etc/system
"/etc/sysdef | grep SHM" or "/etc/sysdef | grep SEM"
Linux
/usr/src/linux/include/asm/shmparam.h
/usr/src/linux/include/linux/sem.h
/proc/sys/kernel/sem
/proc/sys/kernel/shmall
/proc/sys/kernel/shmmax
/proc/sys/kernel/shmmni
ipcs -lms
Mac OS X
/etc/sysctl.conf
"# /usr/sbin/sysctl -a | grep "


OS
COMMAND FOR PACKAGES
COMMAND FOR PATCHES
AIX
lslpp -w | grep -i "software title" (applies to APARs and PTFs)
/usr/sbin/instfix -ik patch number
HP
Prior to 11: /usr/sbin/swlist -lproduct PH\* hp-ux 11 and after: * /usr/sbin/swlist -l patch \*\.*,c=patch * /usr/contrib/bin/show_patches (from patch PHCO_19550)
/usr/sbin/swlist -l fileset | grep -i
Solaris
/bin/pkginfo -l | grep -i "software title"
/bin/showrev -p
Tru64
/usr/sbin/setld -i | grep -i "software title"
/usr/sbin/setld -i | more
For patchkits:
/usr/sbin/dupatch -track -type kit
Linux

To see if a particular RPM is installed (without the architectur):
$ rpm -qa | grep "package name"

To see if a particular RPM is installed (with the architectur):
$ rpm -qa --qf "%{NAME}-%{VERSION}-%{RELEASE}_%{ARCH}\\n" | grep "package name"

To see what RPM provided a particular object/library:
$ rpm -q --whatprovides --qf "%{NAME}-%{VERSION}-%{RELEASE}_%{ARCH}\\n" "full path/library name"

To see the contents listing of an RPM:
$ rpm -ql "RPM name"
For example: $ rpm -ql compat-libstdc++-33-3.2.3-47.3.ppc
/usr/lib/libstdc++.so.5
/usr/lib/libstdc++.so.5.0.7
Mac OS X
to be supplied later
to be supplied later

To Check if an OS is 64 bit Capable or not

OS
COMMAND
RESULTS
Aix
lslpp -L | grep 64bit
It should return "bos.64bit"
HP
getconf KERNEL_BITS
It should return "64"
Solaris
/bin/isainfo -kv
If the isainfo command does not exist it is not 64-bit. It should return "64-bit sparcv9 kernel modules"