Blog Upgrade, Wordpress 2.9.1….

I have just upgraded my blog to 2.9.1 version. In addition to it, I have upgraded few of my plugins as well. I must say, I am amazed at the speed at which all it happened! Keep it up Wordpress and also publish how you do it so that we can give some feedback to Oracle as well for the same :-) .

Happy upgrading :-) .

No Comments

Book Review, Middleware Management with Oracle Enterprise Manager Grid Control 10g R5….

We are entering into the DBA 2.0 era or I should say we have already entered quite deeply into it! And in this era, there is more and more penetration of graphical interfaced tools. Enterprise Manager (EM) from Oracle has evolved a lot in the last few years. The biggest change in EM came when it became web based from 10g onwards and was divided into two categories, Database Console( DBC) the free version and Grid Console(GC) , the paid and full blown version! Where DBC helps managing a single instance very well, there are limitations in it and the ability to manage one instance per console is the biggest one! GC completes that limitation and offers much more than just managing database! With so many goodies in GC, it becomes a deep topic which needs good mentoring to be done about it. Yes, there is a massive wealth of information in Oracle documentation about the subject, but if there is something which explains things in a more organized manner, I guess, that would make things much easier! And luckily Debu Panda ( here is the link to his personal site ) and Arvind Maheshwari has given us just that only with their book, Middleware Management with Oracle Enterprise Manager Grid Control 10g R5 which is released via Packt Publishing.

The book covers to a great depth the concepts of GC and how it works. After building up the base, the authors move us to the usage of GC which includes its installing it and further more, the deployment of Application Server and Weblogic Server. Going further enlightens us with various techniques and best practices of deployments using GC. There is an ample amount of information about the installation as well. The book covers the details in a well versed manner and the language chosen by authors is also very simple and easy to understand which makes it valued addition to the list of those oracle books, which one must have for a regular reference! Over all, a good write up and a recommended one!

, ,

No Comments

Grant ‘Very Happy 2010’ To All….

Yes its a wrong syntax if we see it from a technical point of view but it sounds perfect still! Another year is ending and a new year is just on the doorsteps. I wish you all who come here a very happy and prosperous 2010 and the best of the holiday season! Hope this year brings the best of everything for you and becomes one of the most memorable and happening years of your life! Have a great new year evening either tonight or tomorrow night( depending on where you are on this planet) and have lots of fun :-) .

2 Comments

Yes , AristaDBA Is Yet Alive….

I know I know, its been a very long time since I had written anything. I am not dead yet and I still work in the amazing world of Oracle database. I believe there is no excuse of not writing as it doesn’t take much time and whatever time a blog post would take, some how its always available. But still, one can’t help of his habit of being lazy so yes, I have been very lazy lately about writing anything. There were ( and still) some unhappy events also which did distract me. Well, looks like I am again just making excuses only isn’t it! Alright no more of them then but this post is just to mention that I am very much alive and soon, some new posts will see the sun shine! So stay tuned :-) .

1 Comment

Blog Upgrade, Wordpress 2.8.5 Is Here….

Just logged on to my blog’s dashboard to see that Wordpress 2.8.5 is out. So upgraded the blog using the Automatic upgrade. If you are reading this post, all went fine :-) .

No Comments

So Are You A Consultant?

Okay, apologies for a non-technical post but I guess, its worth sharing. I have received today via email from a friend of mine who himself is an consultant and I guess, its really good! If you have seen/read it already, again apologies! And yes, I am not going to post non-technical posts over here. Its just one of those rare ones :-) . Here we go,

A shepherd was herding his flock in a remote pasture when suddenly a brand-new BMW advanced out of a dust cloud towards him. The driver, a young man in an Armani suit, Gucci shoes, Ray Ban sunglasses and YSL tie, leans out the window and asks the shepherd, “If I tell you exactly how many sheep you have in your flock, will you give me one?” The shepherd looks at the man, obviously a yuppie, then looks at his peacefully grazing flock and calmly answers, “Sure. Why not?” The yuppie parks his car, whips out his Dell notebook computer, connects it to his AT&T cell phone, surfs to a NASA page on the internet, where he calls up a GPS satellite navigation system to get an exact fix on his location which he then feeds to another NASA satellite that scans the area in an ultra-high-resolution photo. The young man then opens the digital photo in Adobe Photoshop and exports it to an image processing facility in Hamburg, Germany. Within seconds, he receives an email on his Palm Pilot that the image has been processed and the data stored. He then accesses an Oracle database through an ODBC connected Excel spreadsheet with hundreds of complex formulas. He uploads all of this data via an email on his Blackberry and, after a few minutes, receives a response. Finally, he prints out a full-color, 150-page report on his hi-tech, miniaturized HP LaserJet printer and finally turns to the shepherd and says, “You have exactly 1586 sheep.” “That’s right. Well, I guess you can take one of my sheep.” says the shepherd. He watches the young man select one of the animals and looks on amused as the young man stuffs it into the trunk of his car. Then the shepherd says to the young man, “Hey, if I can tell you exactly what your business is, will you give me back my sheep? “The young man thinks about it for a second and then says, “Okay, why not?” “You’re a consultant.” says the shepherd. “Wow! That’s correct,” says the yuppie, “but how did you guess that?” “No guessing required.” answered the shepherd. “You showed up here even though nobody called you; you want to get paid for an answer I already knew, to a question I never asked; and you don’t know crap about my business. . . ” … Now give me back my goat.”

So are you an consultant LOL ?

,

5 Comments

DBMS_UTILITY, A Good Helping Hand For A DBA….

There are couple of stored packages which are not much popular but are immensely popular. If we use them in our daily routine tasks, there are many tasks which would be done very easily. Like this,there is a package called DBMS_UTILITY. I do talk about it a lot in a program of mine which talks about advanced usage of PL/SQL. This is an extremely useful package with many goodies coming along with it which can be handy. Just thought to share this package and some of the procedures that I use,

Port_String
This is a very handy function and answers a question which is asked almost very often that on which operating system, oracle is running. Using this, it comes very easily like follow,
SQL> select dbms_utility.port_string from dual;

PORT_STRING
——————————————————————
IBMPC/WIN_NT-8.1.0

SQL>

So I am running my Oracle 10201 on Windows NT based machine(Windows XP professional).

DB_Version

A very handy procedure to show the current database version and compatibility number. Surely, this can also come from V$version but the option is available from this procedure as well.
SQL>variable a varchar2(4000);
SQL>variable b varchar2(4000);
SQL> declare
  2  version varchar2(1000) default ‘Database Version’;
  3  compatible varchar2(1000) default ‘DB Compatibility’;
  4  begin
  5   dbms_utility.db_version(:a,:b);
  6  dbms_output.put_line(version||’====’||:a);
  7  dbms_output.put_line(compatible||’====’||:a);
  8  end;
  9  /
Database Version====10.2.0.1.0
DB Compatibility====10.2.0.1.0

PL/SQL procedure successfully completed.

SQL>

Get_Parameter_Value

This shows us the parameter value. Interestingly, this procedure doesn’t need DBA access to be avaiable to see the parameter values. Yuo can run it as a normal user as well and can see the parameter values.Note that this doesn’t apply to all the parameters that are present in the parameter file. So you need to play around a bit with it and check which one works and which doesn’t.Surely, this taks is not supposed to be for a normal user but just in case, if even a normal user needs to see the parameter values,this can come as useful.
SQL> conn new/new
Connected.
SQL> set serveroutput on
SQL> declare
  2  intval number;
  3  strgval varchar2(400);
  4  begin
  5  intval:=dbms_utility.get_parameter_value(‘background_dump_dest’,intval,strgval);
  6  dbms_output.put_line(‘Value of the parameter Background Dump Dest is ‘||’==== ‘||strgval);
  7  end;
  8  /
Value of the parameter Session Cached Cursors is ====
E:\ORACLE\PRODUCT\10.2.0\ADMIN\ORCL\BDUMP

PL/SQL procedure successfully completed.

SQL>

Like the above, there are many procedures and functions which can be very useful depending on how and where you use them. Docs have a very good description of each of these so I suggest you refer to docs for the complete description and guidelines. Here is the link for the same(11g),
http://download.oracle.com/docs/cd/B28359_01/appdev.111/b28419/d_util.htm#i996767

The idea of this blog post was just to give a "bump up" for this package which in my opinion can serve many purposes for a DBA. Hope it helps some where someone :-) .

5 Comments

Select For Update A DML, Yes It Is….

Okay, if you think that what the heck, this guy didn’t know this much even, well, its true. I didn’t know or to save myself, I would say, I did know what Select For Updat does , like it locks the rows and so on, but didn’t relate to the redo part. So when I came to know about it reading this thread(thanks to Mark) today I tested it out, it appears to be  true. So before I would forget about it, I thought to store it here. If you already knew, refresh your memories, if not , keep it in memory :-) .

A Select statement is merely meant to select the data from the table, that’s it, plain and simple. It doesn’t do anything else. It doesn’t generate any undo and redo in normal conditions but for a delayed block cleanout, it may generate redo as well. There are no locks which are acquired by it , there is nothing which gets changed. Yes it may look for the Snapshot Blocks if there are DMLs happening on the data which it is looking for but that’s it. Other than all this, it behaves properly :-) .

Select for update statement, is a cousin of Select only but it is not that simple as like its sibling. With For Update added , Oracle has to make sure that the candidate rows must be locked. And this means, for all the rows being effected, the lock byte of them would get locked , including the segment also whose row we are going to hit. This means, Select For Update is actually not just a select statement  but its a DML which actually would start a transaction, lock the rows, generate redo for changing their lock records and also would require a rollback explicitly given to get those locks released. Have a look,
<code>
SQL> select * from v$version;
BANNER
—————————————————————-
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 – Prod
PL/SQL Release 10.2.0.1.0 – Production
CORE    10.2.0.1.0      Production
TNS for Linux: Version 10.2.0.1.0 – Production
NLSRTL Version 10.2.0.1.0 – Production
SQL> create table testredo as select * from all_objects;
Table created.
SQL> set autot trace stat
SQL> select * from testredo;
49714 rows selected.
Statistics
———————————————————-
        288  recursive calls
          0  db block gets
       4041  consistent gets
        683  physical reads
          0  redo size
    5337330  bytes sent via SQL*Net to client
      36839  bytes received via SQL*Net from client
       3316  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      49714  rows processed
SQL> /
49714 rows selected.
Statistics
———————————————————-
          0  recursive calls
          0  db block gets
       3956  consistent gets
          0  physical reads
          0  redo size
    5337330  bytes sent via SQL*Net to client
      36839  bytes received via SQL*Net from client
       3316  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      49714  rows processed
</code>
There was no requirement for running the same select twice, I just ran it to ensure me that nothing fishy is going on :-) .

So there is no redo with the normal select. Let’s try out For Update now,

<code>
SQL> select * from testredo for update;
49714 rows selected.
Statistics
———————————————————-
        771  recursive calls
      50738  db block gets
       4862  consistent gets
          1  physical reads
   10369188  redo size
    4444384  bytes sent via SQL*Net to client
      36839  bytes received via SQL*Net from client
       3316  SQL*Net roundtrips to/from client
          4  sorts (memory)
          0  sorts (disk)
      49714  rows processed
WHOOOAAA! There is a lot of redo. Let’s see if there is some transaction record that we have got,
SQL> select * from V$locked_object;
    XIDUSN    XIDSLOT     XIDSQN  OBJECT_ID SESSION_ID
———- ———- ———- ———- ———-
ORACLE_USERNAME                OS_USER_NAME                   PROCESS
—————————— —————————— ————
LOCKED_MODE
———–
         9          8        364      52533        159
AMAN                           oracle                         4989
          3
SQL> select xidusn,xidslot,xidsqn from V$transaction;
    XIDUSN    XIDSLOT     XIDSQN
———- ———- ———-
         9          8        364
SQL>            
</code>
So there is indeed a transaction which got recorded and there is surely a lock that’s there on the object also. Let’s finish it off,
<code>
SQL>roll;
Rollback Complete
SQL> select * from V$locked_object;
no rows selected
SQL> select * from V$transaction;
no rows selected
SQL> set autot trace stat
SQL> select * from testredo;
49714 rows selected.
Statistics
———————————————————-
          0  recursive calls
          0  db block gets
       3956  consistent gets
          1  physical reads
          0  redo size
    5337330  bytes sent via SQL*Net to client
      36839  bytes received via SQL*Net from client
       3316  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      49714  rows processed
SQL>               
</code>
So we are back to from where we started.

A small but good learning , at least for me, thanks to Mark and Charles for their explanation over the the original thread.

Conclusion, think more deeply about something. At times, just knowing about the concept is not enough :-) . And yes, just for the record, select for update is a  DML statement, not just a normal select , that’s the actual conclusion right ;-) !

,

4 Comments

Test Post….

Just posting this post to test whether the psots are being able to come to the blog or not? Issues issues issues are there with the blog :-(

,

2 Comments

A Small Note About DBCA….

I am asked couple of times by some delegates to write some short notes about couple of topics which they find hard(boring should be right word to use I guess) to read from official oracle documentation. There are couple of topics like these and I finally thought to give a try for one of those. I tried to write a small note about DBCA and some things about it which can be beneficial if one knows about them. Its not an internal note so don’t think it like that way. Its just to understand the tool, its usage and some things related to it. I have mentioned the version of the note as 0.1 as I shall keep on modifying it based on the feedback/corrections that I shall receive ( and the version count will change accordingly ) . I must say thanks to Girish Sharma, Amardeep Sidhu who gave couple of inputs about some points and they were certainly very good. Sidhu even helped me how to make up the pdf file( yes I didn’t know how to do so). Thanks a bunch guys!

So without further wait, download the note from here. Its for the first time that I have attempted to do anything like this so I am part excited , part worried . Anyways, have a happy read and don’t forget the feedback/corrections :-) .

Update
1) Well, call it silly but today only I was told that the document is not formatted :-( . One of my friend looked at the document and that was the very first comment of him. Silly me! So now the document is formatted and the new copy is loaded.
2) Amit Bansal gave the feedback about formatting and also about the location of the data files being created using silent mode. According to the feedback, formatting is bit changed(improved I should say) and the note about datafile location is added. Thanks a bunch Amit, it was a really great feedback! Keep them coming :-) .

,

5 Comments