Friday, 11 January 2013

How to set thread pool in weblogic

                                        How to set thread pool in weblogic
                                        --------------------------------------------

        click on  Environment in weblogic admin console
                                              |
                       click on worker manager
                                              |
                                    click on new
                                              |
                             select worker manager
                                               |
                 give the name of worker manager
                                               |
                         Name:myworkermanager
                                            |
                                click on next
                                          |
                       check the admin server dialogue box
                                          |
                                 click on finish

After creating the worker manager then

                          click on myworkermanager
                                               |
                         click on new in Min Thread Constrsint
                                              |
           give name and count of min thread count
           Name: minthreads
          count:
                                      |
                                      |
                       click on next
                                |
check the adminserver dialogue box
                                 |
                    click on finish
                                |
                   click on save


We will also configure Maximum Thread Constraint and Capacity Constraint same process as above












NOTE:
worker manager is not application specific but is mapped by my application in weblogic.xml

LoadRunner Architecture


By viewing this link  http://www.wilsonmar.com/1loadrun.htm#TopMenu  to gain more knowledge in loadrunner architecture wise and other things

How to set JDBC connection pool in WEBLOGIC Manually

                                            JDBC connection pool in WEBLOGIC Manually
                                            ------------------------------------------------------------

These attributes are used to set the jdbc connection settings

Initial Capacity:
--------------------
The no of physical db connections to create when creating the connection pool
Min:0
Max:2147483647
Default:1
Attribute:IntialCapacity

Maximum Capacity:
------------------------
Max no. of physical db connections that contain in connection pool. Different JDBC drivers and db servers may limit the no .of possible physical connections
  Min:1
Max:2147483647
Default:15
Attribute:MaxCapacity

Capacity Increment:
-----------------------
Increment by which the connection pool capacity is expanded. When there are no more avilablae physical connections to service requests, the connection pool will create this number of additional physical db connections add them to the connection pool.

Min:0
Max:2147483647
Default:1
Attribute:CapacityIncrement

To set these values in Weblogic manually

To open the file Jdbc_Data_source_0_3401_jdbc.xml in
D:\oracle weblogic\middleware\user_projects\domains\base_domains\config\jdbc


 <jdbc-connection-pool-params>
    <initial-capacity>1</initial-capacity>
    <max-capacity>15</max-capacity>
    <capacity-increment>1</capacity-increment>
    <profile-harvest-frequency-seconds>300</profile-harvest-frequency-seconds>
    <test-table-name>SQL SELECT 1 FROM DUAL</test-table-name>
    <statement-cache-size>10</statement-cache-size>
    <statement-cache-type>LRU</statement-cache-type>
    <profile-type>1</profile-type>
  </jdbc-connection-pool-params>


Thursday, 10 January 2013

web_set_user function

                                                       web_set_user()
                                                   -----------------------

 The proxy server evaluates the user request according to the filtering rules  for ex: the filters may IPaddress or protocol. If the requests is validated by filter, the proxy server provide resources by connecting to the relevent server and requesting the service on behalf of the client.

proxy options in runtime settings
------------------------------------------
1)No Proxy: All vusers should use direct connections to the internet so the connection made without proxy

2) Obtain proxy settings from the default browser : All vusers use the proxy settings of the default browser from the machine upon which they running

3) use custom proxy: All vusers use a custom proxy server. you can supply the actual proxy server details in runtime settings some times the request doesn't identify the proxy settings  at that time we can
write manually

To supply the details of the server that is IPaddress or hostname, port no. You can specify one proxy server for all HTTP sites.

After providing proxy information , you can specify authentication information for proxy servers

To find the error like Error -26547: Authentication Required
 This error occurs bcz our request not connect to the server so we can use web_set_user() 

syntax:
int web_set_user(const char * username, const char * password, const cahr *host:port);

EX:
web_set_user("dashwood","myaccount","student:8080");

In the above example dashwood is username of the server
myaccount is password of the server , student is hostname of the server machine and 8080 is port no of the server machine 

EX:

vuser_init()
{
web_set_proxy("student:8080");
 
web_set_user("dashwood","myaccount","student:8080");
 }


web_set_proxy() is a service function it forward the user request to the particular proxy server


web_set_proxy("student:8080");
web_set_user("dashwood","myaccount","student:8080");  These functions also write in before web_url() and web_submit_data()

web_set_user() is overrides the runtime proxy authentication settings for username and password. This function is supported for all web scripts and WAP scripts running in HTTP mode only.

Wednesday, 9 January 2013

lr_get_debug_message

                                        lr_get_debug_message
                                      --------------------------

The lr_get_debug_message()  is returns the current log settings of the script.

The returned value is saved in a unsigned int varible.

EX:

unsigned int log_options;
log_options=lr_get_debug_message();
lr_output_message("The current log setting value is %d",log_options);

Ans:
The current log setting value is 4
so the current log setting is LR_MSG_CLASS_PARAMETERS


 Log Level                               C Constant                                                            Value 
-------------------------------------------------------------------------------------------------------------   
Disabled                                 LR_MSG_CLASS_DISABLE_LOG                      0     

--------------------------------------------------------------------------------------------------------------
Brief                                        LR_MSG_CLASS_BRIEF_LOG                           1     

------------------------------------------------------------------------------------------------------------
Extended Log                        LR_MSG_CLASS_EXTENDED_LOG                 16    

--------------------------------------------------------------------------------------------------------------
Result Data                            LR_MSG_CLASS_RESULT_DATA                        2     

--------------------------------------------------------------------------------------------------------------
Parameter Substitution      LR_MSG_CLASS_PARAMETERS                        4     

-----------------------------------------------------------------------------------------------------------------
Full Run-Time Trace           LR_MSG_CLASS_FULL_TRACE                         8     

----------------------------------------------------------------------------------------------------------------
Log on Error                         LR_MSG_CLASS_JIT_LOG_ON_ERROR        512 

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

 Depend upon the value that is retrieved using lr_get_debug_message() we can say the current log settings

EX:
 Action()
{
logs_on()
{
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG, LR_SWITCH_ON );
}
-----------------------
-----------------------
-----------------------
void logclear(void)
{
unsigned int log_options = lr_get_debug_message();
lr_set_debug_message(log_options, LR_SWITCH_OFF);
lr_output_message("The current log value is %d",log_options);
return 0;
}
 }

Ans:

 The current log setting value is  16





lr_set_debug_message

                              lr_set_debug_message

By using lr_set_debug_message() function we can manually set the log options in the vuser script

By using lr_set_debug_message() to dispaly only a certain portion of the log generated.

We can place the lr_set_debug_message before the code in Action() method and close as per requirement.

Ex:
 Action()
{
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG, LR_SWITCH_ON);
 ------------------------------------------------------
-------------------------------------------------------
-----------------------------------------------------
 lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG, LR_SWITCH_OFF);
return 0;
}

Each logging option has separate  C-constant 

Log Level C Constant Value Binary Value
Disabled LR_MSG_CLASS_DISABLE_LOG 0 00000000 00000000
Brief LR_MSG_CLASS_BRIEF_LOG 1 00000000 00000001
Extended Log LR_MSG_CLASS_EXTENDED_LOG 16 00000000 00010000
Result Data LR_MSG_CLASS_RESULT_DATA 2 00000000 00000010
Parameter Substitution LR_MSG_CLASS_PARAMETERS 4 00000000 00000100
Full Run-Time Trace LR_MSG_CLASS_FULL_TRACE 8 00000000 00001000
Log on Error LR_MSG_CLASS_JIT_LOG_ON_ERROR 512 00000010 00000000

NOTE:Before writing these functions in your script first to disable the log  in runtime settings otherwise you can't ddifferentiate the log settings (click F4)

We can also write multiple parameters in  lr_set_debug_message() function by separated using " | "

These constants are integer type  variables and return type is unsigned int
By using these C constants we can set different log options

The lr_set_debug_message() is also written in function and palce the function in globals.h and call those functions in Action() method

EX:(This code is in globals.h)
#ifndef _GLOBALS_H
#define _GLOBALS_H

//--------------------------------------------------------------------
// Include Files
#include "lrun.h"
#include "web_api.h"
#include "lrw_custom_body.h"

//--------------------------------------------------------------------
// Global Variables

#endif // _GLOBALS_H
logs_on()
{
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG |LR_MSG_CLASS_RESULT_DATA| LR_MSG_CLASS_PARAMETERS , LR_SWITCH_ON );
}
logs_off()
{
lr_set_debug_message(LR_MSG_CLASS_EXTENDED_LOG |LR_MSG_CLASS_RESULT_DATA| LR_MSG_CLASS_PARAMETERS , LR_SWITCH_OFF );
}
 
 
call the above functions in Action() method
 
Action()
{
logs_on()
-----------------------
-----------------------
----------------------
logs_off()
return();
}

Tuesday, 8 January 2013

How to handle Dynamic ITEMDATA

By using web_custom_request() to handle the dynamic itemdata

In loadrunner generally we record the script using HTML-based recording mode because it easy and minimizes the correlations

suppose there is one request to send data items those are changed every time dynamically for example
 in 1st time there will be 4 dataitems and in 2nd time 5 dataitems in the same request

to see the link you can understand clearly
 http://performance.punebids.com/?tag=creating-custom-request-in-vugen-loadrunner

about sga and pga in oracle



Shared pool in sga in oracle memory
It is a Shared portion of the Sga it contains the Library Cache and Dictionary cache
Library Cache: The library cache contains the current SQL execution plan information. It also holds stored procedures and trigger code.
Dictionary cache: The dictionary cache stores environmental information, which includes referential integrity (like primary key etc), table definitions, indexing information, and other metadata stored within Oracle's internal tables.
To change the shared pool in Sga in oracle
1     open the file using notepad SPFILEXE.ORA in this location C:\oraclexe\app\oracle\product\10.2.0\server\dbs
2     find the parameter of shared_pool_size=88080384(the value is in bytes)
      give the required memory for shared pool

Buffer Cache in sga in oracle memory
It is also called DB Buffer Cache.
The DB buffer cache is read the data from datafiles.
Datafiles: Datafiles store the information contained in the db(i.e our tables,views…. data)
To change the Buffer Cache in Sga in oracle
1     open the file using notepad SPFILEXE.ORA in this location C:\oraclexe\app\oracle\product\10.2.0\server\dbs
       find the parameter of db_cache_size=176160678 (the value is in bytes)
3     give the required memory for shared pool 


 We can also set Sga and Pga
1open the file using notepad SPFILEXE.ORA in this location C:\oraclexe\app\oracle\product\10.2.0\server\dbs
2sga_target=314572800 (to set sga memory using this parameter)
    pga_aggregate_target=90M(to set pga memory using this parameter)




set SGA and PGA in oracle

Hoe to set SGA, PGA in Oracle
------------------------------------------
open oracle db homepage: http://127.0.0.1:8080/apex/
         |
username:system
password:oracle
       |
click on administration
          |
click on memory
         |
click on confugure SGA and give the required memory
          |
click on configure PGA and required memory












































































Saturday, 5 January 2013

how to set session timeout in weblogic
----------------------------------------------------

this is code is there in weblogic.xml in weblogic installation folder


<session-descriptor>
    <session-param>
      <param-name>CookieMaxAgeSecs</param-name>
      <param-value>-1</param-value>
    </session-param>
    <session-param>
      <param-name>InvalidationIntervalSecs</param-name>
      <param-value>60</param-value>
    </session-param>
    <session-param>
      <param-name>TimeoutSecs</param-name>
      <param-value>3600</param-value>
    </session-param>
    <session-param>
      <param-name>CookieName</param-name>
      <param-value>ADMINCONSOLESESSION</param-value>
    </session-param>
  </session-descriptor>

  <jsp-descriptor>
    <keepgenerated>false</keepgenerated>
    <page-check-seconds>-1</page-check-seconds>
    <verbose>true</verbose>
    <debug>true</debug>
  </jsp-descriptor>
How to set jdbc connecton pool in weblogic10
-------------------------------------------------------------

click on environments
       |
click on services
      |
  click on JDBC
       |
click on DataSources
      |
click on jdbcdatasource-0(that is user defined)
     |
click on connection pool
    |
enter values of intial capacity(that is no of db connections used for initially)
    |
enter value of max capacity(that is max db connections used by app server)
     |


  capacity increment is for db connections after reaching the initial connections then connections incrementation  

Wednesday, 2 January 2013

                             How to set JVM Heap Memory
------------------------------------------------------------------------------------

1) After Installing the weblogic10 then search the file setDomainEnv.sh in weblogic installation folder

2) open in notepad or editplus

3)WLS_MEM_ARGS_64BIT="-Xms256m -Xmx512m"
    export WLS_MEM_ARGS_64BIT
    WLS_MEM_ARGS_32BIT="-Xms256m -Xmx512m"
    export WLS_MEM_ARGS_32BIT


  -Xms256m(is intila size of heap)

  -Xmx512m(is max size of heap)

update these values as per requirement


We can also set perm size of heap meory

MEM_PERM_SIZE_64BIT="-XX:PermSize=128m"
export MEM_PERM_SIZE_64BIT

MEM_PERM_SIZE_32BIT="-XX:PermSize=48m"
export MEM_PERM_SIZE_32BIT