Thursday 28 November 2013

Make your NOTEPAD into a Dairy

This will be useful for those people who use notepad to write down any info on a day to day basis.

Steps:
* Open a notepad and type ".LOG" (case sensitive) as the first line.
* Save and close the file.
* Double-click the file to open it and notice that Notepad appends the current date
and time and places the cursor on the next line.
* Type your notes and then save and close the file.


So now each time you open the file, it will be appending the time and date and placing the cursor below it. So now your notepad simply serves as a virtual diary!

How to set jdbc connecton pool in weblogic10

Below are the steps:

  1. click on environments
  2. click on services
  3. click on JDBC
  4. click on DataSources
  5. click on jdbcdatasource-0(that is user defined)
  6. click on connection pool
  7. enter values of intial capacity(that is no of db connections used for initially)
  8. 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

How to set session timeout in weblogic

This is code presents in weblogic.xml in weblogic installation folder



CookieMaxAgeSecs
-1


InvalidationIntervalSecs
60


TimeoutSecs
3600


CookieName
ADMINCONSOLESESSION




false
-1
true
true

sga and pga in oracle database

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

Setting the 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)

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.

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

Answer:
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

Example:
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;
} }
Answer:

The current log setting value is 16

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 what ever the tool is

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

web_set_user function in load runner

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 relevant server and requesting the service on behalf of the client.

proxy options in run time 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 useweb_set_user()

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

Example:
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.

How to set JDBC connection pool in WEBLOGIC Manually

JDBC connection pool in WEBLOGIC SERVER 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



1
15
1
300
SQL SELECT 1 FROM DUAL
10
LRU
1

How to set thread pool in weblogic server

Steps 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,like Name: elrrmanager
  • 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 as Name: minthreads
  • count: 1 
  • 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

lr_set_debug_message() in Load Runner

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 LevelC ConstantValueBinary Value
DisabledLR_MSG_CLASS_DISABLE_LOG000000000 00000000
BriefLR_MSG_CLASS_BRIEF_LOG100000000 00000001
Extended LogLR_MSG_CLASS_EXTENDED_LOG1600000000 00010000
Result DataLR_MSG_CLASS_RESULT_DATA200000000 00000010
Parameter SubstitutionLR_MSG_CLASS_PARAMETERS400000000 00000100
Full Run-Time TraceLR_MSG_CLASS_FULL_TRACE800000000 00001000
Log on ErrorLR_MSG_CLASS_JIT_LOG_ON_ERROR51200000010 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 inglobals.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();
}