Thursday, November 18, 2010

Domain Creation in console mode

[root@unknown000c2996ab4a bin]# ./config.sh -mode=console





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Welcome:
--------

Choose between creating and extending a domain. Based on your selection, the Configuration Wizard guides you through the steps to generate a new or extend an
existing domain.

 ->1|Create a new WebLogic domain
    |    Create a WebLogic domain in your projects directory. 

   2|Extend an existing WebLogic domain
    |    Extend an existing WebLogic domain.  Use this option to add applications and services, or to override existing database access (JDBC) and messaging (JMS)
    |settings. You can also incorporate additional functionality in your domain, for example, by including AquaLogic Service Bus.





Enter index number to select OR [Exit][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select Domain Source:
---------------------

Select the source from which the domain will be created. You can create the domain by selecting from the required components or by selecting from a list of
existing domain templates.

 ->1|Choose Weblogic Platform components
    |    You can choose the Weblogic component(s) that you want supported in your domain.

   2|Choose custom template
    |    Choose this option if you want to use an existing  template. This could be a custom created template using the Template Builder.





Enter index number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> Required





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x


    ** Invalid input, only integer selection or page movement command are
    ** accepted: Required


Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                                         |
   3| *Confirm user password: |                                         |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"




Enter option number to select OR [Exit][Previous][Next]> p 





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> p





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select Domain Source:
---------------------

Select the source from which the domain will be created. You can create the domain by selecting from the required components or by selecting from a list of
existing domain templates.

 ->1|Choose Weblogic Platform components
    |    You can choose the Weblogic component(s) that you want supported in your domain.

   2|Choose custom template
    |    Choose this option if you want to use an existing  template. This could be a custom created template using the Template Builder.





Enter index number to select OR [Exit][Previous][Next]> p





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Welcome:
--------

Choose between creating and extending a domain. Based on your selection, the Configuration Wizard guides you through the steps to generate a new or extend an
existing domain.

 ->1|Create a new WebLogic domain
    |    Create a WebLogic domain in your projects directory. 

   2|Extend an existing WebLogic domain
    |    Extend an existing WebLogic domain.  Use this option to add applications and services, or to override existing database access (JDBC) and messaging (JMS)
    |settings. You can also incorporate additional functionality in your domain, for example, by including AquaLogic Service Bus.





Enter index number to select OR [Exit][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select Domain Source:
---------------------

Select the source from which the domain will be created. You can create the domain by selecting from the required components or by selecting from a list of
existing domain templates.

 ->1|Choose Weblogic Platform components
    |    You can choose the Weblogic component(s) that you want supported in your domain.

   2|Choose custom template
    |    Choose this option if you want to use an existing  template. This could be a custom created template using the Template Builder.





Enter index number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Application Template Selection:
-------------------------------



    Available Templates
    |_____WebLogic Server (Required)x



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                                         |
   3| *Confirm user password: |                                         |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"




Enter option number to select OR [Exit][Previous][Next]> 2





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    "*User password:" = []




Enter new *User password: OR [Exit][Reset][Accept]>




<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                ********                 |
   3| *Confirm user password: |                                         |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"
    5 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]> 3





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    "*Confirm user password:" = []




Enter new *Confirm user password: OR [Exit][Reset][Accept]>




<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Configure Administrator Username and Password:
----------------------------------------------

Create a user to be assigned to the Administrator role. This user is the default administrator used to start development mode servers.

    |          Name           |                  Value                  |
   _|_________________________|_________________________________________|
   1|       *User name:       |                weblogic                 |
   2|     *User password:     |                ********                 |
   3| *Confirm user password: |                ********                 |
   4|      Description:       | This user is the default administrator. |

Use above value or select another option:
    1 - Modify "User name"
    2 - Modify "User password"
    3 - Modify "Confirm user password"
    4 - Modify "Description"
    5 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Domain Mode Configuration:
--------------------------

Enable Development or Production Mode for this domain.

 ->1|Development Mode

   2|Production Mode




Enter index number to select OR [Exit][Previous][Next]> 2





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Java SDK Selection:
-------------------

 ->1|JRockit SDK 1.5.0_12 @ /Weblogic/apps/weblogic9.23/jrockit_150_12
   2|Sun SDK 1.5.0_12 @ /Weblogic/apps/weblogic9.23/jdk150_12
   3|Other Java SDK




Enter index number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Choose Configuration Option:
----------------------------

    *Do you want to modify any of the preconfigured settings or defaults in your template?
    *
    *To keep the default or template settings, and proceed directly to name and create your domain, leave No selected.

   1|Yes

 ->2|No





Enter index number to select OR [Exit][Previous][Next]> 2





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Select the target domain directory for this domain:
---------------------------------------------------

    "Target Location" = [Enter new value or use default "/Weblogic/apps/weblogic9.23/user_projects/domains"]




Enter new Target Location OR [Exit][Previous][Next]> /Weblogic/domains/weblogic9/test1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  |    Value    |
   _|________|_____________|
   1| *Name: | base_domain |




Enter value for "Name" OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: |   1   |

Use above value or select another option:
    1 - Modify "Name"
    2 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: |   1   |
Enter option number to select OR [Exit][Previous][Next]> 1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: |   1   |




Enter value for "Name" OR [Exit][Previous][Next]> test1





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Edit Domain Information:
------------------------

    |  Name  | Value |
   _|________|_______|
   1| *Name: | test1 |

Use above value or select another option:
    1 - Modify "Name"
    2 - Discard Changes




Enter option number to select OR [Exit][Previous][Next]>





<----------------------------------------------------------------- BEA WebLogic Configuration Wizard ----------------------------------------------------------------->

Creating Domain...

0%          25%          50%          75%          100%
[------------|------------|------------|------------]
[***************************************************]


**** Domain Created Successfully! ****

It will crearte a domain in particular directory, 
for ex: the name of the domain is test1 need to create at /root/bea/web9.2. Just give the till where to create and it will create the folder automatically. 

-----------------------

 Available Templates
    |_____WebLogic Server (Required)x
    |_____Workshop for WebLogic Platform [2]



Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>

 

weblogic Installation

We have different types of installation, we are using console mode in linux.

1) Go to the installation directory and execute the following command
 ./server923-linux32.bin -mode=console
Extracting 0%....................................................................................................100%
<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->
Welcome:
--------
This installer will guide you through the installation of BEA Products. Type "Next" or enter to proceed to the next prompt.  If you want to change data entered
previously, type "Previous".  You may quit the installer at any time by typing "Exit".
Enter [Exit][Next]>
-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->
BEA Systems License Agreement:
------------------------------
BEA SYSTEMS, INC. SOFTWARE LICENSE AGREEMENT

USE OF SOFTWARE ORDERED FROM BEA SYSTEMS, INC. ("BEA") IS PROVIDED ONLY UNDER LICENSE FROM BEA. PLEASE READ THE FOLLOWING LICENSE AGREEMENT CAREFULLY, INCLUDING ANY
SUPPLEMENTAL TERMS AND CONDITIONS SET FORTH AT THE END OF THE MAIN LICENSE AGREEMENT, AND INDICATE YOUR ACCEPTANCE BY CLICKING THE ACCEPTANCE BOX. CERTAIN CAPITALIZED
TERMS ARE DEFINED IN SECTION  11.
      
1.      LICENSE TERMS

a.      Evaluation Use. The terms of this Section 1(a) are applicable to you if you have registered as an Evaluation customer. Subject to the terms of this Agreement, BEA
grants to you a non-exclusive, non-transferable, license to use the Software solely for Evaluation Use. Third party software products or modules supplied by BEA, if
any, may be used solely with the Software, and may be subject to your acceptance of terms and conditions provided by such third parties. This license begins upon
downloading and ends thirty (30) days thereafter. When the license terminates you must stop using the Software.  All rights not specifically granted to you herein are
retained by BEA.

b.      Development Use. The terms of this Section 1(b) are applicable to you if you have registered as a Development Use customer. Subject to the terms of this Agreement,
BEA grants to you a non-exclusive, non-transferable, fee-bearing license to use the Software solely for Development Use for the number of users and the number of
CPU's, Servers, or other pricing units and/or at the Sites, as specified on BEA's invoice. Third party software products or modules supplied by BEA, if any, may be
used solely with the Software. All rights not specifically granted to you herein are retained by BEA.

c. Production Use. The terms of this Section 1(c) are applicable to you if you have registered as a Production Use customer. Subject to the terms of this Agreement,
BEA grants to you a non-exclusive, non-transferable, fee-bearing license to use the Software solely for Production Use on the number of CPU's, Servers, or other
pricing units and/or at the Sites, as specified on BEA's invoice. Third party software products or modules supplied by BEA, if any, may be used solely with the
Use above value or select another option:
    1 - Yes, I agree with the terms of the license
    2 - No, I do not agree with the terms of the license
Enter option number to select OR [Down][Exit][Previous]> 1
<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->
Choose BEA Home Directory:
--------------------------

 ->1|* Create a new BEA Home
   2|/Weblogic/apps/weblogic10.3
Enter index number to select OR [Exit][Previous][Next]> 1
<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose BEA Home Directory:
--------------------------

    "BEA Home" = [Enter new value or use default "/root/bea"]

Enter new BEA Home OR [Exit][Previous][Next]> /Weblogic/apps/weblogic9

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose BEA Home Directory:
--------------------------

    "BEA Home" = [/Weblogic/apps/weblogic9]

Use above value or select another option:
    1 - Enter new BEA Home
    2 - Change to default [/root/bea]

Enter option number to select OR [Exit][Previous][Next]> 1

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose BEA Home Directory:
--------------------------

    "BEA Home" = [/Weblogic/apps/weblogic9]

Enter new BEA Home OR [Exit][Previous][Next]> /Weblogic/apps/weblogic9.23

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose BEA Home Directory:
--------------------------

    "BEA Home" = [/Weblogic/apps/weblogic9.23]

Use above value or select another option:
    1 - Enter new BEA Home
    2 - Change to default [/root/bea]

Enter option number to select OR [Exit][Previous][Next]>
<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose Install Type:
--------------------

Select the type of installation you wish to perform.

 ->1|Complete
    |  Install the following software components and examples:
    | - WebLogic Server
    | - Workshop for WebLogic Platform

   2|Custom
    |  Choose software components to install and perform optional configuration.
Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> 1
<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose Components to install:
-----------------------------

    Release 9.2.3.0
    |_____WebLogic Server [1] x
    |    |_____Server [1.1]
    |    |_____Server Examples [1.2]
    |    |_____Web Server Plug-Ins [1.3]
    |_____Workshop for WebLogic Platform [2]
         |_____Workshop [2.1]
         |_____Workshop Examples [2.2]
Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> 1.1
<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose Components to install:
-----------------------------

    Release 9.2.3.0
    |_____WebLogic Server [1]
    |    |_____Server [1.1]
    |    |_____Server Examples [1.2]
    |    |_____Web Server Plug-Ins [1.3]
    |_____Workshop for WebLogic Platform [2]
         |_____Workshop [2.1]
         |_____Workshop Examples [2.2]




Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> 1.1

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose Components to install:
-----------------------------

    Release 9.2.3.0
    |_____WebLogic Server [1] x
    |    |_____Server [1.1] x
    |    |_____Server Examples [1.2]
    |    |_____Web Server Plug-Ins [1.3]
    |_____Workshop for WebLogic Platform [2]
         |_____Workshop [2.1]
         |_____Workshop Examples [2.2]

Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> 1.2

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->
Choose Components to install:
-----------------------------

    Release 9.2.3.0
    |_____WebLogic Server [1] x
    |    |_____Server [1.1] x
    |    |_____Server Examples [1.2] x
    |    |_____Web Server Plug-Ins [1.3]
    |_____Workshop for WebLogic Platform [2]
         |_____Workshop [2.1]
         |_____Workshop Examples [2.2]




Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]> 1.3
<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose Components to install:
-----------------------------

    Release 9.2.3.0
    |_____WebLogic Server [1] x
    |    |_____Server [1.1] x
    |    |_____Server Examples [1.2] x
    |    |_____Web Server Plug-Ins [1.3] x
    |_____Workshop for WebLogic Platform [2]
         |_____Workshop [2.1]
         |_____Workshop Examples [2.2]

Enter number exactly as it appears in brackets to toggle selection OR [Exit][Previous][Next]>

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Choose Product Installation Directories:
----------------------------------------

BEA Home Directory: [/Weblogic/apps/weblogic9.23]

Product Installation Directories:


    "Default Product Home" = [Enter new value or use default "/Weblogic/apps/weblogic9.23/weblogic92"]

Enter new Default Product Home OR [Exit][Previous][Next]>

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Installing files..

0%          25%          50%          75%          100%
[------------|------------|------------|------------]
[***************************************************]

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Installing JDK....

0%          25%          50%          75%          100%
[------------|------------|------------|------------]
[***************************************************]


Performing String Substitutions...



Creating Domains...

<-------------------------------------------------------------------- BEA Installer - BEA Products ------------------------------------------------------------------->

Installation Complete


Congratulations! BEA Products has been successfully installed to /Weblogic/apps/weblogic9.23/weblogic92.
Enter index number to select OR [Exit][Previous][Next]>

Tuesday, October 5, 2010

Unix Commands

                                                                UNIX COMMANDS
FIND: find command is case sensitive command ie string and String are different.
1) find / -name "string" ---- finds the file/directory starting with string under root directory 
2) find / -name "string" -type f -print --- finds the file starting with string under root directory
3) find / -name "string" -type d -print --- finds the directory starting with string under root directory
4) If you need to do action on couple of files then go for "exec XXXXX {} \;" xxxx is the command 
    i) find /usr -name "*.conf" -exec chmod 777 {} \; -- It search for conf file and executes rwx permissions on all the files under /usr ending with conf.
    ii) find /root -name "*.java" -exec grep -il string {} \; --- finds for the java files which consists of the word string.
5) find . -type f -print | xargs grep -il 'bin/ksh

[root@localhost bin]# find / -name "*.java" -exec grep -il string {} \;| more
/Weblogic/apps/weblogic10.3/wlserver_10.3/samples/server/medrec/modules/common/src/com/bea/medrec
/common/naming/NamingClient.java
/weblogic10.3/wlserver_10.3/samples/server/medrec/modules/common/src/com/bea/medrec
/common/naming/CachingNamingClientDecorator.java
/weblogic10.3/wlserver_10.3/samples/server/medrec/modules/common/src/com/bea/medrec
/common/naming/NamingException.java

5) find . -type f -exec ls -s {} \; | sort -n -r | head -5 -- which searches for a file and prints top 5 based on size of the file.
6)find . -name *.*  | xargs grep "oldip" ---- which is used to serch a word in a file
VI Editor:


ctrl+b -- move screen backward
ctrl+f -- move screen forward
shift+g  -- go to end of line in the file
0 --- begining of the current line
$ -- end of the line
:0 -- begining of the file
:$ -- end of the file
:n -- Go to partiicular file.
?String  -- forward search use n or N
N-- backword search
n-- forward search


SORT:



1) sort -n -t
  n -- used to sort numerical values.
  r -- ascending or descending order
  t -- delemiter


LS:


1) ls -l  /etc -- list all the file in etc directory
2) ls -altr /etc -- list all the files with permissions links owner group size lastmodifieddate name
3) ls -ld /etc -- gives complete details of the files in a directory.
4) ls -lt -- gives the file with last modified first
5) ls -ltr -- displays files in reverse order( recently modified last)


Netstat:


Netstat –anP tcp | grep ipaddress | wc –l to grep the number of connections to the web server

$netstat -rn
Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.1.0 192.168.1.11 U 1 1444 le0
224.0.0.0 192.168.1.11 U 1 0 le0
default 192.168.1.1 UG 1 68276
127.0.0.1 127.0.0.1 UH 1 10497 lo0


netstat -an | grep LISTEN | grep xxxx to grep for the port number




VMSTAT:



Vmstat reports virtual memory statistics of process, virtual memory, disk, trap,
and CPU activity.
On multicpu systems, vmstat averages the number of CPUs into the output. For perprocess
statistics .Without options, vmstat displays a one-line summary of the virtual
memory activity since the system was booted.

Example% vmstat 5
procs memory page disk faults cpu
r b w swap free re mf pi po fr de sr s0 s1 s2 s3 in sy cs us sy id
0 0 0 11456 4120 1 41 19 1 3 0 2 0 4 0 0 48 112 130 4 14 82
0 0 1 10132 4280 0 4 44 0 0 0 0 0 23 0 0 211 230 144 3 35 62
0 0 1 10132 4616 0 0 20 0 0 0 0 0 19 0 0 150 172 146 3 33 64
0 0 1 10132 5292 0 0 9 0 0 0 0 0 21 0 0 165 105 130 1 21 78



Identifying the bottlenecks:
1.) If the number of processes in run queue (procs r) are consistently greater than the
number of CPUs on the system it will slow down system as there are more processes then
available CPUs .
2.) If this number is more than four times the number of available CPUs in the system
then system is facing shortage of cpu power and will greatly slow down the processess on
the system.
3.) If the idle time (cpu id) is consistently 0 and if the system time (cpu sy) is double the
user time (cpu us) system is facing shortage of CPU resources. The system time should
not be more than the user time at any give instance.
4.) Memory bottlenecks are determined by the scan rate (sr) . The scan rate is the pages
scanned by the clock algorithm per second. If the scan rate (sr) is continuously over 200
pages per second then there is a memory shortage. Scan rate and page out should be zero
or 1.


PSRINFO:



To determine the number of processors in the system and their speed, use the
psrinfo -v command. In Solaris 10, -vp prints additional information.

# psrinfo -v
Status of processor 0 as of: 05/16/08 04:34:25
Processor has been on-line since 08/04/07 20:10:53.
The sparcv9 processor operates at 900 MHz ,
and has a sparcv9 floating point processor.
Status of processor 1 as of: 05/16/08 04:34:25
Processor has been on-line since 08/04/07 20:10:53.
The sparcv9 processor operates at 900 MHz,
and has a sparcv9 floating point processor.
Status of processor 2 as of: 05/16/08 04:34:25
Processor has been on-line since 08/04/07 20:10:53.
The sparcv9 processor operates at 900 MHz,
and has a sparcv9 floating point processor.
Status of processor 3 as of: 05/16/08 04:34:25
Processor has been on-line since 08/04/07 20:10:43.
The sparcv9 processor operates at 900 MHz,
and has a sparcv9 floating point processor.


PRSTAT:


The most important command used to check the usage of the user was prstat



Typical headers of the prstat command.
PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
PID – Process Id
USERNAME – Name of the user using the processor
SIZE – Process Size
RSS - Resident Set Size ( Size of the process on the memory)
STATE – State of the process / Cpu information
PRI - Priority
NICE – Nice value
TIME – Amount of time the process is running on the CPU
CPU PROCESS/NLWP – Command/Number of light weight processes / Threats
NPROC – Number of processes
USERNAME – Name of the User
MEMORY – Percentage of memory consumed.



Occassionally there are many small processes, each of which consumes a small piece of
the CPU. On a system such as a computing server that is shared by many users, prstat
can be used to determine which user (as opposed to which processes) is consuming the
most resources. If the user consuming the most resources on the system can be identified,
it is possible to move at least part of the work to another machine. To have prstat report
statistics about resource consumption by user, add the -a option to the prstat command
line.
Adding the -a option to any prstat command will identify how many processes each
user is using, what percent of the CPUs, and how much memory, they are using on a
system, as shown above. The command prstat -s cpu -a 8 asks for the top 8
processes consuming the CPU and a list of resource consumption statistics for each user


prstat

PID USERNAME SIZE RSS STATE PRI NICE TIME CPU PROCESS/NLWP
1685 rsd 758M 575M cpu3 0 10 4:07.11 12% java/95
828 root 2339M 1302M sleep 28 10 0:00.31 0.1% java/66
719 root 4312K 3848K sleep 55 0 0:00.00 0.0% mibiisa/12
7067 root 1776K 1408K cpu0 58 0 0:00.00 0.0% prstat/1
6743 root 669M 198M sleep 58 0 0:17.25 0.0% java/20
598 root 13M 8808K sleep 58 0 0:31.25 0.0% jre/10
21847 root 667M 386M sleep 58 0 0:00.00 0.0% java/21

prstat -a will give number of processors the users are owned too.

Scripting Sites:

http://www.softpanorama.org/Tools/xargs.shtml


Monitoring Commands:


prstat -a -n 15 - to get first 15 hign process used commands.

vmstat - to find the virtualmemory utilization.

mpstat - to find the percentage of cpu.

top is for physical memory.

./MemUtil -- to find percentage of physical memory utilised.








Saturday, September 25, 2010

Errors

ORA-01033:

####<Sep 25, 2010 10:29:13 AM EDT> <Info> <JDBC> <e08k302> <upd2unlock1> <main> <<WLS Kernel>> <> <BEA-001156> <Stack trace as
sociated with message 001129 follows:

java.sql.SQLException: ORA-01033: ORACLE initialization or shutdown in progress

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:305)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:272)
        at oracle.jdbc.driver.T4CTTIoauthenticate.receiveOsesskey(T4CTTIoauthenticate.java:239)
        at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:295)
weblogic.common.ResourceException: Could not create pool connection. The DBMS driver exception was: ORA-01033: ORACLE initialization or shutdown in progress  at weblogic.jdbc.common.internal.ConnectionEnvFactory.createResource(ConnectionEnvFactory.java:153)
        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1145)
        at weblogic.common.resourcepool.ResourcePoolImpl.makeResources(ResourcePoolImpl.java:1079)
        at weblogic.common.resourcepool.ResourcePoolImpl.start(ResourcePoolImpl.java:171)
        at weblogic.jdbc.common.internal.ConnectionPool.doStart(ConnectionPool.java:1018)
        at weblogic.jdbc.common.internal.ConnectionPool.start(ConnectionPool.java:142)
This error is because of database is down.

BEA-000337:
The threads have been waiting for the lock in the thread dump we can see that all the threads are in object.Wait()

ThreadDump Analysing

We will analyse the thread dump by taking different scenarios:
1) 
"ExecuteThread: '15' for queue: 'weblogic.kernel.Default'" daemon prio=5 tid=0x01c7fe88 nid=0x20 in Object.wait() [cbfff000..cbfffc28]
        at java.lang.Object.wait(Native Method)
        at java.lang.Object.wait(Object.java:429)
        at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:153)
        - locked <0xd9925f60> (a weblogic.kernel.ExecuteThread)
        at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:172)

Here when we seen that object is waited for some other resources, Lets discuss about this in programming when we use synchronized objects for some typical application like blank. This happens because of two or more threads tries to acquires lock on the object(some other thread may hold that)

Wednesday, September 15, 2010

Configuring SSL on Weblogic

set path to 
C:\j2sdk1.4.2_04\bin;    for java
C:\j2sdk1.4.2_04\jre\bin;  for keytool
C:\Program Files\GnuWin32\bin  for openssl


Weblogic server uses SSL on its defaulf port of 7002.
Using ssl is comprehensive overhead for the server, not feasible to use in dev envs.However always use in prod enviornments.
To Setup SSL:
1) For an ssl creation we need two things one is identity(private keys and Digital Certificates) other is trust(trusted root CA ceritificates). By default weblogic server kit ie certgen and java keytool will provide identity and trust stores, we can get those by thrid party vendors like verisign, thawte.
2) Store the private key and trusted CA certificates in to keystore.
3) Configure the identiry and trust in  the admin console with the password of the keystore.
We can get privatekeys digitalcertificates and Trustedroot using:
         To use SSL the server needs privatekey, digitalcertificate containing matching publickey and one trusted certificate. By default all these are avialble in /wl_home/server/lib. 
         We can create those by using javakeytool which is used to generate privatekey, self-signed digitalcertificate, CSR, if you need a third party certificate we can produce a CSR and sent to CA they will provide the certificate.
        We can also get by using certgen which is used for demonstrative purpose. The demonstration digital certificate provided by the weblogic server uses the hostname as default machine hostname.
Using CertgenUtility:
       The certgen utility which is used to generate privatekey and digital certificate which is used for demo purpose. CertGenCA.der and CertGenCAkey.der are the default key and certificate used by certgen.
       In order to use certgen we need to set the classpath to \weblogic_homm\server\lib then execute the commands for different purpose
1) To generate the certificate we need to execute the following command.
$ java utils.CertGen


[-cacert <ca_cert_file-name>] [-cakey <ca_key_filename>]
[-cakeypass <ca_key_password>] [-selfsigned]
[-certfile <certfile>] [-keyfile <privatekeyfile>]
[-keyfilepass <keyfilepassword>] [-strength <keystrength>]
[-cn <commonname>] [-ou <orgunit>] [-o <organization>]
[-l <locality>] [-s <state>] [-c <countrycode>]
[-subjectkeyid <subjectkeyidentifier>]
[-subjectkeyidformat UTF-8|BASE64]
If you mention selfsigned no need to mention cacert cakey as those are used when you taken from CA.
2)Use ImportPrivateKey utility to load the digitalcertificate and privatekey into keystore.
        We already discussed that the certgen default takes the hostname as common name it uses the jdk1.3  InetAddress.getLocalHost().getHostname() takes the hostname and placed in the place of commonname by default.
         When we entered hostname in command prompt it takes tha FullyQualifiedDomainName from /etc/hosts, when you enter java.net.InetAddress.getHostname() it searches the hostname for /etc/nsswitch.conf

http://download.oracle.com/docs/cd/E13222_01/wls/docs81/secmanage/ssl.html


Install SSL Certificate BEA WebLogic Server 8 & 9

Download and copy your certificate files to your server

Download your SSL certificate and support files by clicking on the download link in your fulfillment email or from your GeoCerts SSL Manager account. Download the PKCS#7 formatted version of your certificate.
  1. Use the following command to install the PKCS#7 certificate into your keystore. You MUST use the same keystore used for your private key and CSR.
    keytool -import -trustcacerts -alias tomcat -file your_site_name.p7b -keystore mykeystore.jksYou MUST you the same alias used when the keystore was created, in this case the alias used was tomcat
  2. Enter your keystore password
  3. You should get the follow response:
    ... is not trusted. Install reply anyway? [no]:  yes
  4. Enter 'yes' and hit Enter.
  5. You should get the following response:
    Certificate reply was installed in keystore
The SSL Certificate and intermeidate cert are now installed into your keystore.

Configure the Identity and Trust keystores

  1. Expand the Servers node and select the name of the server for which you want to configure keystores.
  2. Select the button 'Keystores and SSL tab' to configure the keystore for the domain.
  3. By default, WebLogic ships with demo certificates for testing purposes. Click the 'Change' link in the upper-right portion of the configuration items. This will display the drop-down list of options for configuration.
  4. Choose 'Custom Identity and Java Standard Trust' from the list. 
  5. Specify the identity keystore information:
    [Custom identity]
    • Custom Identity key store file Name: c:\full\path\to\mykeystore.jks (The fully-qualified-path to your keystore)
    • Custom Identity key Store Type: jks (Generally, this attribute is jks)
    • Custom Identity key Store Pass Phrase: keystore password (The password defined when creating the keystore. If you don't know the password you have to start over.)
    • Confirm Customer Identity key Store Pass Phrase: Keystore_password (same as above)
    [Java Standard Trust]
    • Java standard Trust Key Store Pass Phrase: changeit (unless your system admin changed it the password for the cacerts keystore is "changeit")
    • Confirm Java Standard Trust Key Store Pass Phrase: changeit
    • Click Continue
    • [Review SSL Private Key Settings]
    • Private key Alias: keyEntry_friendly_name (If you followed our instructions to generate the private key the alias will be 'tomcat'. The alias is the friendly name for your keyEntry (private key), if you do not remember it please run the following command on your keystore to confirm the alias: keytool -list -keystore [keystore_friendly_name] -v)
    • Passphrase: keyEntry_password (specify the keyEntry (private key) password. The password for the private key may differ from the one for the keystore)
    • Confirm Passphrase
  6. Click Continue
  7. Click Finish
  8. Reboot WebLogic Server.

SSL

Errors:

C:\Documents and Settings\kanthi\Desktop\trail\testing>c:\bea9.23\jdk150_12\bin\
keytool.exe -import -alias privkey -keystore abc.jks -storepass storepass -trust
cacerts -file root.crt
Enter key password for <privkey>keypass
keytool error: java.lang.Exception: Public keys in reply and keystore don't matc
h

Because you cannot install  seperately all the certificates in to the jks( first time creating with private key) ie..  we cannnot import the certificates(root.serverm, intermediate) we need to put all these certs in to a file (server fisrt ,inter root) then import to jks.


set path to 
C:\j2sdk1.4.2_04\bin;    for java
C:\j2sdk1.4.2_04\jre\bin;  for keytool
C:\Program Files\GnuWin32\bin  for openssl

Root- it validates the entire chain. As this is a trial cert, its our trial root. Without the root, the domain certificate wont be trusted.


Intermediate-is the subordinate of the root, its required as well. The intermediate signs the domain cert
  Root > Intermediate > SSL cert
  that is the certificate path
Domain\server\public certificate:the cert issued to your domain

when u use customidentity and java trust we can use jdk based jks ie default we can find at :\bea9.23\JDK150~1\jre\lib\security\cacerts is the jks and the password for this is changeit.

If you want to use custom identity and custom trust they use your own jks
We have different types of certificates
A server certificate is nothing but the domain certificate ie ur url.
-Root Ceritificate, Intermediate Certificate, Chained Certificate:
        The ceritificate authority issues certificate in the form of tree structure. A root certificate is the topmost of the tree.All the certificates below root are inherit the trust worthy of the root certificate. By default all the webbrowser will contains all the root certificates. Any certificate in between your certificate and root certificate is  termed as intermediate or chain certificate.These intermediate certificate should be there in your webbrowser in order to link your certificate to a trusted authority.Most of the CA uses these intermediate certificate for security purpose and most of web server, browsers support them.
-CSR
      The certificate signing request is a piece of text that is generated in the web server. The CA uses the info contained in the CSR and with some additional information(organization name, common name nothing but domain name....) to create a certificate. It also contains public key that will be included in your certificate and the private key that is generated at the time of creating CSR. We no need to send our private key to certificate authority. The certificate that was created using the CSR will only work with the private key that was genereated with the CSR. If you lost the private key the certificate is invalid.
A CSR contains:
Comman Name: The domain name of your server, this should be exactly same as what we typed in the browser or you will recieve name mismatch.
ex: www.xxxx.com
Organization: The name of the organization
ex: xxxx Inc.
Organization Unit: The division of the organization 
ex: IT 
City/Locality: The name of the city
ex: Bangalore
State/Country/Region: The state the company is located
ex: Karnataka
Country: Country name
ex: IN
Email Address: An email address to contact you
ex: kanthi@xxx.com
Public Key: The public key that will go in to the certificate
ex: It will automatically.


The format of CSR is in Base64 encoded format which includes --Begin Certificate Signing Request--   --End Certificate Sigining Request--
A key size of 512 is weak, if the private key is broken all the information will exposed who has the private key. We can user 1024 which is stronger and 2048 is pretty stronger.


The PrivateKey:
The private key is that much importantm, without this your certificate is useless. It is impossible to recover if your private key was lost, even the CA cant recover it as they dint know the private key. If you lost the certificate we need to create new private key and reissue the certificate.
The PublicKeys
The public key is the key used to encrypt the data and the private key is used to decrypt the data. The public key is sent to browser along with the digital certificate, the public key encrypt the data and sent to server the server decrypt the data using the private key that was stored in confidential area.
The publlic key is embeded in the digital ceritificate along with the owner name, street and email address.
A private key and digital certificate shows the identity of the server
The digital certificate is verified by the certificate autority and they will signed the certificate. So that the trusted CA certificate establishes the trusrt for a certificate.All the webservers, browsers support this digital cetificates signed by the ceritficate authority.


Comman Certificate Errors:
1) Certificate is untrusted:
      There are several reasons for this error.
     - The certificate is not signed by the CA authority.
     - The link between your certifiacate and the root may be broken.
 We can view the certificate chain in the web browser by cliking on the lock command.
2) certificate error navigation blocked:
       These are prompted and displays There is a problem with website's security: continue to this website(not recommended)
    - The reason for this error is the common name(domain name) in the certificate does not mathches with the address in the browser for example if you click directly xxxx.com if the domain name in the server may be www.xxxx.com then it may throw this namemismatcherror
3) Secure and nonSecure items:
       This is because of the connection we are using is https but the data in the page ie images, javascripts may be developed using http. for example <img src="https://www.xxxx.com/image.gif" alt="" />, By chnging all the file which has written with http to htts <img src="https://www.xxxx.com/image.gif" alt="" /> we can erradicate these type of errors for all the images, javascript and frames.


How the SSL works:
 - When we hit the url using https, the browser sends the requst to server
 - In response the webserver sends its public key and certificate to the browser.
 - The browser already consists of the trusted certificates validates the cetificate sent by server ie it check whether it was trustworthy, its comman name matches to the website that it requested to and it is expired?
 - The browser encrypt the page with the help of public key and sent to the server .
 - The server Decrypt the data with the help of private key, created at the time of CSR.
 - The server send the page encrypted with the publcikey.
 - The browser decrypts the page using the public key and displays the information.