Thursday, July 14, 2011

How to enable GUI while connecting to Remote Redhat / Linux machine using Putty

Hi, This post cover details about how we can enable GUI interfacing using Xserver while connecting to Remote Redhat 5.6 / Linux Machine using Putty on Windows based local machine.

First all of you need to install Xserver in your local box. Here is the download location for Windows. Here Xserver will be installed using Xming.
Location :  http://sourceforge.net/projects/xming.

After downloading install the Xming server in your localbox and run it with option ":0 -clipboard -multiwindow -ac". To do this, right click the short cut of Xming -> go to properties -> and in target  its should look similar to this "C:\Program Files\Xming\Xming.exe" :0 -clipboard -multiwindow -ac (here double quates are part of the string itself), depending on the location of Xming installation path may change.

On Redhat / Linux machine has feature called X11Forwarding, depending on the value of this parameter it enables or disables the display of graphics on the server.

On Redhat / Linux machine
For example, 
  1. login on Linux/BSD system called myserver.mydomain.com
  2. Open /etc/ssh/sshd_config file using text editor:
    1. # vi /etc/ssh/sshd_config
  3. Find out parameter X11Forwarding and set it to yes:
    1. X11Forwarding yes
    2. Save file & exit shell prompt
  4. Restart sshd service under Debian Linux:
    1. # /etc/init.d/ssh restart
    2. Alternatively, if you are using Fedora / Red Hat Linux restart sshd:
    3. # /etc/init.d/sshd restart

Client Side Setting on Windows Machine
For connecting to Redhat Linux box I am using the most popular SSH client putty. Below are the steps to configure putty on Windows machine.

  1. Run the putty.exe
  2. provide Host Name (or you can use IP address of host machine as well
  3. Select SSH as Connection Type 
  4. Port should be 22 default
  5. Enter again the same name as you entered in Hostname in to Saved Session Input box.
  6. In Connection Category, Find out the Connection Tree. In SSH, expand it and you will see "Enable X11 Forwarding".. 
  7. Enable X11 Forwarding by selecting the check box
  8. X Display location  should be set to localhost:0
  9. Save this entire information as a session by click on Save button
  10. Now start the Xming Server on location machine
  11. Now connect to the Redhat / Linux Machine using saved session from putty
  12. And to verify that Graphics are enable use this command xclock &
  13. You should be able to new graphical window coming up.
Now you are all set to roll, you can execute and run any GUI based application from the Redhat / Linux box and it will get displayed on you local machine. Makes your life much easier :) cheers

Monday, July 4, 2011

Purging / Deleting / Limiting Database Growth in SOA Schema in SOA Suite 11g

This post is about how to control the SOA database schema and its growth while running SOA Suite 11g. All the instructions given here are specifically for SOA Suite 11g version 11.1.1.4. From this version onward there are new scripts provided by Oracle and only updated scripts should be used as this version has schema and table structure changes.

There are basically three ways to delete/purge the SOA  Schema database.
  1. Using Enterprise Manager console -> Delete with options
  2. Deleting large number of instances using purge script
  3. Partitioning component database table
Using Enterprise Manager Console : Here, first option, using Enterprise Manager console is ok for small amount of instances where you want to remove one or two thousand instances . For large number of instances it will throw Time out error.There is a option provided in EM console for increasing the timeout period but still its not enough for large amount of data.

Deleting Large Number Of Instances Using Purge Script :  This is very useful and straight forward process to clean up SOA database schema. In real world , server are receiving millions of requests in a day and keeping these all data as instances in SOA Suite database schema is very costly. It can affect a performance of the server up to some extent. After few days or month probably you will start receiving table space errors as allotted all the table sapce is already been used by the instances created within SOA database schema. For this reason you need to plan your tablesapce accordingly and generally it should be in between 50 GB - 80 GB in loaded server. And still it requires regular purging for data on the SOA database.

Below is the process for purging / deleting the composite instances from SOA Database schema.

1. First of all you will required Repository creation utility for 11.1.1.4. This installable contain the all required purging script provided by oracle to purge the database schema. You can find the purge script at location RCU_HOME/rcu/integration/soainfra/sql/soa_purge.

Note : this script can not run with Microsoft SQL Server and IBM DB2 Database.

2. In SQL*Plus, connect to the database AS SYSDBA:

3. Execute the following SQL commands:
                      GRANT EXECUTE ON DBMS_LOCK to dev_soainfra;
                      GRANT CREATE ANY JOB TO dev_soainfra;

4. RCU_HOME/rcu/integration/soainfra/sql/soa_purge/soa_purge_scripts.sql

5. execute SET SERVEROUTPUT ON on SQL prompt

6.  execute below SQL block and description of each variable is given below

  • min_creation_date : minimum date when instance was created
  • max_creation_date : Maximum date when instance was created
  • batch_size :Batch size used to loop the purge. The default value is 20000.
  • max_runtime :Expiration at which the purge script exits the loop. The default value is 60. This value is specified in minutes. 
  • retention_period :Retention period is only used by the BPEL process service engine only (in addition to using the creation time parameter). The default value is null
  • purge_partitioned_component  : Users can invoke the same purge to delete partitioned data. The default value is false

DECLARE

   MAX_CREATION_DATE timestamp;
   MIN_CREATION_DATE timestamp;
   batch_size integer;
   max_runtime integer;
   retention_period timestamp;

BEGIN

   MIN_CREATION_DATE := to_timestamp('2011-06-23','YYYY-MM-DD');
   MAX_CREATION_DATE := to_timestamp('2011-07-03','YYYY-MM-DD');
    max_runtime := 15;
    retention_period := to_timestamp('2011-07-04','YYYY-MM-DD');
   batch_size := 5000;
     soa.delete_instances(
     min_creation_date => MIN_CREATION_DATE,
     max_creation_date => MAX_CREATION_DATE,
     batch_size => batch_size,
     max_runtime => max_runtime,
     retention_period => retention_period,
     purge_partitioned_component => false);
  END;


 Here is very important to note that this script provided is able to delete instances from database schema however it will not free up the memory of that table / tablespace.

For freeing up the memory you can try this option below on tables.

alter table enable row movement.
alter table shrink space;