Странице

Ознаке

четвртак, 4. септембар 2014.

Increase SWAP size in Oracle Linux

Let's say you need another 500M:
dd if=/dev/zero of=/tmp/swapfile bs=1M count=500
mkswap /tmp/swapfile
swapon /tmp/swapfile
After you're done installing, you can turn it off.
swapoff /tmp/swapfile
rm /tmp/swapfile

Linux Debian/Ubuntu version

cat /etc/issue
lsb_release -a
cat /etc/lsb-release

List tar archive content

tar ztf filename
tar ztf filename |less
List only directories:
gunzip -c mytarfile.tar.gz | tar tvf - |grep "^d" |more
List the contents of a tar.gz file
tar -ztvf file.tar.gz
List the contents of a tar.bz2 file
tar -jtvf file.tar.bz2

Find all symbolic links on system

find / -type l -exec ls -l {} \;
find / -type l -exec ls -l {} \; > /home/admin/symlinks.txt

Grep examples

grep "text string to search" directory-path
grep [option] "text string to search" directory-path
grep -r "text string to search" directory-path
grep -r -H "text string to search" directory-path
egrep -R "word-1|word-2" directory-path
egrep -w -R "word-1|word-2" directory-path

 Recursively Search All Files For A String:
cd /path/to/dir
grep -r "word" .
grep -r "string" .
Ignore case distinctions:
grep -ri "word" .
To display print only the filenames with GNU grep, enter:
grep -r -l "foo" .
You can also specify directory name:

grep -r -l "foo" /path/to/dir/*.c

Password protect ZIP archive

zip -e -r test test

List network cards

List network cards(different methods):
lspci | egrep -i --color 'network|ethernet'
 lshw -class network
 ifconfig -a
 ip link show
 ip a
 cat /proc/net/dev

Ping monitor script

Ping script for monitoring servers:
#!/bin/bash
# Simple SHELL script for Linux and UNIX system monitoring with
# ping command
# -------------------------------------------------------------------------
# Copyright (c) 2006 nixCraft project <http://www.cyberciti.biz/fb/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
# Setup email ID below
# See URL for more info:
# http://www.cyberciti.biz/tips/simple-linux-and-unix-system-monitoring-with-ping-command-and-scripts.html
# -------------------------------------------------------------------------

# add ip / hostname separated by white space
HOSTS="cyberciti.biz theos.in router"

# no ping request
COUNT=1

# email report when
SUBJECT="Ping failed"
EMAILID="me@mydomain.com"
for myHost in $HOSTS
do
  count=$(ping -c $COUNT $myHost | grep 'received' | awk -F',' '{ print $2 }' | awk '{ print $1 }')
  if [ $count -eq 0 ]; then
    # 100% failed
    echo "Host : $myHost is down (ping failed) at $(date)" | mail -s "$SUBJECT" $EMAILID
  fi
done

Monitoring listening ports

Which ports are listening for TCP connections from the network:
nmap -sT -O localhost
Check if the port is associated with the official list of known services:
cat /etc/services | grep 834
Check for port 834 using netstat:
netstat -anp | grep 834
 Check for port 834 using lsof:
lsof -i | grep 834

среда, 3. септембар 2014.

Find ORG ID

Query to find ORG_ID in R12
SELECT fnd_profile.VALUE('ORG_ID') FROM dual;

Component Versions

Component Versions in Apps 11i/R12 ->

-> Apps Version (11i/R12/12i).
SQL> select release_name from apps.fnd_product_groups;
-> Web Server/Apache or Application Server in Apps 11i/R12
$IAS_ORACLE_HOME/Apache/Apache/bin/httpd -version
-> Forms & Report version (aka developer 6i) in 11i
$ORACLE_HOME/bin/f60run | grep Version | grep Forms
-> Forms & Report version in R12/12i
$ORACLE_HOME/bin/rwrun | grep Release
-> Oracle Jinitiator in 11i/R12/12i
grep jinit_ver_comma $CONTEXT_FILE
-> Oracle Java Plug-in in 11i/R12/12i
grep plugin $CONTEXT_FILE
-> File Version on file system
adident Header
strings | grep Header
-> Version of pld file
adident Header $AU_TOP/resource/.pll
strings $AU_TOP/resource/.pll | grep -i header
-> OA Framework Version

11i - http:// hostname.domainName:port/OA_HTML/OAInfo.jsp
adident Header $FND_TOP/html/OA.jsp
adident Header $OA_HTML/OA.jsp
-> Discoverer Version for 11i (3i or 4i)
$ORACLE_HOME/bin/disc4ws | grep -i Version
-> Workflow Version with Apps
SQL> select TEXT Version from   WF_RESOURCES where  NAME = ‘WF_VERSION’;
-> Identity Management component Version/Release Number
SQL>select version from orasso.wwc_version$;
-> Oracle Internet Directory
There are two component in OID (Software/binaries & Schema/database)
>>> To find software/binary version
$ORACLE_HOME/bin/oidldapd -version
- To find Schema Version/ database use
ldapsearch -h -p -D “cn=orcladmin” -w “” -b “” \
-s base “objectclass=*” orcldirectoryversion
SQL> select attrval from ods.ds_attrstore where entryid = 1 and attrname = ‘orcldirectoryversion’;
-> Application Server
a. Oracle Application Server 10g Rel 3 (10.1.3.X)
cat $ORACLE_HOME/config/ias.properties | grep Version
b. For Oracle Application Server 10.1.2 (Prior to Oracle WebLogic Server)
If application server is registered in database (Portal, Discoverer) check from database
SQL> select * from ias_versions;
or
SQL>select * from INTERNET_APPSERVER_REGISTRY.SCHEMA_VERSIONS;
c. AOC4J (Oracle Container for J2EE)
cd $ORACLE_HOME/j2ee/home
java -jar oc4j.jar -version
d. Oracle Portal
SQL> select version from portal.wwc_version$;
-> Database Component
a. Oracle Database
SQL> select * from v$version;
b. All component version in database
$ORACLE_HOME/OPatch/opatch lsinventory -detail
-> Unix Operating System
Solaris -> cat /etc/release
Red Hat Linux -> cat /etc/redhat-release

-> Forms Version in 11i from front end?
Login to forms from frontend , -> Help -> ”About Oracle Applications -> Forms Server

-> How to find if your database is 32 bit or 64 bit
file $ORACLE_HOME/bin/oracle
-> How to find OUI version ?
./runInstaller -help ( From OUI location)
-> How to find Oracle Workflow Cartridge Release Version ?
owf_mgr> select wf_core.translate(\’WF_VERSION\’) from dual;
-> opatch version ?
$ORACLE_HOME/OPatch/opatch version
-> How to Discoverer Version installed with Apps ?
cd $ORACLE_HOME/discwb4/bin
strings dis4ws | grep -i 'discoverer version\'
-> How to find version of JDK Installed on Apps ?
cat $APPL_TOP/admin/$SID_$HOSTNAME.xml  | grep s_jdktop