Wednesday, June 17, 2009

Vmware Server & Workstation

 

===========================
Chapter 1 Intro to VMWARE?
===========================

1) VMWARE Server & Workstation Model:

VM1                VM2                VM3
VIRTUALIZATION SOFTWARE
HOST OPERATING SYSTEM
            HARDWARE
2) VMWARE ESX Server Model:

VM1                VM2                VM3
VIRTUALIZATION SOFTWARE
            HARDWARE

==================================
Hardware Virtualization:
AMD - V
Intel Virtualization Technology (VT)
==================================
Built in OS virtualization as Hypervisor like new MS Products.

Products:

Vmware Player
Vmware Worksatation
Vmware Server
Vmware Infrastructure
Virtual Iron challenger Vmware ESX
Parallels for MAC OS
Vmware Fusion for MAC OS
Linux XEN Open Source

Vmware Worksatation VS Vmware Server
Free                                    Snapshot Manager           
Web console                    Movie Capture
Run as a Service
64GB RAMs of VMs
Run on Server OS            Run on Worksation OS

VM Ware Specifications provided to the operating system(s):

Same processor that is of host processor.
1 Virtual Processor on a host with one or more logical processors.
2 Virtual processors on a host with at leas 2 logocal processors.
3.6 GB on host memory
Maximum Memory 4 GB total available for all virtual machines.
IDE 4 Devices 950 MAX
SCSI 7 devices 950 GB Max
2 Floppy Drives
4 Serial Com ports
2 USB 1.1
3 Virtual Ethernet Card.
9 or more virtual ethernet switches.

VMTN (Vmware technology network) vmware.com/vmtn

===========================
Chapter -2 Planning for deployment. ===========================

Senario - Amy's Cake House

List of systems to be virtualized:

System 1 - Physical to Virtual env P2V runs "Cake App"
System 2- Implementing Win 2008 with file print and email on it.
System 3 - Linux Web Server
System 4 - DC/DHCP/DNS Server for AD Domain.

Physical AD Domain Controller running DHCP.
Vitual AD Secondary Domain Controller

Select the right hardware:

Multi-core CPU's are excellent for VMWare. HT and MultiCore.
1 - Min and max requirements for Wks / Server.
2 - Application Min & Max requirements.

Add 1+2 considering RAM, CPU, Networking, Disk
Divide CPU speed 2 GHz, for example.com:

App1 - CPU 1 Mhz
App2 - CPU 2 Mhz

Dynamic Disk will grow.
Static Disk will not grow. Prefer SATA / SCSI.
Vmware Server do not support SAN/Fibre Channel on virtual machine.

Workaround:

iSCSI / Fibre channel connection over the san put your virtual disk from vmware on that SAN.
You can choose Raid 1,5 or 10.

System 1 - Physical to Virtual env P2V runs "Cake App"
System 2- Implementing Win 2008 with file print and email on it.
System 3 - Linux Web Server
System 4 - DC/DHCP/DNS Server for AD Domain.

CPU - Dual core system of 3.5 Mhz CPU.
Memory - 3GB + 1 GB Host OS = 4 GB should be fine. Add 1 GB for the room for growth.

What should be virtualize:
Print server / Web Server / Networking Monitoring Server

What NOT should be virtualize:
SQL Server with multiple connections.
Financial applications.
Use ESX Server to run mission critical applications.

How do I consolidate servers ? (P2V)

- Reinstall / rebuild.
- Imaging
- P2V conversion Software, vmware converter.

Wednesday, March 19, 2008

How To Create a Java Program that Search for a Class file in a JAR File

From rreddy:

1) Create a file called
"SearchJars.java"

2) Put this code and save the file:

 package mypackage7;

import java.util.zip.*;
import java.io.*;
import java.util.*;

public class SearchJars {

static String s3;
static String s4 ="";
static int i1 = 0;
static int i2 = 0;

public static void main(String args[]) {
if (args.length != 2) throw new IllegalArgumentException("Wrong Number of Args !! java SearchJars Direcory_Name filename ");
File f1 = new File(args[0]);
s3 = args[1];
traverse(f1);
System.out.println("\n\n============== Results ============================");
System.out.println("Searced "+ i1 +" Files in "+ args[0] +" And Found "+i2 +" Entries. ");
System.out.println(s4);
}


public static void traverse(File f) {
String s1 = f.getAbsolutePath();

if (s1.toUpperCase().indexOf(".JAR") != -1 || s1.toUpperCase().indexOf(".ZIP") != -1 ) {
System.out.println("Searching "+ s1 +" .....");
i1++;
try {
ZipFile zf = new ZipFile(s1);
for (Enumeration entries = zf.entries(); entries.hasMoreElements();) {
String s2 = ((ZipEntry)entries.nextElement()).getName();
if (s2.indexOf(s3) != -1 ) {
System.out.println("Found "+s2 + " In " +s1);
i2++;
s4 = s4 + "Found "+s2 + " In " +s1 + "\n";
}
}
} catch (IOException e) {}
}

if (f.isDirectory()) {
String[] children = f.list();
for (int i=0; i
traverse(new File(f, children[i]));
}
}
}
}

3) Compile with old/new java
"javac SearchJars.java"

4) Run like this if you want to search a class file name like Create.Users.class in $ORACLE_HOME

./java -cp . SearchJars $ORACLE_HOME CreateUsers.class

5) Above cmd will search for whole $ORACLE_HOME and will return the .JAR file in which this class is stored.

6) Very useful in stack traces and verbose outputs to locate which class file is stored in which jar file.

Tuesday, July 17, 2007

Enabling sql trace in OC4J & system wide

http://rreddy.blogspot.com/2006/09/enabling-sql-trace-in-oc4j.html

Select SID,SERIAL#,USERNAME,STATUS from v$session;

::Session level tracing::

exec dbms_system.set_ev( 375,501,10046,12.' ');
execute sys.dbms_system.set_ev(375,501, 10046, 12, '');
execute sys.dbms_system.set_ev(375,501, 10046, 0, '');

::System Wide SQL Tracing::

alter system set events '10046 trace name context forever,level 12';
alter system set events '10046 trace name context off';

For SYSTEM WIDE use this url:

http://www.orafaq.com/wiki/SQL_Trace

Monday, July 16, 2007

How to use TAR for backup [Oracle_Home]

NAME
tar - The GNU version of the tar archiving utility

SYNOPSIS
tar [ - ] A --catenate --concatenate | c --create | d --diff --compare
| --delete | r --append | t --list | u --update | x --extract --get [
options ] pathname [ pathname ... ]

DESCRIPTION
This manual page documents the GNU version of tar , an archiving pro-
gram designed to store and extract files from an archive file known as
a tarfile. A tarfile may be made on a tape drive, however, it is also
common to write a tarfile to a normal file. The first argument to tar
must be one of the options: Acdrtux, followed by any optional func-
tions. The final arguments to tar are the names of the files or direc-
tories which should be archived. The use of a directory name always
implies that the subdirectories below should be included in the
archive.

EXAMPLES
tar -xvvf foo.tar
extract foo.tar

tar -xvvzf foo.tar.gz
extract gzipped foo.tar.gz

tar -cvvf foo.tar foo/
tar contents of folder foo in foo.tar

For more:
http://unixhelp.ed.ac.uk/CGI/man-cgi?tar

Wednesday, July 11, 2007

Create users.ldif using script for ocs.

i=102
while [ $i -lt 503 ]
do
echo "dn: cn=user$i,cn=Users,dc=idc,dc=oracle,dc=com" >> r.ldif
echo "objectclass: top" >> r.ldif
echo "objectclass: person" >> r.ldif
echo "objectclass: inetorgperson" >> r.ldif
echo "objectclass: organizationalperson" >> r.ldif
echo "objectclass: orcluser" >> r.ldif
echo "objectclass: orcluserv2" >> r.ldif
echo "cn: user$i" >> r.ldif
echo "givenname:" user$i >> r.ldif
echo "sn: user$i" >> r.ldif
echo "mail: user$i@bde.idc.oracle.com" >> r.ldif
echo "uid: user$i" >> r.ldif
echo "userpassword: welcome1" >> r.ldif
echo >> r.ldif
i=`expr $i + 1`
done

Thursday, June 14, 2007

How to add USBHDD having NTFS paritions to your RHEL4 box.

In case you are planning to fix up ur USB Drive (NTFS Partitions) on to a RHEL4 with Kernel Version 2.6.9-5.EL.You will need to do the following:

You'll need 2 files:
=============

kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm --> RPM / Binaries you need to have
NTFS detection.ntfsprogs-1.13.1.tar.gz --> This module is like a driver in windows which will add the related drivers to the kernel.Download using command like, its actually pretty quick:

#wget http://prdownloads.sourceforge.net/linux-ntfs/kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm
#wget http://prdownloads.sourceforge.net/linux-ntfs/ntfsprogs-1.13.1.tar.gz

You need to remember:
=================

The volume names of USB Drive.

If not are not aware of you can get from "cat /etc/fstab"Run lsusb & lsmod

lsusb - A utility for displaying information about all USB buses in the system and all devices connected to them.

lsmod - A program to show the status of modules in the Linux Kernel.

You need to logon as ROOT user to install both and mount the partitions.

Steps:
====

1) Once you attach the device to the system.

2) Install the "kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm" & "ntfsprogs-1.13.1.tar.gz" rpm -ivh kernel-module-ntfs-2.6.9-5.EL-2.1.20-0.rr.4.10.i686.rpm modprobe ntfs

3) Check /etc/fstab you'll see something like this:

/dev/sda2 /media/WD_HDD2 ntfs pamconsole,exec,noauto,managed 0 0

/dev/sda5 /media/WD_HDD1 ntfs pamconsole,exec,noauto,managed 0 0

4) In my case I created 2 folders /WD_HDD1 & /WD_HDD2

5) mount /dev/sda5 /WD_HDD1 (HDD Volume Name Partition1)

6) mount /dev/sda2 /WD_HDD2 (HDD Volume Name Partition2)

PS: Always remember to umount / unmount the devices before unplugging or shutting them down.

Thursday, February 8, 2007

VNC Setup on linux

2 Ways to do that:
===============================
1) Easier way is to edit:

/.vnc/xstartup

Comment all existing lines in the file and ADD

# Red Hat Linux VNC session startup script
exec /etc/X11/xinit/xinitrc

Your /etc/X11/xinit/xinitrc should look like this:

$$$$$$$$$$$$$$$$$$$$$$$$$$$
#!/bin/sh
# Copyright (C) 1999 - 2004 Red Hat, Inc. All rights reserved. This
# copyrighted material is made available to anyone wishing to use, modify,
# copy, or redistribute it subject to the terms and conditions of the
# GNU General Public License version 2.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common

# The user may have their own clients they want to run. If they don't,
# fall back to system defaults.
if [ -f $HOME/.Xclients ]; then
exec $DBUS_LAUNCH $HOME/.Xclients || \
exec $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
exec $DBUS_LAUNCH /etc/X11/xinit/Xclients || \
exec /etc/X11/xinit/Xclients
else
# failsafe settings. Although we should never get here
# (we provide fallbacks in Xclients as well) it can't hurt.
xclock -geometry 100x100-5+5 &
xterm -geometry 80x50-50+150 &

if [ -x /usr/X11R6/bin/twm ]; then
exec /usr/X11R6/bin/twm
fi
fi
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

================================
2) VNC Setup on linux
cat cd ~/.vnc/xstartup

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#twm &
#startkde &
exec gnome-session &

Start the vncserver with the following ,

vncserver -depth 16 -geometry 800x600

Create an alias in $HOME/.bash_profile

alias startvnc='vncserver -depth 16 -geometry 800x600'