Friday, October 05, 2007

Oracle 11g - Snapshot Database

Oracle Database 11g...
What's in your server?

Greetings fellow DBA types. Here is another Oracle Database 11g New Feature, one in particular that I think is quite exciting, Snapshot Databases...

We take you into the bowels of a IT Shop where a conversation is just beginning...

(by the way, I love developers.... I really do. I'm just having fun with you if you are one!)

Developer: Hey DBA! We need to add an index!

DBA: Woops... the test database is being used for testing and I can't change anything now, so we can't test this new index.

Developer: Well, production is in a bad way, users are complaining and your job is on the line, we need to add this index. Do it or I call the boss, and you know he will tell you to do it, because everyone listens to developers and no one listens to DBA's. Of course, if the index does not work, they will blame you, not me!

DBA: Wait! I have an idea! We are using 11g, and our test database has a standby database! We can use Oracle's Snapshot Database!

Developer (stupid look on his face): What?? What is that??

DBA: A great new feature. I can make changes to our standby database like adding your index... we can test the changes, even changing data and the like. Then, just like magic, I flash the thing back and restart the capture process just like nothing happened.

Developer (still not quite understanding, but feinting that he does): WOW! What an amazing feature!

DBA: Yes, and now Oracle gives us easy commands to do this! I simply put the standby database in snapshot mode:

alter database convert to snapshot standby;

Then we add your index, and we test away. Once we are done I can revert the database back to a physical standby database:

alter database convert to physical standby;

and thats it, it's now a standby database again with all the changes, including the new index, rolled back and the redo being applied again from the main database!

Developer (lost, blank look... truly he does not understand): AMAZING! You DBA's have it made.

DBA: Yep!!

Yes, Oracle Snapshot Standby .... Coming in Oracle Database 11g. What's in your Server?

Wednesday, October 03, 2007

11g - OEM Secure Mode

As I was finishing off my writing on the Oracle Database 11g New Features book I came across this little gem that does not seem well documented. It appears that when you create the OEM repository now with emca, it creates it in what is called "secure mode". This means that there is an encryption key file created that is associated with the repositories encrypted data. Also during an upgrade Oracle will encrypt the existing repository for you. Oracle is so helpful!

The key file is called emkey.ora. It is located in the following directories:
  • For single instance databases:

    ORACLE_HOME/_/emkey.ora
  • For Oracle RAC databases:

    ORACLE_HOME/_/emkey.ora
Needless to say, this adds one more file to your backup strategy. Hopefully you already have OS level backups of $ORACLE_HOME occurring now, so you would be covered. Of course, the other option is to just drop and re-create your OEM repository after restoring your database, if the emkey.ora file was lost too.

However, this does not seem well documented, and I can't find anywhere that seems to describe what "secure mode" actually is.

Oracle Database 11g New Features is coming soon!! We are in the final stage before it goes to the printer (it's called page proofs). The book should be out in time for OOW!

End of line...... (for now)

Tuesday, September 18, 2007

Getting ready for 11g, how's your /dev/shm?

WOW I'm busy! Thats a good thing but it sure slows down my blog posting. I apologize for that. I've been working on my latest rant essay to post here, but it's not done yet, and I really should do something Oracle 11g related, so here it is!

As you may know, 11g now manages both the SGA and the PGA automatically though some new parameters, memory_size and memory_max_size.

Memory_size replaces sga_size and pga_aggregate_target, combining the two into one memory pool for Oracle to manage (well, not really one big memory pool, they are still separate, but Oracle deals with all the details under the covers).

Memory_max_size is roughly like sga_max_size + pga_aggregate_target, gobbling up memory for future use should you use it.

So, why the comment about /dev/shm? If you are going to move to 11g's flavor of memory management on Linux, then you might run into this little error:

ORA-00845: MEMORY_TARGET not supported on this system

and you might say to yourself, "Wow, that stinks, I can't use memory_target on Linux."

Well, thats not quite the case. In fact, the problem is likely that /dev/shm is not configured big enough. You will get this error if /dev/shm is not configured large enough to handle the memory you are allocating with memory_target. So, if you are planning on using these new features, be preparing now and increase the size if /dev/shm.

More on this and many other topics in my new Oracle Database 11g New Features book which is available for pre-sales now on Amazon.com. It will be out VERY SOON!!!

Wednesday, September 05, 2007

Greetings from Denver

I'm in Denver this week teaching a class. Wow, what a week. I flew to Denver in my airplane to teach. It was about a 4.5 hour flight and it was great! Nothing like flying over the rockies at 12,500 feet to get your blood pumping! Especially when the reported density altitude at the airports nearest to you (which are at about 7500 feet) is something on the order of 9,800 feet MSL (above sea level). You just hope your fuel calculations were right!!

Today has been the anti-technology day. Everything has broken and all at once. My wireless would not work, my cellphone would not dial out, we are using iSQLPlus here and that went south... UGH!

On a good note, I finished up the last chapter in Oracle Database 11g!! Yeahhhh.... So now it's a process of going through the edits and getting it ready to print. I love the writing but hate the editing process!!!

I'll try to post a new 11g feature shortly...

Thursday, August 30, 2007

Oracle 11g - Statisticly speaking!

OK, it's time for another Oracle Database 11g New Feature! Today some new statistics related features.

In Oracle database 11g you now have two new kinds of statistics that you can collect. Collectively these are known as extended statistics. The two kinds of extended statistics you can collect are:

1. Multi-column statistics
2. Expression statistics

Prior to Oracle Database 11g Oracle had no way of understanding the relationship of data within multiple columns of a where clause. Oracle Database 11g adds multicolumn statistics to the mix to try to solve this problem. Now the optimizer can generate more intelligent cost based plans when you have multiple columns in your where clause, based on the combined selectivity of both columns. Multi-column statistics are not generated automatically, when you generate statistics. You have to define the columns you want to generate the statistics on when analyzing the table. Here is an example of generating multi-column statistics on the table DUDE for columns DUDENO and DUDES_JOB. Note the "for columns" syntax that defines the columns to build the multi-column statistics on:

exec dbms_stats.gather_table_stats(null,'DUDE',
method_opt=>'for all columns
size skewonly
for columns (DUDENO,DUDES_JOB)');


Expression statistics allow Oracle to collect selectivity information based on the application of a function on a column. This has direct relationship to the use of function based indexes. Again, you collect expression statistics with dbms_stats when you collect table statistics as seen in this example:

begin
dbms_stats.gather_table_stats(null, 'DUDE',
method_opt=>'for all columns size skewonly
for columns (lower(dude_name))');

Now the optimizer can rationally make execution plan choices with regards to the selectivity of the data in the dude_name with the lower function applied.

There is even more in my new book, Oracle Database 11g New Features. It's available for pre-sales on Amazon and should be out in November!

http://www.amazon.com/Oracle-Database-11g-New-Features/dp/0071496610/ref=sr_1_2/102-1704151-7971347?ie=UTF8&s=books&qid=1188535426&sr=1-2

There are more new statistics related features in 11g including publish/subscribe and restore of old statistics!! I'll talk about that in another post.
 
Subscribe in a reader