Wednesday, November 23, 2011

Sell Covered calls and Secured Cash puts

Tuesday, November 22, 2011

Credit Card Offers

Need everyone to chip in on this lucrative offer. I just found out this new credit card offer from continental.com. It says apply for a new credit card and get 40,000 miles with no fee for the first year.

http://www.continental.com/web/en-US/content/products/chase/continental.aspx?v_ctrk=HBAN2$0-916-2365-1-1348&offer=OPP40K&mkid=6S2B

40,000 miles should be good enough for one-round trip within continental US. Round-trip ticket these days could be worth upto $500.

There could be similar offers out there which are as good as this one if not better.

Could anyone comment on what are downsides of taking this offer and closing the account in less than 1 year to avoid the annual credit card charges?

I would love to hear from your experience on similar offers like this one. So, keep them coming.

Friday, November 18, 2011

Peoplesoft Search Keys

I have taken a very simple topic today but yet a very important one. Whenever we create any custom objects in Peoplesoft, be mindful of the Keys and Alt Search keys you choose, since every column that has been identified as a key, will end up creating an additional index.

Every index is a lot of overhead on INSERT/UPDATE and DELETE statements. So, choose the KEYS carefully and only what is really needed. I have seen objects with 28 Keys that essentially means an index with 28 columns, which would obviously be no good as an index.

Additionally, every ALT search keys would create additional indexes on that objects. This would be even worse. You will take a big performance hit if you have more indexes than needed. 

Tuesday, November 15, 2011

PeopleSoft ReUse Statement AE


The ReUse statement setting on an Application Engine is a great way to increase performance. It’s useful when you have a SQL object that is called multiple times, for instance when you have a DoSelect that runs a SQL Step repeatedly, substituting different Bind variables in each time.
The default setting for ReUse is ‘No’, which means that each time the SQL Step is called it is recompiled and new execution plan generated, bad news if the SQL has to run a large number of times. With the default setting of 'No', a new SQL statement is generated which needs to be parsed and stored in 'Shared Pool' for every row that satisfies the DoSelect loop. This is like thrashing the shared pool literally. You should see some 'wait events' on latches in the shared pool that clearly would mean, the performance is getting degraded. If the ReUse setting is ‘Yes’ then any %Binds in the SQL statement are converted into ‘:1’, ‘:2’ etc. This means the statement can just be compiled once and the same plan used each time, resulting in really quite dramatic improvements in processing time.
This is a very simple and low hanging fruit but yet this would result in dramatic performance improvements. 

FULL Table Scan(DB file Scattered read) Vs INDEX Scan(DB file sequential read)

DBAs and Developers often look at FULL Table Scans or INDEX scans happening within their database and code respectively. It is often assumed that FULL Table Scan would make the SQL statement perform slower.

Let us try and clear this misconception. 
FULL Table Scan(DB file scattered read) is not necessarily an expensive operation as compared to INDEX scan. It all depends on what the SQL is trying to do. If the SQL statement is returning more than 10% of the total volume in the table, FULL Table Scan is actually faster than Index Scan. This is because an index is scanned one block at a time whereas in-case of FULL Table Scan, multiple blocks, as determined by 'DB_file_multiblock_read_count, are fetched and read into the memory.

In a nutshell, if the SQL statement serves more as a batch query rather than OLTP, FTS(FULL Table Scan) is actually faster than Index read.

The reverse is true in case of Online Transactions because your SQL statement is expected to return only a few rows.

Have a specific case to discuss, please leave a comment or reach me at munish07@gmail.com. I would be glad to answer. 

Sunday, November 13, 2011

SQL running long?

If you are an IT person, I am sure you know what I am talking about. You have a SQL statement or a program/job that you run every day and it completes in a few minutes but today it has been running for hours. Nothing has changed as far as you know. It is still supposed to process the similar amount of volume. No change in the code yet the SQL does not seem to be finishing.

The answer is simple. It's execution plan has changed. Your DBA should be able to confirm that or you could check it out yourself provided you know the hashvalue or the SQL_ID of the SQL in question.

Run the below SQL for the sql_id in question. Oracle optimizer generates a plan hash value for every execution plan it generates and executes. If you see different plan hash values for the same SQL hashvalue or SQL_ID, this will confirm that SQL statement plan has changed and hence it is running long.


select
inst_id,sql_id,plan_hash_value,child_number,executions,round(buffer_gets/executions,2)
"buffer_gets/exec" , cpu_time/1000000 "Cpu Time(s)",round(rows_processed/executions,2) "Rows",
elapsed_time/1000000 "Elpased Time(s)"  from gv$sql where
sql_id='&sql_id'

Once you know that SQL plan did change, you would obviously want to know, what are the new and the old execution plans.
Run the below SQL Statement from the SQL_ID in question and for each child_cursor taken from above sql.


select * from TABLE(dbms_xplan.display_cursor('&SQL_ID',&child_cursor,'PEEKED_BINDS'))

Have a question? Please leave a comment and I would be glad to answer.




Saturday, November 12, 2011

Should I buy an Investment Property?

Real estate does not excite now-a-days as much as it used to do a few years ago. We are hearing about so many under-water mortgages, foreclosures, sub-prime mortgages, etc that they is a huge fear among all of us to even talk about real-estate let alone buy it for an investment.

Mr. Buffet once quoted, 'Be fearful when others are greedy and be greedy when others are fearful'. The more I think about this line, the more I appreciate it. In-fact, I feel it is true in all investment vehicles and at all times. 

Let us dig more closely into it.Real-estate always goes through up-down cycle.  It simply means when everyone in the office, friends, family, news channel starts talking positive about something, it excites people into it. This creates such an artificial demand that prices start going through the roof. Still, there will be number of people who will profit from such a upswing in a very short amount of time yet no one can predict where we are in the cycle. On the other hand, when everyone in the office, friends, family, news channel starts talking negative about something, it spreads fear among us. Everyone wants to get out of that investment whether that is any stock, or real-estate. This drives down rates much faster. Fear and Greed overpower our thinking process in such times. 

If you are thinking about investing your hard-earned money into real-estate but you are fearful, sit back, relax your mind and just think logically. Plan your investment as to when you would need your money. If you are disciplined enough and can wait out the greed or fear cycle, you would definitely get a very good return on your investment. In today's real-estate market, there are tons of properties that you can buy and rent them out for no out-of-pocket expenses. I, myself, am doing that. I bought a foreclosed condo in 2009 and have since been renting it. I am earning close to $800/month(almost $10,000/year) after deducting all my expenses like real-estate tax, condo fees, Landlord insurance, and other expenses. After renting it out for just 1.5 years, I recovered all of my total investment from the rental income itself. If I sell it after say 5 years at the same price that I bought it for, I would have made a handsome return of  20% annually. Keep in mind that my initial investment was only $10,000 to buy this condo plus another $5000 towards closing and fixing some minor things in the house. There is every chance that in the next 5 years, real-estate prices will not only stabilize, but it would start going up. 

In a nutshell, when you want to invest any money, don't let fear or greed drive your thinking. Plan your investment strategy well, and stick to it. Learn to profit from others' fears. 

Would you like to share your investment experience? I would be happy to post your story on my blog for others to learn from it. 


Monday, November 7, 2011

Peoplesoft Architecture


Let us look at PeopleSoft Architecture in easy to understand terms. 





Broadly speaking, PeopleSoft has 5 main components to support it's architecture.
a) Web Server:  it is a java-enabled web server to support browser transaction requests and the application messaging technology. It is also a collection of java servlets to handle wide range of PeopleSoft transactions. It is the web server that communicates with the client requests.


      b) Application Server: It executes business logic and issues SQL statements to the database. It consists of numerous services and server processes that handle transaction requests. It is also responsible for maintaining persistent connections with the databases. It is fair to say that application server is the heart of PeopleSoft Architecture.

      c) Database Server: It houses the database engine and PeopleSoft database. Database server can service many application servers. 
    
      d) Batch Server: It is the server where PeopleSoft Process Scheduler is installed and configured. It can be located on the same physical machine as the database server or on a dedicated machine or it can also be co-located with application server. 

      e) Application Designer: It is an integrated development environment that enables you to work with the numerous definitions of a business application in a single work area. In simpler terms, Application Designer is a tool that enables you to develop custom applications in PeopleSoft. 


      I can really go in a great detail for each of the above components or the architecture in general but I would love to answer the specific questions you have. Please leave your questions by posting a comment. I would promptly answer and cover them at great length.