+ All Categories
Home > Documents > Thomas Kyte's Top Things in Oracle Database 10g

Thomas Kyte's Top Things in Oracle Database 10g

Date post: 07-Nov-2014
Category:
Upload: patrick-zajac
View: 105 times
Download: 1 times
Share this document with a friend
Description:
Thomas Kyte's Top Things in Oracle Database 10g
Popular Tags:
16
Thomas Kyte’s Top Ten Oracle Database 10g New Features An Oracle White Paper December 2004
Transcript
Page 1: Thomas Kyte's Top Things in Oracle Database 10g

Thomas Kyte’s Top Ten OracleDatabase 10g New Features

An Oracle White PaperDecember 2004

Page 2: Thomas Kyte's Top Things in Oracle Database 10g

Thomas Kyte’s Top Ten Oracle Database 10gNew Features

Introduction........................................................................................... 3Flashing back.........................................................................................4PL/SQL Performance.............................................................................5Oracle HTML DB..................................................................................7Oracle Automatic Storage management (ASM)....................................9SQL Tuning......................................................................................... 10Online Redefinitions............................................................................11Case Insensitive Searching.................................................................. 12Fewer Invalidations............................................................................. 13Online Segment Shrinking.................................................................. 14In Conclusion.......................................................................................15

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 2

Page 3: Thomas Kyte's Top Things in Oracle Database 10g

Thomas Kyte’s Top Ten Oracle Database 10gNew Features

INTRODUCTIONIt is now a year since the introduction of Oracle Database 10g. In this paperand accompanying presentation, we’ll take a look at ten of thefeatures/functions I’ve personally seen provide great benefit – out of the boxreasons for upgrading to Oracle Database 10g. This is not a comprehensive listof all of the new features/functions in Oracle Database 10g, that would requirea book sized white paper and three or four days to present. Rather this is ashort list of ten high impact, immediate payback features that have been used inthe field. This is the result of answering questions on the sitehttp://asktom.oracle.com/ and customer engagements using the databasesoftware.

Briefly, the features we will be taking a look at are:

• Flashing Back – the unique ability of Oracle to allow you to undopretty much anything you’ve done, such as ‘accidentally’ dropping atable, or ‘accidentally’ deleting some information and committing.

• PL/SQL performance enhancements – that are just there, no need tochange much if anything to take advantage of them.

• Oracle HTML DB – a robust development environment for webbased HTML applications that requires zero installation on a client, forthe developer as well as the end user. This is a first.

• Oracle ASM – Automatic Storage Management. Oracle Database 10gintroduces a database file system to provide not only ease ofmanagement but availability features as well.

• SQL Tuning via the DBMS Advanced Rewrite package and SQLProfiles – for correcting SQL Performance/functionality issueswithout actually touching the SQL code itself.

• Online Redefinition – made easy. While Oracle Database 9i gave usthe ability to redefine (reorganize or restructure) tables in an onlinefashion – Oracle Database 10g takes this to a new level, making theentire process as easy and failsafe as possible.

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 3

Page 4: Thomas Kyte's Top Things in Oracle Database 10g

• Case insensitive searching – transparently, without a performancepenalty. In the past, performing case insensitive searches wassomething an application had to design for. Using Oracle Database10g – you can introduce case insensitive searching for an applicationin a totally transparent fashion.

• Fewer Invalidations – during your custom application upgrades.Using synonyms we can make it so that stored compiled databaseobjects (stored procedures, views and the like) do not requirerecompilation. This means less potential down time during a “patch”operation.

• Online segment shrinking – the ability to reclaim “deleted” spacefrom a database table without having to reorganize the entire object(uses significantly less space).

So, in this paper we’ll be taking a look at these features in particular andpointing you to where you can get more in depth information on each.

This white paper is meant to be accompanied by a presentation as well as a setof scripts that demonstrate each feature in turn. These are available under theOracle Open World San Francisco 2004 downloads on http://otn.oracle.com.

FLASHING BACKThe Oracle database has since version 4.0 supported a feature called “multi-versioning” and “read consistency”. This is the facility where by Oracle is ableto provide queries that are never blocked by modifications and queries thatreturn consistent point in time results – that is, all information returned by aquery is “as of” the same point in time, consistent as of that point in time. Inthe past, the database always choose the point in time your query would be “asof” or consistent. In general that point in time would be the time you openedyour query for processing. So, if you submitted a query to the database at 9amand retrieved the last row from it at 9:30am – all of the data that query returnedwould have been “as of 9am” – that query would not see any changes madeafter it started processing even though it was still running at 9:30am.

Starting with Oracle Database 9i – the database allows you to pick the point intime at which a query would be “as of”, this allows you to log into the databaseat noon and run an arbitrary query “as of 9am”. The database would use thesame technology it always used in the past to provide these point in time, readconsistent queries – it was just that for the first time, we can tell Oracle whattime to execute the query as of.

This feature has been greatly enhanced in Oracle Database 10g – going from asimple flash back query facility – to a “whoops, I made a mistake” recoverytoolkit. In Oracle Database 10g, we can not only query the database at a pastpoint in time (which would allow us to recovery accidentally deleted ormodified information) – we can tell the database to put the information back

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 4

Page 5: Thomas Kyte's Top Things in Oracle Database 10g

the way it was. Suppose you “accidentally” deleted/modified the configurationinformation for your application – it was the correct operation, you just did it inthe wrong database! Instead of searching for the DBA and performing arecovery operation on this database (and having the end users screaming whilethe application is offline), you can just ask the database to “put the table backthe way it was 5 minutes ago”. The FLASHBACK TABLE command uses theunderlying flashback query technology to put the table back the way it was –providing no database integrity constraints would be violated.

In addition to being able to simply put a table back the way it was in the past –the FLASHBACK TABLE command also allows you to undrop a databasetable. Have you ever ‘accidentally’ dropped the right table – in the wrongdatabase (you know it almost immediately, you get that really cold feeling). Inthe past, it was a major effort to get the table back. The DBA might be able touse an export DMP file (at the potential loss of all transactions that occurredafter the export), or perform a tablespace point in time recovery, or get theinformation from a standby database running in delayed apply mode. In a wellorganized shop, it was always possible to recover the object – it just took time(lots of it) and incurred downtime of your applications while you wererestoring the table. In Oracle Database 10g – it is a single command toimmediately bring the table and/or indexes “back from the grave”.

There is also a new FLASHBACK DATABASE command – this puts the entiredatabase back the way it was in the past. If you have ever been in the positionof having to restore an entire database and perform a point in time recovery toa point in time right before some awful mistake was made (like dropping theright user account – wrong database, or running the application that closes outthe books at the end of the year; for the second time!) you’ll appreciate theFLASHBACK DATABASE capability. Instead of restoring the entire lastbackup and replaying each and every transaction that happened since (well,except for the one that got your into this situation in the first place!) you cannow tell the database to go back 5 minutes in time (or more, or less).

For more information on flashing back – please see

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10734/toc.htm -- theOracle Database Backup and Recovery Advanced User's Guide 10gRelease 1 (10.1). Chapter 9 is all about Flashback Technology.

• http://www.oracle.com/technology/obe/obe10gdb/ha/index.html --Oracle By Example (OBE). These are online mini-lessons that walkyou through using flashback facilities to recovery from human error.

PL/SQL PERFORMANCEPL/SQL is the database stored procedure language. PL/SQL is an extremelyfeature rich, robust programming language and in Oracle Database 10g – it’sperformance is on par with many 3gl languages. I have found that if you have

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 5

Page 6: Thomas Kyte's Top Things in Oracle Database 10g

an existing Oracle database with lots of PL/SQL code in use – the very act ofsimply upgrading to Oracle Database 10g can significantly reduce yourruntime. On my website – asktom.oracle.com, I personally observed responsetimes that were 60-70% of the Oracle Database 9i response times under OracleDatabase 10g. The only thing we changed was the database software itself.The same machine, with the same CPU’s, disk and memory returned pages in60/70% of the time – without changing a single thing in the application. Thepayback you get will be dependent on how much time your PL/SQL spendsdoing SQL versus actual procedural code – in my case, the SQL accounted fora small percentage of the over all run time (finely tuned, small queries). Therest of the time spent processing was either my own developed PL/SQL code orthe Oracle HTML DB runtime engine (written in PL/SQL itself). The very actof upgrading to Oracle Database 10g reduced the time to render pagesdramatically.

There were two main reasons for this in my case:

• The new PL/SQL optimizing compiler

• Implicit array fetching

In the first case – the Oracle Database 10g PL/SQL compiler is just a bettercompiler than it was in the past. The compiler recognizes dead code,redundant code, inefficient techniques, and so on and fixes the problem. Theresults can be dramatic.

The second case – of implicit array fetching – means that PL/SQL is takingconstructs of the form:

For x in (select * from table) Loop Process data…End loop;

and optimizing them transparently. Instead of fetching the data from the queryrow by row as it did in the past, PL/SQL is silently “array fetching” 100 rows ata time. So, when you asked for the first row of data – PL/SQL retrieved thefirst 100 rows for us automatically. The next 99 fetches would not “context”switch from PL/SQL to SQL – resulting in improved overall performance. Inthe past, developers would have coded array fetching (referred to as BULKCOLLECT in PL/SQL terminology).

For more information on PL/SQL performance (and new functionally) see:

• http://www.oracle.com/technology/obe/obe10gdb/develop/index.html -- Oracle By Example -- the application development series. In thisOBE, you’ll find Using Oracle Database 10g PL/SQL new features

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 6

Page 7: Thomas Kyte's Top Things in Oracle Database 10g

• http://download- west.oracle.com/docs/cd/B14117_01/appdev.101/b10807/toc.htm --the PL/SQL User's Guide and Reference 10g Release 1 (10.1). Inparticular – the “What’s New in PL/SQL” section right at the front.

ORACLE HTML DBOracle HTML DB is perhaps the coolest application development environmentI’ve seen to date. I asked Sergio Leunissen, the product manager for OracleHTML DB to describe it briefly and he said:

Here's how it works, contained entirely in the database, HTML DB is made upof a metadata repository and an engine for the rendering and processing ofpages. When you're building your application, the definitions of pages, regions,templates, buttons, and fields are stored in the metadata repository. When anapplication runs, every page and all the content in it is rendered in real timefrom the metadata repository.

If you've developed Web applications using the PL/SQL Web toolkit andmod_plsql, you'll love how much time HTML DB saves you. Because theengine and the metadata repository reside inside the database, you have fullaccess to SQL and PL/SQL. Displaying data from the database on the Web issimply a matter of writing a SQL query. The rendering engine takes care of therest. In fact, if your SQL skills are a tad rusty, you can even rely on wizards towalk you through the steps of building a report based on one or more databasetables.

Similarly, inserting, updating, or deleting data in the database is a breeze.Whenever a page is submitted, the processing engine can run datamanipulation language (DML), such as an INSERT statement that you define.The INSERT statement will generally include user input from forms, whichmay be referenced using bind variable syntax. For example, say you wanted tocapture people's first names, last names, and phone numbers, and store thisinformation in the database. Assuming you already had a table to hold thisinformation, you'd start by adding fields, referred to as items, to a page. Itemshave unique names so that their values can later be retrieved from session state.After you add a button to the page to submit the information, all you need is aprocess to insert the data into your target table. Assuming you named youritems P1_FIRST_NAME, P1_LAST_NAME, and P1_PHONE, your processcould be implemented as the following insert statement:

insert into T (first_name, last_name, phone_number)Values (:P1_FIRST_NAME, :P1_LAST_NAME, :P1_PHONE);Note that the user input collection in form fields is retrieved from session stateusing bind variable syntax.

The HTML DB engine and the metadata repository provide a powerful andcomplete framework for building HTML user interfaces on top of the Oracledatabase. In fact, every screen in HTML DB is built using HTML DB!

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 7

Page 8: Thomas Kyte's Top Things in Oracle Database 10g

Now you know how HTML DB works. Here's a little bit more on its keycomponents: SQL Workshop, Data Workshop, and Application Builder.

SQL Workshop. The SQL Workshop allows you to interact with your databaseas you would with SQL*Plus with added features, such as database objectbrowsing, query by example, and data dictionary browsing.

Data Workshop. With the Data Workshop, you can load data into and extractdata from the database. My personal favorite feature allows you to take aspreadsheet and turn it into a database table in a few seconds. All you need todo is cut and paste your data from a spreadsheet and step through a wizard.Once you've turned your spreadsheet into a database table, you're only minutesaway from building a Web-based report that can be accessed by anyone with abrowser.

Application Builder. The centerpiece of HTML DB, the Application Builder isloaded with wizards to help build pages containing reports, forms, or charts.Pages are easily connected using branches.

There are nearly 75 predefined widgets you can use when you assemble yourapplication, from basic HTML form elements to more advanced pop-up lists ofvalues, pop-up calendars that select lists that automatically submit a page, andso on. Want to make sure data entered into forms is correct? Not a problem.You can add validations with mere mouse clicks. You can even use the regularexpression syntax new in Oracle Database 10g to perform validations on dataelements such as phone numbers, dates, or social security numbers.

The Application Builder's reporting capabilities are also very well-rounded.Common reporting user interface patterns such as pagination (the ability topage through a result set), user-controlled sorting on several columns, andhyperlinking to other reports or forms can all be added declaratively. That is,no coding is required, just a few mouse clicks.

Here are a few more features that will save time developing Web applications:

Session and state management. Each user running an HTML DB applicationalways has a session, and no coding for this is required. Every form elementyou place on a page using HTML DB automatically has associated sessionstate, managed in the database. Inside your application, you can reference anysession state variable used on any page using familiar bind variable syntax.

User interface control. Look-and-feel is separated from application logic anddata access through HTML DB's extensive use of templates. Templates areused to control the look-and-feel of pages, reports, buttons, tabs, menus, fieldlabels, and so on. This means you can quickly start building an applicationwithout having to worry about look-and-feel right away. Once you arecomfortable with the way your application works, you can design the HTMLtemplates. Or, you can simply choose from a gallery of template themesavailable in HTML DB.

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 8

Page 9: Thomas Kyte's Top Things in Oracle Database 10g

Flexible authentication and authorization schemes. If you decide yourapplication requires people to log in with a username and password, you caneither choose one of the prebuilt authentication schemes from the HTML DBgallery or build a custom scheme to suit your needs. Ready-madeauthentication schemes allow your application to use, among others, an HTMLDB user repository, an LDAP repository, or Oracle9/i/AS single sign-on tomanage user credentials.

Last, HTML DB natively supports team-based, "multitenant" hosteddevelopment. This means a single Oracle database can support multipledevelopment projects, each being developed by teams of people using only aWeb browser.

For more information on HTML DB, please see:

• http://htmldb.oracle.com/ -- the HTML DB homepage. Here you cannot only get the software (it works in Oracle Database 9iR2 StandardEdition and up!) but you can also get ideas/applications from an onlinerepository

• http://www.oracle.com/technology/obe/obe10gdb/develop/index.html -- Oracle By Example, for HTML DB.

• http://download- west.oracle.com/docs/cd/B14117_01/appdev.101/b10992/toc.htm --The Oracle HTML DB User's Guide Release 1.5

ORACLE AUTOMATIC STORAGE MANAGEMENT (ASM)ASM is a somewhat revolutionary concept in the database arena. It is a featurethat I personally could not have anticipated prior to Oracle Database 10g. In anutshell, ASM is the implementation of a database file system. After seeing it,it is the most natural thing in the world – I’m now surprised no one thought ofit before (hindsight being 20/20).

ASM removes the need for conventional file systems, files, and their associatedoverhead. If you think about what a file is – it is in fact a “database itself”. Afile is a very general purpose construct that must support anything – from asimple document, to your XML, to a database, to – well, anything. ASMremoves some of the generic aspects of a file system (you won’t be storing your‘files’ on ASM disk – only database data) and does just what a database needs(and not anything more). In fact the removal of “files” and “file systems”greatly enhances the manageability of any sized database for a DBA. There areno files to “move”, no more “hot disks” in need of rebalancing.

ASM provides for the DBA these fundamental capabilities:

• Automatic IO rebalancing as disks are added or removed from theirsystem. No longer does the addition of 100gig of new space mean theDBA must spend a week trying to figure out what files to move – and a

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 9

Page 10: Thomas Kyte's Top Things in Oracle Database 10g

weekend of downtime moving them (and then of course spending thenext week figuring out how many mistakes they made in the“rebalance” only to do it all over again).

• Increased availability on systems where mirroring was notimplemented – as ASM implements full 2 or 3 way mirroring of data.

For more information on ASM, see:

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10739/toc.htm -- theOracle Database Administrator's Guide 10g Release 1 (10.1), Part IIIAutomated File and Storage Management

• http://www.oracle.com/technology/obe/obe10gdb/manage/index.html -- Oracle By Example, Configuring and Using Automatic StorageManagement.

SQL TUNING The most frustrating thing in the world can be that problem SQL statement thatyou know if you could just rewrite it slightly – or tell the optimizer a little bitmore about the underlying data – or have the optimizer understand how youuse the query (for example, your query would return one million rows – but youonly ever fetch the first 10, 20 or 30 rows) everything would be OK.

In the past, you had to modify the application code in order to achieve this – tophysically modify a query, or to add a hint or to alter the session’s settings. Inmany cases this was not possible.

Enter automated SQL Tuning. The two facilities I’ve seen used with greatsuccess have been the SQL Profile and the advanced rewrite package.

The SQL Profiling feature is the capability of the database for the first time togather statistics about a query. Normally, the database records statistics forsingle things – a table, an index, a column or the system itself (IO and CPUstatistics). Now, with a SQL profile we can gather statistics that will allow theoptimizer to better understand how to process a complex query involving manytables and columns. This accomplished by sampling the data using thepredicates involved in the actual execution of the query (the database has beenwatching this query – and knows how you execute it and what inputs you use)and by performing partial executions of the query itself to adjust the estimatedcardinalities associated with various steps in the query plans. The closer theseestimated cardinalities are to the actual number of rows processed – the betterthe chosen plan will ultimately be.

SQL Profiling can also take into consider how a query is used in order to tuneit. For example, you might have a search function on your web site or in yourapplication somewhere. The search might process a query that returnshundreds of thousands or millions of records – but you only fetch the first 10,

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 10

Page 11: Thomas Kyte's Top Things in Oracle Database 10g

or 20 or 30 of them in order to display to the end user. The optimizer didn’tknow that however and optimized the query for total throughput – it came upwith a good plan to get the last row as soon as possible, however the way youuse the query in practice would lend itself towards a plan that returns the firstrows as soon as possible. The SQL Profile capability of Oracle Database 10gcovers that – it will give the optimizer that extra piece of information – that itshould optimize for initial response time – not for throughput – when it seesthis query.

The SQL Profile is 100% transparent to the application – a DBA wouldnormally “point” at a bad query (or set of queries) using the Oracle EnterpriseManager Grid Control, ask the database to “tune that query” and at the end,accept the profile that was generated.

For more information on the Automated SQL Tuning features in OracleDatabase 10g please see:

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10752/toc.htm --Oracle Database Performance Tuning Guide 10g Release 1 (10.1)

• http://www.oracle.com/technology/obe/obe10gdb/manage/index.html -- Oracle By Example, the section Proactively Tuning Your DatabaseUsing the SQL Tuning Advisor

ONLINE REDEFINITIONSOracle Database 9i introduced the capability to “reorganize” or redefine tablesonline – while transactions are performed against them. This was a huge stepforward – as it permitted the DBA to convert a table from a non-partitionedtable to a partitioned table for example – while the database was not only upand running but while people were actively using the table being converted. Imyself made use of this feature on my web site in order to convert my audittrail table from a single table into a table partitioned by month – without havingto shutdown for a while in order to do it.

However, the feature was very end user intensive in the version 9 timeframe.Meaning the DBA had to not only create a new table to redefine into, but alsowas responsible for creating any and all indexes, constraints, triggers, grants –everything. So the facility to redefine objects online existed, but it involvedmultiple steps in order to use it – and if you forgot an index, grant, constraint –whatever, it wouldn’t be detected by the software.

In Oracle Database 10g – the online redefinition process has been enhancedgreatly. In this release the DBA need not be responsible for all of thebookkeeping on the table being redefined – they can instead make a single callto copy all dependent structures – grants, indexes, constraints, triggers, etc.The database takes care of making sure everything you need to make that table“whole” is in place, you cannot accidentally ‘miss’ a grant or index anymore.

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 11

Page 12: Thomas Kyte's Top Things in Oracle Database 10g

This makes an online redefinition something you can do with a greater level ofconfidence – the less we humans are involved in the process sometimes, thebetter. The software won’t forget a grant – whereas we may well miss one.

For more information on how to use the online redefinition facility, please see:

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10739/toc.htm -- theOracle Database Administrator's Guide 10g Release 1 (10.1), chapter14 “Managing Tables”

• http://download- west.oracle.com/docs/cd/B14117_01/appdev.101/b10802/toc.htm --the PL/SQL Packages and Types Reference 10g Release 1 (10.1),chapter 68 “DBMS_REDEFINITION”

CASE INSENSITIVE SEARCHINGA common application requirement is to support case insensitive searching –so that “McDonald” and “Mcdonald” are considered the same. In the past, theapplication had to not only be aware of the requirement to perform caseinsensitive searching – but it had to code the SQL specifically for it – using theUPPER() or LOWER() function in order to convert all strings to the same case.The addition of function based indexes in Oracle Database 8i solved theperformance issue associated with case insensitive searching, howeverapplications had to be aware of the need for a case insensitive search and codetheir SQL accordingly. This was a cause for concern for applications beingmigrated from some other databases that allowed the DBA to specify that agiven table was to be searched in a case insensitive fashion – their existingSQL did not use UPPER() or LOWER() and hence the SQL had to be modifiedas they migrated.

With Oracle Database 10g – applications no longer need to be coded “caseinsensitive aware”. That is the following output is achievable:

SQL> select * from t where data = 'Hello';DATA--------------------HelloHeLlOHELLO

Notice how the SQL query did not have to use “where lower(data) = ‘hello’” toachieve the retrieval of all rows that contained the word hello in any case.Additionally – an index on the data column could and would be used whenappropriate – making this not only 100% transparent to the application but alsoextremely efficient. This will definitely allow applications to be migrated tothe Oracle Database 10g with even fewer modifications to the SQL than before

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 12

Page 13: Thomas Kyte's Top Things in Oracle Database 10g

– or just to turn on case insensitive searching in existing applications without arewrite.

For more information on this feature, please see:

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10749/toc.htm -- theOracle Database Globalization Support Guide 10g Release 1 (10.1),chapter 1 has a section on Accent-Insensitive and Case-InsensitiveLinguistic Sorts and Queries

FEWER INVALIDATIONSA common problem faced by many is how to make certain database changes –with minimal impact to the end user population. That is, how can we reduce orremove downtime for common changes. Prior to Oracle Database 10g –anytime you make a change to underlying objects – all dependent storedprocedures and views would go immediately invalidate and necessitate arecompile. On a busy system – this could be a serious issue, as the code cannotbe recompiled while someone is executing it and you start to generate abacklog of people waiting to run the newly recompile code!

As a concrete example, we’ll look at another website I’ve worked on internally.It is an employee phone book that generates about 7-10 hits per second everyday, all day long. The way the system was designed is there are two schema’s– each a duplicate of the other. These schemas hold the “people” data and arerefreshed alternately each night. So, on one day schema1 is refreshed – somedata cleansing routines are run, the data is verified and then a synonym was“repointed” to point at schema1 instead of schema2. The next night, theconverse would take place – schema2 would be refreshed, validated and thenpointed to.

The problem was – this repointing of the synonym would cause all of ourstored procedures and views to go invalid. That meant that the 7/10 newrequests that came in each second would “back up” – be placed on hold – whilethe code that was running completed. Most of the times this worked well, butfrom time to time the system would become so backed up that we would runinto issues – such as the middle tier spawning too many connections, orrefusing new connections until all of the existing requests were processed.This was causing downtime.

Enter Oracle Database 10g – now, the repointing of the synonyms no longerimmediately causes any sort of invalidations to occur. We can safely refreshthis small data mart – validate the new data and then start pointing to itimmediately, without worrying about a degradation of service (or even systemdowntime possibly)

To read more about this, see:

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 13

Page 14: Thomas Kyte's Top Things in Oracle Database 10g

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10743/toc.htm --Oracle Database Concepts 10g Release 1 (10.1), chapter 6Dependencies Among Schema Objects

ONLINE SEGMENT SHRINKINGAnother common DBA task is reclaiming space from tables that have grownover time, but because of data purges or just normal deletions by theapplication – have accumulated much ‘white space’ – space that had been usedby some row but is no longer in use.

In the past, the DBA would not only have to identify these objects – but theywould also have to determine the best course of action to “reorganize” them.Their options in the past have been:

• Export the object, drop it, and import it. This would incur downtime –and anytime the data goes out of the database, it isn’t “protected”anymore.

• Starting with Oracle Database 8i – they could use ALTER TABLE TMOVE to reorganize it. This would have to be followed with indexrebuilds right after. This was superior (far superior) to export andimport however it still incurred downtime.

• Starting with Oracle Database 9i – they could useDBMS_REDEFINITION to reorganize the object. This would allowthe object to remain online and available for modifications while thereorganization was taking place, but it involved significant DBA effort,time and two times the space.

Now, in Oracle Database 10g both problems -- identification of the issue andresolution of the issue – are greatly simplified. The database will identifysegments whose allocated space contains a significant amount of “free” spaceand alert the DBA to this fact. The DBA may then choose to perform an onlinesegment shrink – an in place reorganization of a database table. Conceptually,the database will read the table from the “bottom up” and as it hits rows at the“bottom” of the table – it will delete it and reinsert it at the “top” and committhe movement. This operation can take place while other sessions are activelymodifying this database table. When the last row that can be moved is movedto the top, the database can then de-allocate the storage that is no longerneeded by the table for the first time ever (in the past, when a table grew – itowned that space forever, until it was rebuilt).

For more information, please see:

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10739/toc.htm --Oracle Database Administrator's Guide 10g Release 1 (10.1), chapter13 Managing Space for Schema Objects

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 14

Page 15: Thomas Kyte's Top Things in Oracle Database 10g

• http://download- west.oracle.com/docs/cd/B14117_01/server.101/b10759/toc.htm --Oracle Database SQL Reference 10g Release 1 (10.1), chapter 12 SQLStatements: ALTER TABLE to ALTER TABLESPACE.

• http://www.oracle.com/technology/obe/obe10gdb/manage/index.html -- Oracle By Example, Proactively Managing Space Using the SegmentAdvisor

IN CONCLUSIONThis is by no means a comprehensive, inclusive list of new Oracle Database10g features and functions, not close. Rather, it is a short list of compellingnew features that I’ve seen used over the last year with great success. Manyare transparent – like PL/SQL just going faster, case insensitive searches.Others make life easier – like the enhanced online redefinition. All in all – theyare 10 reasons to consider getting on Oracle Database 10g.

Thomas Kyte’s Top Ten Oracle Database 10g New Features Page 15

Page 16: Thomas Kyte's Top Things in Oracle Database 10g

Thomas Kyte’s Top Ten Oracle Database 10g New Features December 2004

Author: Thomas KyteContributing Authors: Sergiou Leunissen

Oracle CorporationWorld Headquarters500 Oracle ParkwayRedwood Shores, CA 94065U.S.A.

Worldwide Inquiries:Phone: +1.650.506.7000Fax: +1.650.506.7200www.oracle.com

Copyright © 2004, Oracle. All rights reserved.This document is provided for information purposes only and the contents hereof are subject to change without notice.This document is not warranted to be error-free, nor subject to any other warranties or conditions, whether expressed orally or implied in law, including implied warranties and conditions of merchantability or fitness for a particular purpose. We specifically disclaim any liability with respect to this document and no contractual obligations are formed either directly or indirectly by this document. This document may not be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without our prior written permission.Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.


Recommended