Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Sunday, 15 April 2018

How to Delete a deployment manually from WebLogic server using wlst offline mode

Steps to delete a deployment(WAR, EAR, JAR) manually through wlst offline mode
Step 1: Set the Weblogic environment by executing the script:- setWLSEnv.sh

[root@pbifmssso ~]# cd /opt/Oracle/Middleware/wlserver_10.3/server/bin

[root@pbifmssso bin]# sh setWLSEnv.sh

CLASSPATH=/opt/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/jdk1.6.0_25/lib/tools.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar: PATH=/opt/Oracle/Middleware/wlserver_10.3/server/bin:/opt/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/opt/jdk1.6.0_25/jre/bin:/opt/jdk1.6.0_25/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/jdk1.6.0_25/bin Your environment has been set.

Step 2: Change the directory path to WL_HOME/common/bin

[root@pbifmssso bin]# cd /opt/Oracle/Middleware/wlserver_10.3/common/bin

Step 3: Run the command sh wlst.sh

[root@pbifmssso bin]# sh wlst.sh

CLASSPATH=/opt/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/jdk1.6.0_25/lib/tools.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar: PATH=/opt/Oracle/Middleware/wlserver_10.3/server/bin:/opt/Oracle/Middleware/modules/org.apache.ant_1.7.1/bin:/opt/jdk1.6.0_25/jre/bin:/opt/jdk1.6.0_25/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/opt/jdk1.6.0_25/bin Your environment has been set.

CLASSPATH=/opt/Oracle/Middleware/patch_wls1035/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/Oracle/Middleware/patch_ocp360/profiles/default/sys_manifest_classpath/weblogic_patch.jar:/opt/jdk1.6.0_25/lib/tools.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/weblogic_sp.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/weblogic.jar:/opt/Oracle/Middleware/modules/features/weblogic.server.modules_10.3.5.0.jar:/opt/Oracle/Middleware/wlserver_10.3/server/lib/webservices.jar:/opt/Oracle/Middleware/modules/org.apache.ant_1.7.1/lib/ant-all.jar:/opt/Oracle/Middleware/modules/net.sf.antcontrib_1.1.0.0_1-0b2/lib/ant-contrib.jar::/opt/Oracle/Middleware/utils/config/10.3/config-launch.jar::/opt/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbynet.jar:/opt/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbyclient.jar:/opt/Oracle/Middleware/wlserver_10.3/common/derby/lib/derbytools.jar:: Initializing WebLogic Scripting Tool (WLST) ... Welcome to WebLogic Server Administration Scripting Shell Type help() for help on available commands wls:/offline>


Step 4: Execute the command as below to remove the deployment say CookieApp from the weblogic Admin server t3://192.168.20.57:7001

>connect(‘weblogic’,'WebL0gic@tcs2011’,'t3://192.168.20.57:7001')
>edit() 
>startEdit() 
>undeploy(‘CookieApp’)
>save()
>exit()
>activate() 

Finally the application CookieApp get deleted, restart the server to remove the cache and tmp folder.


Saturday, 14 April 2018

Linux commands used by a middleware administrator

Linux commands used by a middleware administrator

1. # free -m
> Check free memory

2. # ps -ef | grep java
> Check running process of java

3. # netstat -nulpta |grep 8002 
tcp 0 0 fe80::9a4b:e1ff:fe6a:6:8002 :::* LISTEN 18814/java
tcp 0 0 ::ffff:192.168.20.74:8002 :::* LISTEN 18814/java 
tcp 0 0 ::ffff:192.168.122.1:8002 :::* LISTEN 18814/java 
tcp 0 0 fe80::9a4b:e1ff:fe6a:6:8002 :::* LISTEN 18814/java
> Check the status of a particular port

4. # uname -a
Darwin Roadrunner.local 10.3.0 Darwin Kernel Version 10.3.0: Fri Feb 26 11:58:09 PST 2010; root:xnu-1504.3.12~1/RELEASE_I386 i386
> provide the following information: the name of the kernel, network node host name (e.g., localhost.localdomain), kernel version number and release level (e.g., 2.4.20-6), kernel release date, machine hardware name, CPU (central processing unit) type, hardware platform and operating system name (e.g., GNU/Linux).

5. # getconf KERNEL_BITS, # getconf LONG_BIT, # prtconf | grep Type
> commands to find bit size of your Linux/Unix/HP-UX machine

6. # less /proc/cpuinfo
processor   : 0
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 774.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 0
initial apicid  : 0
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 1
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 1600.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 0
cpu cores   : 2
apicid      : 1
initial apicid  : 1
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 2
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 800.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 2
initial apicid  : 2
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 69
model name  : Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
stepping    : 1
microcode   : 0x17
cpu MHz     : 774.000
cache size  : 4096 KB
physical id : 0
siblings    : 4
core id     : 1
cpu cores   : 2
apicid      : 3
initial apicid  : 3
fpu     : yes
fpu_exception   : yes
cpuid level : 13
wp      : yes
flags       : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 fma cx16 xtpr pdcm pcid sse4_1 sse4_2 movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm ida arat epb xsaveopt pln pts dtherm tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid
bogomips    : 3591.40
clflush size    : 64
cache_alignment : 64
address sizes   : 39 bits physical, 48 bits virtual
power management:
> Commands to check cpu information on Linux

7. # grep $(printf "0x%x" $(getconf _SC_CPU_VERSION)) /usr/include/sys/unistd.h
or
# cat /opt/langtools/lib/sched.models|grep ^`uname -m|cut -c 6-`
861 2.0 PA8000
> Checking the machine

8. # grep "processor" /proc/cpuinfo
processor : 3
> Commands to check cpu information on Linux

9. # cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.8 (Tikanga)
>Command to check OSversion

10. # sync; echo 3 > /proc/sys/vm/drop_caches
> Command to clear cache tmp

11. # /proc/uptime
> Command to check the server uptime.

12. # /var/run/utmp
> Command to check who is currently logged.

13. # vmstat
> Command to find out ram usage command.

14. # swapinfo -tam
> check free memory on hp unix 11.31

15. # UNIX95=1 ps -ef -o vsz,ppid,pid,wchan,comm | sort -rn | head -10
> To find the biggest virtual memory consumers

16. # UNIX95= ps -e -o vsz,uid,pid,args |sort -rn | more
> Memory utilization on HP-UX

17. # dmesg -i | grep physical
> Command to check physical memory

18. # sam, # /usr/sbin/smh
> Command to check free physical memory

19. # scp -r ankur@192.168.20.64:/
> command to copy file from one machine to another

20. # df -k
> Displays, the amount of space allocated, and used for a directory.
or
# du -k >gives me the memory used of all the files inside

Friday, 13 April 2018

How to Find Out Top Files (Disk Space) in Linux?

If you want to display the biggest file sizes only, then run the following command:

# find -type f -exec du -Sh {} + | sort -rh | head -n 5

To find the largest files in a particular location, just include the path besides the find command:

# find /home/tecmint/Downloads/ -type f -exec du -Sh {} + | sort -rh | head -n 5
                                                                      OR
# find /home/tecmint/Downloads/ -type f -printf "%s %p\n" | sort -rn | head -n 5

The above command will display the largest file from /home/tecmint/Downloads directory.

How to Find Out Top Directories and Files (Disk Space) in Linux

Run the following command to find out top biggest directories under /home partition

# du -a /home | sort -n -r | head -n 5

The above command displays the biggest 5 directories of my /home partition.

If you want to display the biggest directories in the current working directory, run:

# du -a | sort -n -r | head -n 5

Let us break down the command and see what says each parameter.

du command: Estimate file space usage.
a : Displays all files and folders.
sort command : Sort lines of text files.
-n : Compare according to string numerical value.
-r : Reverse the result of comparisons.
head : Output the first part of files.
-n : Print the first ‘n’ lines. (In our case, We displayed first 5 lines).

Some of you would like to display the above result in human readable format. i.e you might want to display the largest files in KB, MB, or GB.

# du -hs * | sort -rh | head -5

The above command will show the top directories, which are eating up more disk space. If you feel that some directories are not important, you can simply delete few sub-directories or delete the entire folder to free up some space.

To display the largest folders/files including the sub-directories, run:


# du -Sh | sort -rh | head -5

Find out the meaning of each options using in above command:

du command: Estimate file space usage.
-h : Print sizes in human readable format (e.g., 10MB).
-S : Do not include size of subdirectories.
-s : Display only a total for each argument.
sort command : sort lines of text files.
-r : Reverse the result of comparisons.
-h : Compare human readable numbers (e.g., 2K, 1G).
head : Output the first part of files.

Friday, 6 April 2018

Script to get the CPU utilization status of any process running on a linux system

Steps to get the CPU utilization status of any process running on a linux system

1.Copy and paste the below code onto the linux server using vi editor


$ cd /tmp/scripts/


$ vi cpuUtilization.sh
#!/bin/sh

var1=`ps -ef | grep Dweblogic.Name | grep Server_1| awk '{print $2}'`

var2=` ps -ef | grep Dweblogic.Name |grep Server_2|awk '{print $2}'`

time=`date +%d-%m-%y-%H:%M:%S`


ps -eLo pid,ppid,tid,pcpu,comm | grep "$var1" > /u01/apps/oracle/Server_CPU_Utilization/Server_1_"$time"

ps -eLo pid,ppid,tid,pcpu,comm | grep "$var2" > /u01/apps/oracle_oc/Server_CPU_Utilization/Server_2_"$time"
2. Now set a cronjob to get the script executed automatically after a specified interval say 5 mins

$ */5,* * * *  /tmp/scripts/cpuUtilization.sh

3. The output of the script would be append to the files at the location

/u01/apps/oracle/Server_CPU_Utilization

Note: Steps to set cronjob “At every 5th minute.”



All about WebLogic t3 and t3s Protocol

WebLogic's  implementation of the RMI specification uses a proprietary protocol known as T3. You can think of T3 (and secure T3S) as a l...