Oracle 10g Grid Agent Woes (+Solution!)

I started to use the Oracle 10g Grid at work, and have been configuring Agents for our various Oracle servers so I would have a central location to monitor them, as well as eventually attempt replication.

The BIGGEST problem I’ve had was trying to get the agents to talk to the 10g Grid Enterprise Manager server. I would do something like this:

> emctl upload

And get something like this:

“EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet”

I’ve read so many different forums on how to handle this error, but none of them solved my problem.

What was going on was the hostname for the 10g grid upload read something like:

Agent URL         : https://some.internal.domain.in:3872/emd/main/
Repository URL    : https://some2.internal.domain.in:1159/em/upload/

The funny thing was, if I went to the Repo URL on the actual server, I get a nice page that says it works, but if I tried it on the server with the agent installed, I wouldn’t get anything at all. After around 13 hours of fiddling around with this, looking at emagent.trc, listener.ora, emd.properties, trying emctl clearstate agent, securing the agent, unsecuring the agent, etc, I found out what was up:

For some reason that fully qualified domain name does not register with the other servers in the network. What I did was in my hosts file, I added a definition for the Repo URL and the IP it went to.

After that, I got:

> emctl upload

EMD upload completed successfully

You don’t know how happy I am right now.

Also, just an FYI: 10g x86 does not install well on a Windows x64 edition. What happens is the entire server hangs on a file in the %agent%/bin directory called fix_4198214.exe. During the installation phase of the agent (or the Grid), when that directory has that file copied over, just stop the installation (does not actually stop, but pauses it), and rename the file to something else. When the installer encounters the file, it’ll give an error message. Ignore it and you can happily proceed with the install :D

Working iCarousel Javascript Implementation

My work wanted an image carousel implemented into the website, and I could barely find any decent carousel implementations out there until I came across iCarousel by Fabio Zendhi Nagao.

I loved the examples on his website of how to use and implement it, but unfortunately the code examples do not work at all. Reading the comments section of the website, I came to realize that it’s not just me who can’t get this stuff to work the first time.

Anyways, after spending a few hours tinkering with it, I finally figured out how to do the horizontal example, and I’m placing a working package here so you can also download it if you’d like:

http://journal.suteki.nu/wp-content/uploads/2008/05/icarouselh.zip

Edit: I am not taking any requests to fix any part of iCarousel. Fabio’s scripts are completely broken; he should just take down his page because there is no indication that he cares about fixing his script at all.

Oracle, Propel 1.3 and Dates

It took me awhile to figure out how to parse an Oracle date type with Propel 1.3. The easiest way to do it would be this:

define(“DATE_FORMAT”, ‘M j, Y g:i a’);

< ?=date(DATE_FORMAT, $event->getStartDate(null)->format(“U”));?>

Assume there is an Event that stores the date and time of when the event begins. The code above basically translates the Oracle date to UNIX time, where you can then use the PHP date function to parse it out.

CLOB and PDO, specifically Oracle

So, my new job has me working with Oracle which is in my book, a way different beast compared to mySQL. Everything I know about databases from mySQL basically had to be re-tooled for Oracle.

I spent around 3 hours trying to figure out how to work in a set of prepared statements (one of which returned a value) in PHP PDO, and thought I might share how I did this.

Okay, so I have one stored procedure and one function.

PROCEDURE RETURN_CLOB(:CLOB_ID, :CLOB_OUT IN CLOB) — All this does was search a table with key/ CLOB value pairs. It basically selected a row with the :CLOB_ID, and :CLOB_OUT returned the CLOB value.

FUNCTION CONVERT_CLOB_TO_VARCHAR2(:CLOB_OUT IN CLOB) RETURN VARCHAR2 — this was a function definition that took in the :CLOB_OUT from RETURN_CLOB and spit it out as a VARCHAR2

Note that I did not write these two procedures, it’s something out of a package I used at work, but was having trouble trying to get them to work in PDO.

I’m using PHP Propel 1.3, but you can easily rewrite this in standard PDO calls, since the $con object is actually a combination of the PDO class and PDO Statement class.
Here’s the code:

$con = Propel::getConnection(‘…’); //All this does is just use PDO to create a connection
/*

The call below is the same as PDOStatement::prepare(). I’ve condensed the following into one line:

DECLARE

CLOB_Output CLOB;

BEGIN

PackageName.RETURN_CLOB( :Clob_Id, CLOB_Output );

:Str := PackageName.CONVERT_CLOB_TO_VARCHAR2( CLOB_Output );

END;

//So the declare part is to define an internal variable in Oracle, which I’ve named CLOB_Output. It is of type CLOB. The Begin … End block processes the statements in one container.

1. Return_CLOB returns the CLOB data in CLOB_Output

2. Call CONVERT_BLOB_TO_VARCHAR2 with CLOB_Output

3. The converted CLOB is returned into :Str
*/
$stmt = $con->prepare(“DECLARE CLOB_Output CLOB; BEGIN PackageName.RETURN_CLOB( :Clob_Id, CLOB_Output ); :Str := PackageName.CONVERT_CLOB_TO_VARCHAR2( CLOB_Output ); END;”);

$m = “”;

$stmt->bindValue(‘:Clob_Id’, ‘Clob_Id_goes_here’, PDO::PARAM_INT);

$stmt->bindParam(‘:Str’, $m, PDO::PARAM_STR, 32767); //replace 32767 with the size of the VARCHAR2 that you are returning from CONVERT_BLOB_TO_VARCHAR2

$stmt->execute();
//$m now contains the CLOB as a VARCHAR2!
Phew! Anyways, I’m going to say that Propel 1.3 isn’t ready for Oracle yet, and neither is PHP_PDO for Oracle. There’s too many hassles and tricks I had to use to do the things I needed in Oracle, and I’m going to recommend people continue to use the OCI8 extension.

Connecting the Dots

There were notably three portions to Steve Jobs’ commencement speech at Stanford: connecting the dots, love and loss, and the notion of death.

For many years, many associates and family members have questioned my goal of completing five majors in community college. Their arguments were that it would take forever to accomplish, and that I was wasting time by staying in school for so long. To be honest, at the time, I didn’t see how my majors would mix together, but I knew I loved learning from those subjects.

When I found myself as a software engineer at NASA, my boss noticed I had a wide away of interests and focuses, and she was instrumental in connecting my own dots together. Although my primary job at NASA was to develop web applications, I soon found myself using my psychology, sociology, and social sciences knowledge running a lab part-time where we studied 3D cockpit displays for 747 airplanes.

The concept of human factors or human computer interaction (which tied parts of my CS and psychology knowledge together) came later when my boss urged me to attend a seminar presented by cognitive scientist Don Norman, who talked about product design, and emotions – the very core of what I was interested in, but never fully realized it until then.

The dots were beginning to connect, but all of them came together to draw a picture when I reached Stanford, working in the psychiatry labs doing emotions research. I found my CS knowledge was extremely handy in designing programs to analyze and collect data, and that my psychology and sociology knowledge bridged me to researchers and the data they collected.

Even though NASA was paying me more at the time, I found myself really enjoying what I did at Stanford, and left NASA to continue on emotions research. I’ve been there for two years, and have recently left as an employee. However, I truly enjoyed what I’ve been doing there, that I’m a continuing volunteer. I love learning about emotions, and its relation to life itself.

I’ve never pictured myself living beyond thirty, but that’s probably because I’m too young right now. But, I always feel that my time is limited, that I need to change people, and the world NOW, as opposed to later. It’s why I’ve taken on many opportunities that have come to me, even in the times where it feels seemingly impossible to accomplish.

No one regrets my decisions anymore, and I don’t regret the awkward path I’ve taken in my life with respect to college. It’s true that I’ll probably graduate when I’m twenty-six or even twenty-seven, but my life feels fulfilling in many ways, and many people are genuinely interested in having me incorporated into their futures.

I’m frequently asked nowadays, “What do you plan to do in the future?”, and the honest answer is, “I don’t know.”

Those kinds of answers are often scary, but when I say this response, I say it with utmost confidence. I’m not afraid of not knowing my future, because I know even greater things lie in it; I can accomplish anything because I am up to discovering, and conditioning my mind for that future.

I know I’ll live beyond thirty, but I want to keep this mindset, because I want to live as if everyday was my last.

Acceptance

Okay, here’s another from good ol’ Yalom. Because Yalom is so awesome, I have created this very short, yet sweet song:

—————–

I love Yalom,
And Yalom loves me,
He gets me in-to
PSY-CHO-LO-GY

—————–

With that said, here’s a nice passage on acceptance:

“Group members’ acceptance of one another, though crucial in the group therapeutic process, may be quite slow to develop. Acceptance by others and self-acceptance are mutually dependent; not only is self-acceptance basically dependent on acceptance of others, but acceptance of others is fully possible only after the individual can accept himself. The members of a therapy group may experience considerable self-contempt and a deep contempt for others.

A manifestation of this may be seen in the patient’s initial refusal to join ‘a group of nuts’ or his reluctance to become closely involved in the group for fear of being sucked into a maelstrom of misery.

The importance of self acceptance for the acceptance of others has been demonstrated in research by Rubin, who studied fifty individuals before and after an intensive live-in two-week T-group laboratory and found that an increase in self-acceptance was significantly correlated with increased acceptance of others. These results are consonant with Fromm’s statement many years ago that only after one is able to love himself is he able to love others. I would add, however, that only after he has once been loved will he be able to love himself.” – p.55-56

Realistic Microcosm of Therapy Groups

group_therapy.jpg

“Strangers,” the Blue Man said, “are just family you have yet to come to know.” – The Five People You Meet In Heaven by Mitch Albom

I thought about this quote, as I finished reading this passage from The Theory and Practice of Group Psychotherapy by Irvin Yalom (2nd Edition).

These final two paragraphs (separated into further paragraphs for easier reading) are about how patients question the reality of group therapy – they claim that their behavior in the group is not like their actual life outside the group, so their activities in the group is not an accurate representation of who they are.

However, in the therapist testimonial below, you’ll see how two people who loathe each other in life, come together and share their existence with each other.

I think what I liked about this passage was the commentary at the end that basically says that despite the limited time one spends in these groups, the psychological development that they experience transcends beyond the physical dimensions of time. Strangers infuse and share amongst each other, forming the closest of bonds.
———–

… I often think of Earl and Marguerite, two patients in a group long ago. Earl had been a member of a group for four months when Marguerite was introduced. They both blushed to see one another in the group room since, by chance, they had only a month previously gone on a Sierra Club camping trip and been “intimate” together. Neither wanted to be in the group with the other.

To Earl, Marguerite was a foolish, empty girl, a “mindless piece of ass,” as he was to put it later in the group. To Marguerite, Earl was a dull nonentity, someone whose penis she had one used as a means of retaliation against her husband. During that time they came to know one another intimately in the full sense of the word; they shared their deepest feelings, they weathered some fierce, vicious battles, and helped each other through suicidal depressions, and, on more than one occasion, they wept for each other. Which was the “real” world and which was the artificial?

Paradoxically, the group can be far more “real” than the world out there. There are no social, prestige, or sexual games in the group; members go through some vital life experiences together; the reality-distorting facades are doffed as members become as honest as possible with one another. How many times have I heard group members say, “This is the first time I have ever told this to anyone.” These are not strangers but quite the contrary; these are individuals far more likely to know one another deeply and fully. Psychological reality is not equivalent to physical reality. Psychologically, they spend infinitely more time together than the one or two meetings a week in which their physical beings occupy the same professionally sponsored room. – p.38-39