Tuesday, December 30, 2008

Remote debugging in SQL Developer


There are many sites explaining how to do this.. but somehow i see them incomplete and not very userful. I followed some and had to do goo experimentation on things to get this one working. So this is how i went about

Problem:
I have a windows machine on which i have SQL developer. Now i need to debug a proc that resides over a solaris/ linux box (diffarent server)

Solution:
  1. Download the sql developer and create a connection
  2. open a procedure, right click and select compile to debug
  3. Right click on ur connection and select Remote Debug
  4. Give the port as 8001; IP: local ip (u can get in cmd window with ipconfig command). If you see a windows firewall dialog then shut down the firewall. in run > give services.msc > opens services> right click on 'Windows Firewall/Internet Connection Sharing (ICS)' and select stop.
  5. U will see the new debug connection under RunManager window below connections.
  6. Now login to the target DB-machine as someUser
  7. if it doestnt have debug previleges then login as sysdba and run the command: GRANT debug connect session, debug any procedure TO ; and then login as someUser
  8. now run the command:  exec DBMS_DEBUG_JDWP.CONNECT_TCP('ur ip',8001);This should complete with no errors.
  9. put a debug point in the sql developer (click on the left white column and u will see a red dot)
  10. now click on the lady bug and the debugging starts.

i am not sure how to do a remote debug when a java process calls this procedure. Any ideas... please share with me.





Saturday, December 13, 2008

oracle streams jobs 12/13/2008


Posted from Diigo. The rest of my favorite links are here.

Friday, December 5, 2008

oracle streams jobs 12/05/2008


Posted from Diigo. The rest of my favorite links are here.

Monday, November 24, 2008

oracle streams jobs 11/24/2008


Posted from Diigo. The rest of my favorite links are here.

Sunday, November 16, 2008

oracle streams jobs 11/16/2008


Posted from Diigo. The rest of my favorite links are here.

Thursday, November 13, 2008

oracle streams jobs 11/13/2008


Posted from Diigo. The rest of my favorite links are here.

Wednesday, November 12, 2008

Monday, November 10, 2008

oracle streams jobs 11/10/2008


Posted from Diigo. The rest of my favorite links are here.

Friday, November 7, 2008

oracle streams jobs 11/07/2008

  • tags: streams

    • Supplemental Logging in a Streams Environment
  • tags: aq

    • Displaying Supplemental Log Groups at a Source Database
  • tags: no_tag

    • Unconditional log groups log the before images of specified columns when the table is changed, regardless of whether the change affected any of the specified columns. Unconditional log groups are sometimes referred to as "always log groups." Conditional log groups log the before images of all specified columns only if at least one of the columns in the log group is changed.
      • is the entire column of table stored/ only the respective row?? - post by ravi_eze
  • tags: aq

    • Oracle recommends that you use a nonzero wait time for the first dequeue call on a queue in a session, and then use a zero wait time with the NEXT_MESSAGE navigation option for subsequent dequeue calls.

Posted from Diigo. The rest of my favorite links are here.

Monday, November 3, 2008

oracle streams jobs 11/03/2008


Posted from Diigo. The rest of my favorite links are here.

Sunday, November 2, 2008

Practical Laws

* Jone's Motto:
Friends come and go, but enemies accumulate.

* Terman's Law of Innovation:
If you want a team to win the high jump, you find one person who can jump seven feet, not seven people who can jump one foot each.

* O'brien's Variation:
If you change queues, the one you have left will start to move faster than the one you are in now.

* Conway's Law:
In any organization there will always be one person who knows what is going on. This person must be fired.

* The Peter Principle:
In a hierarchy, every employee tends to rise to his level of incompetence. Work is accomplished by those employees who have not reached their level of incompetence.

* H.L.Mencken's Law:
Those who can, do. Those who cannot teach.

* Martin's Extension:
Those who can't teach, administer

* Belani's Extrapolation:
Those who cannot even administer, become consultants.

* Lieberman's Law:
Everbody lies; but it doesn't matter since nobody listens.

* Kovac's Conundrum:
When you dial a wrong number, you never get an engaged one.

* Van Herpen's Law:
The solving of the problem lies in finding the solvers.

* Murphy's Law of Government:
If anything can go wrong, it will do so in triplicate.

* Bell's Theorem:
When the body is immersed in water, the telephone rings.

* Ruby's Principle of Close Encounters:
The probability of meeting someone you know increases when you are with someone you don't want to be seen with.

* Young's Law:
Great discoveries are made by mistake.

* Kin Hubbard:
A good listener is usually thinking about something else

* One Anonymous Great Seer's Law :
Money can't buy love, but it sure gets you a great bargaining
position.

Saturday, November 1, 2008

oracle streams jobs 11/01/2008


Posted from Diigo. The rest of my favorite links are here.

Friday, October 31, 2008

oracle streams jobs 10/31/2008

  • tags: aq

    • 8.3.1 Creating a Transformation
    • transformation
      • Specifies a transformation that will be applied when this subscriber dequeues the message. The source type of the transformation must match the type of the queue. If the subscriber is remote, then the transformation is applied before propagation to the remote queue. - post by ravi_eze
  • tags: anydata

    • 22.6 Propagating User-Enqueued LCRs from ANYDATA Queues to Typed Queues
    • You can propagate user-enqueued LCRs to an appropriate typed queue, but propagation of captured LCRs to a typed queue is not supported.
  • tags: oracle

    • When the Messaging Gateway agent processes a propagation job, it dequeues messages from the source queue and enqueues the messages to the destination queue.

Posted from Diigo. The rest of my favorite links are here.

Sunday, September 21, 2008

dont mess with children

Again an e-mail xtract...
The teacher said it was physically impossible
for a whale to swallow a human because even
though it was a very large mammal its throat
was very small.


Irritated, the teacher reiterated that a whale
could not swallow a human; it was physically
impossible.

The little girl said, "When I get to heaven I
will ask Jonah".

The teacher asked, "What if Jonah went to
hell?"

The little girl replied, "Then you ask him".




2� A Kindergarten teacher was observing her
classroom of children while they were drawing.
She would occasionally walk around to see
each child's work.


As she got to one little girl who was working
diligently, she asked what the drawing was.

The girl replied, "I'm drawing God."


The teacher paused and said, "But no one
knows what God looks like."

Without missing a beat, or looking up from
her drawing, the girl: replied, "They will in a
minute."



3� A Sunday school teacher was discussing
the Ten Commandments with her five and six
year olds.

After explaining the commandment to "honor"
thy Father and thy Mother, she asked, "Is
there a commandment that teaches us how to
treat our brothers and sisters?"

Without missing a beat one little boy (the
oldest of a family) answered, "Thou shall not
kill."




4� One day a little girl was sitting and
watching her mother do the dishes at the
kitchen sink. She suddenly noticed that her
mother had several strands of white hair
sticking out in contrast on her brunette head.

She looked at her mother and inquisitively
asked, "Why are some of your hairs white,
Mom?"

Her mother replied, "Well, every time that
you do something wrong and make me cry or
unhappy, one of my hairs turns white."

The little girl thought about this revelation
for a while and then said, "Momma, how come
ALL of grandma's hairs are white?"



5� The children had all been photographed,
and the teacher was trying to persuade them
each to buy a copy of the group picture.

"Just think how nice it will be to look at it
when you are all grown up and say, 'There's
Jennifer, she's a lawyer,' or 'That's
Michael, He's a doctor.'

A small voice at the back of the room rang
out, "And there's the teacher, she's dead."



6� A teacher was giving a lesson on the
circulation of the blood. Trying to make the
matter clearer, she said, "Now, class, if I
stood on my head, the blood, as you know,
would run into it, and I would turn red in the
face."

"Yes," the class said.


"Then why is it that while I am standing
upright in the ordinary position the blood
doesn't run into my feet?"

A little fellow shouted,

"Cause your feet ain't empty."




7� The children were lined up in the cafeteria
of a Catholic elementary school for lunch. At
the head of the table was a large pile of
apples. The nun made a note, and posted on
the apple tray:

"Take only ONE. God is watching."


Moving further along the lunch line, at the
other end of the table was a large pile of
chocolate chip cookies.

A child had written a note, "Take all you
want. God is watching the apples.

Nuclear tests... images







These are the few images that ican get from emails.. click on the images

Q

Click on the img below to view the quotes clearly. This is one of my fav wallpapers which i deleted accidentally long back, today i got it as an attachment in an e-mail...





Sunday, September 7, 2008

Indian nuclear deal.... healthy??

This is a hot topic on the media thesedays. Out of what i understand the following are the significant points.

  1. US would be supplying Uranium to us till its wish or all commercial reactors are under its surveillance & not being used for weapon research
  2. The Singhbhum district (Bihar), West Khasi hills (Meghalaya), the Bhima Basin area (Gulbarga district of Karnataka), and the Yellapur- Peddagattu area of Nalgonda district (Andhra Pradesh)has good amount of uranium reserves to feed the reactors
  3. All 17 working civilian nuclear reactors have been operating at less than 40% of their rated capacity(as said by S K Jain, managing director of the Nuclear Power Corporation)
  4. So it means that we donot have enough tech to get the required raw material to feed the industry. Note: that US will not supply critical tech during its support.
  5. Now we cannot proceed on weapons during this support.
  6. So, is it worth to substitute the national security (though we are stable now) for nuclear prog?
Other points:
  1. US cannot use its nuclear technology for itself as no state is ready to take the nuclear wastes.
  2. So it seems like what its going to get with this deal??? I think media and political parties should see this side.
Map:

Nuclear plants details:
Location Unit Namea Capacity
(net MWe) b
Utilityc Typed Reactor Suppliere Percent Completef Expected / Actual Date of Operation
Kaiga,
Karnataka
Kaiga 1 202NP PHWR NPCIL 7511/1998 1999
Kaiga 2 202NP PHWR NPCIL 7511/1998 2000
Kakrapar,
Gujarat
Kakrapar 1 202NP PHWR DAE/NPCIL 100
11/1992
Kakrapar 2 202NP PHWR DAEC/NPCIL 100
03/1995
Kalpakkam, Tamil Nadu Kalpakkam 1 155NP PHWR DAE 100
07/1983
Kalpakkam 2 155NP PHWR DAE 100
09/1985
Kota,
Rajasthan
Rajasthan 1 90NP PHWR AECL 100
11/1972
Rajasthan 2 187NP PHWR AECL/DAE 100
11/1980
Rajasthan 3 202NP PHWR NPCIL 7011/1998 2000
Rajasthan 4 202NP PHWR NPCIL 7005/1999 2000
Rajasthan 5 450NP PWHR -- 020072008
Rajasthan 6 450NP PWHR -- 020082009
Kudankulam,
Tamil Nadu
Kudankulam 1 1,000 NP PWR -- 020062008
Kadunkulam 2 1,000 NP PWR -- 020082010
Narora,
Uttar Pradesh
Narora 1 202NP PHWR DAE/NPCIL 100
07/1989
Narora 2 202NP PHWR DAE/NPCIL 100
01/1992
Tarapur,
Maharashtra
Tarapur 1 150NP BWR GE 100
04/1969
Tarapur 2 150NP BWR GE 100
05/1969
Tarapur 3 450NP PHWR NPCIL 1008/2003 2004
Tarapur 4 450NP PHWR NPCIL 205/2004 2006

Tuesday, September 2, 2008

Q

Try to learn something about everything and everything about something.
- Thomas H. Huxley

Monday, August 25, 2008

Wednesday, August 20, 2008

Qutote 2

By failing to prepare you are preparing to fail. Today morning i saw this on my friends id. ;)

Wednesday, August 13, 2008

Super star Rajini

Rajini is one of my fav actor. Heres one of his videos (An add from castrol) video

Monday, August 11, 2008

JSON'P' - Though intelligent yet in-sufficient solution

An extension of JSON called JSONP (well explained here ) is also available but its utility remails to the extent of json response or in otherwords the server can send values of variables etc but not an entire html content (this is also possible but takes too much of server side manipulation more complex than URL connection ;) ).


pearl script

When surfing the net got a perarl script which if installed in apache would do the same thing. Its more criptic written in regular expressions. THe author recomends taking support for it.

Tuesday, August 5, 2008

Solving cross domain problems

The problem

At times we need to integrate pages from two/ more domains into a single page. Consider for example the case where the content management (cms) happens by a 3rd party in a specific domain and say we have our page which belongs to some other domain and we want to include this cms functionality into our page. One common way of sloving this is by including the content management service (cms) using an iFrame and let this included page and the parent page communicate via backend server communications. This has problems: the iframe (cms) is of some other web domain not belonging to the parent page's domain... this makes cms javascripts in-accessible i.e. the colour component/ calendar component doestnt work fine. IE throws Access Denied ; mozilla doesnt execute anything... it just ignores this cross domain js.

This seem to make some sence: as they are cross domain pages... it's more logical taht they remain independent. Then how do we solve this issue?

There is a way:

1. From a webserver make a URL call to the 2nd webserver using a JSP/ servlet
2. Let the user send his required parametrs as a request to the 1st webserver.
3. This webserver inturn would call the 2nd webserver, gets the data, processes internal urls (like


i.e. we will write a glue code on a JSP/ Servlet of webserver1 and the client makes all his calls to this as if the webserver 1 is doing all the work; which inturn pulls the content from the webserver 2.

Example:
I implemented this and found it working. Excepth that i need to implement the cookies which i would do soon. The example is as follows;

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"

pageEncoding="ISO-8859-1"%>

DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

<title>Insert title heretitle>

head>

<body>

<form action="pcmBroker.jsp" method="post" >

<input type="text" name="webUrl" maxlength="100" />

<input type="submit" />

form>

body>

html>


Now the broker which is a glue code: this is the one which takes the calls from the the jsp, resolves it and makes a new connection to the server in diff domain. The masterUrl and masterContext refers to the newDomain servers URL & context. THe master context is the one which would be replaced with brokerUrl and brokar param. The workign is as follows:

1. The 3rd party server has all the urls starting with masterContext (adm say)
2. The broker page replaces this (generateUrl()) assignes it to param:brokerParam and constructs a new url so that when this page is submitted it comes to broker page.
3. On receiving at the broker page by using brokerParam the 3rd party url is resolved, a new connection is made, and response is sent back.

<%@page import="java.net.URLEncoder"%>

<%@page import="java.util.Enumeration"%>

<%@page import="java.io.IOException"%>

<%@page import="java.net.MalformedURLException"%>

<%@page import="java.io.BufferedInputStream"%>

<%@page import="java.io.OutputStream"%>

<%@page import="java.io.DataInputStream"%>

<%@page import="java.io.InputStream"%>

<%@page import="java.net.URLConnection"%>

<%@page import="java.net.URL"%>

<%!String masterUrl = "http://10.1.39.191:8080/adm";

String masterContext = "/adm";

String brokerUrl = "http://localhost:8080/yui/pcmBroker.jsp";

String brokerParam = "webUrl";


public String generateUrl(String content) {

String clientStr = content.replaceAll(masterContext, brokerUrl + "?" + brokerParam + "=");

return clientStr;

}


public String generateCompleteMasterUrl(HttpServletRequest request){

//get the master url to which we need to submit; request parameters

Enumeration params = request.getParameterNames();

String serverParams = "";

for(String param = params.nextElement();params.hasMoreElements();param = params.nextElement()){

if(param.equals(brokerParam))

continue;

if(serverParams.trim().length()>0)

serverParams += "&";

serverParams += URLEncoder.encode(param) + "=" + URLEncoder.encode(request.getParameter(param));

}

String webUrl = request.getParameter("webUrl");

//remove jsessionId from param

/*if(webUrl.contains("jsessionid")){

int jsessStart = webUrl.indexOf("jsessionid");

//int jsessEnd = webUrl.indexOf(";",jsessStart);

webUrl = webUrl.substring(0,jsessStart-1);

}*/

if(serverParams!=null && serverParams.trim().length()>0)

return masterUrl + webUrl+ "?" + serverParams;

else

return masterUrl + webUrl;

}

%>


<%

try {

String url = generateCompleteMasterUrl(request) ;

System.out.println("web Url:: " + url);

URL master = new URL(url);

URLConnection yahooConnection = master.openConnection();

InputStream istr = yahooConnection.getInputStream();

if (url.indexOf(".jpg")== -1 && url.indexOf(".gif")== -1 ) {

DataInputStream dis = new DataInputStream(istr);

String inputLine;

while ((inputLine = dis.readLine()) != null) {

String htmlSrc = generateUrl(inputLine);

%>


<%=htmlSrc%>


<%

}

dis.close();

}else{

System.out.println("procesing image *** " + url );

OutputStream os = response.getOutputStream();

BufferedInputStream bis = new BufferedInputStream(istr);

response.setContentType("image/gif");

byte[] b ;

int maxBuffSize = 256 * 1024;

int available =0;

while(true){

available = bis.available();

if(available >maxBuffSize){

b = new byte[maxBuffSize];

}else

b = new byte[available];

int readBytes = bis.read(b);

if(readBytes <= 0)

break;

os.write(b,0,readBytes);

}

os.flush();

os.close();

System.out.println("processing the image is complete");

}

} catch (Exception e) {

e.printStackTrace();

}

%>



This is a working example except that

1. cookies is not yet implemented : http://www.hccp.org/java-net-cookie-how-to.html

2. relative urls are not being supported.

If these can be done then I would say this as a complete solution. Hows it???? :)