How not to let your Oracle database spin out of control

Growing pains? Who needs 'em!

  • alert
  • submit to reddit

Workshop Growing pains: How not to let your Oracle database spin out of control Oracle databases are a lot like children. They toddle along quite nicely, being polite and well behaved, until suddenly, they hit a massive growth spurt. They become teenagers and can make their administrators' lives a living hell. They double in size overnight, sprout schemas in weird places, and everything gets a lot more complex. They need a lot more intensive management. The database administrator becomes like a parent, trying to keep a monster under control.

If your business is doing well (hey! lots of customer orders) or in some cases, even if it isn't (the product is awful and customer support tickets treble) the chances are that the database is going to get bigger over time. You may not see the massive growth spurts that most teenagers encounter, but your database is still going to need some steering. Here's how to be prepared.

Track it

It's important to understand how the database size is increasing. There are various ways to do that. One is to use a tool to monitor database statistics on a regular basis. Look for issues such as memory overuse, I/O constraints, and bottlenecks in CPU usage. You can use the database monitoring screen in a system like Toad for Oracle for this. One common tactic used by savvy DBAs is to monitor tablespace sizes in Oracle.

You can do this using the statistics snapshot feature inside the database's Automated Workload Repository (AWR). That'll give you the statistics you need to monitor tablespace growth over time. You can access then from inside a script using the [DBA_HIST_SEG_STAT]() view. You can also use the historical 'wri$_optstat_tab_history' table to track table size, and v$datafile queries for database size.

Table partitioning

Those tables are going to get pretty big after a while, and that will cause problems. You'll start seeing marked decreases in performance on full table scans (where every block of a tablespace is searched). On very large tables, certain statements such as UPDATE can put the database under severe strain, by taxing its functionality.

When you write to a database table, it flows those requests through a buffer, holding them until they've been committed to the database, and then writing that to the REDO logs, that allow you to redo those transactions in the event of a database problem. But if you're doing a parallel UPDATE, say, then that buffer will be stuffed full of requests, and could begin to lock your database up.

Once you have identified your larger and fastest-growing tablespaces (and the largest may not be the fastest growing), you can go about selectively breaking them apart, to make them more manageable. That's where partitioning comes in.

Partitioning breaks a tablespace up into several subtables, and you can do it in four ways:

Lists This breaks up the partitions into subsets based on a data category you select. An example would be breaking up a sales table by country, and then perhaps by sub-region.

Ranges This partitioning method will break up the table according to a range of data, with time-based series such as dates being the most obvious.

Hashes Hashes allow you to specify partitions with equal numbers of rows, when the size disparity between ranges or lists would be too great.

Composites These partitions break up a tablespace by one method first, and then subsequently by another. For example, you might partition a sales table by month first (range) and then by product category (list).

You can also partition table indexes, too, to make those even faster to search.

Dell's Toad, which is probably the most popular third party Oracle DBA tool, helps you to keep track of your partitions from within its Schema browser. It indicates whether a table is partitioned, and lets you inspect that partition from a dropdown menu.

Information lifecycle management

Partitions should help you to make your database faster and easier to manage from the start, but you can use them to take further measures. For example, placing them across different physical disk spindles and I/O controllers should help to improve performance by reducing read bottlenecks, although this is likely to yield better results for hash partitions, where rows aren't grouped together in the same partition by a commonly searchable key.

You can also use partitions to manage the lifecycle of that information more effectively. For example, if you range partition by date, producing a partition for your sales per month means that you can begin to move your older partitions to lower-tiered storage (slower disk drives) over time. That can help to rein in your database size.

When moved to lower-tiered storage, this data is seen to be getting 'colder' - it's still accessible, but that access will be slower. This data can also be compressed more aggressively too, on the basis that it won't be accessed as often, in another activity known as compression tiering.

A new feature in Oracle 12c, Automatic Data Optimisation, lets you set up compression policies to handle this tiering automatically.

All of this assumes that your partitions are indeed being accessed relatively infrequently. You can check those assumptions about how often partitions are accessed using Heat Map, another new 12c feature that lets you scan visually for the most-accessed data.

Effective management and optimisation

After structuring your database properly, you can take still more measures to keep a database in line. One of them is memory management. Memory can suffer when dealing with large databases and complex queries. Enable the Automatic Memory Manager (AMM).

More broadly, though, a 'single pane of glass' system will help to give you visibility into key areas of database performance, such as transaction times. Think about a dedicated third-party tool for this, such as Toad, which can present a range of real-time performance feeds in an easy-to-read visual format.

That's the thing about databases that continue to grow; even after you've set them up for success, applying proper partitioning and ILM practices, they need constant nurturing, and monitoring.

There's always the danger that a database may begin to behave unexpectedly if different underlying aspects (such as tablespace sizes) grow faster than you expected. So a watchful eye and a powerful toolset is an important complement to robust architecture and design. ®

The Register is running a series of Oracle DBA workshop articles in association with Dell Software. Interested in learning more? Check out these Dell whitepapers.

More from The Register

next story
Microsoft to bake Skype into IE, without plugins
Redmond thinks the Object Real-Time Communications API for WebRTC is ready to roll
Microsoft promises Windows 10 will mean two-factor auth for all
Sneak peek at security features Redmond's baking into new OS
Mozilla: Spidermonkey ATE Apple's JavaScriptCore, THRASHED Google V8
Moz man claims the win on rivals' own benchmarks
FTDI yanks chip-bricking driver from Windows Update, vows to fight on
Next driver to battle fake chips with 'non-invasive' methods
PEAK APPLE: iOS 8 is least popular Cupertino mobile OS in all of HUMAN HISTORY
'Nerd release' finally staggers past 50 per cent adoption
DEATH by PowerPoint: Microsoft warns of 0-day attack hidden in slides
Might put out patch in update, might chuck it out sooner
Ubuntu 14.10 tries pulling a Steve Ballmer on cloudy offerings
Oi, Windows, centOS and openSUSE – behave, we're all friends here
Was ist das? Eine neue Suse Linux Enterprise? Ausgezeichnet!
Version 12 first major-number Suse release since 2009
prev story


Why cloud backup?
Combining the latest advancements in disk-based backup with secure, integrated, cloud technologies offer organizations fast and assured recovery of their critical enterprise data.
A strategic approach to identity relationship management
ForgeRock commissioned Forrester to evaluate companies’ IAM practices and requirements when it comes to customer-facing scenarios versus employee-facing ones.
Reg Reader Research: SaaS based Email and Office Productivity Tools
Read this Reg reader report which provides advice and guidance for SMBs towards the use of SaaS based email and Office productivity tools.
Top 5 reasons to deploy VMware with Tegile
Data demand and the rise of virtualization is challenging IT teams to deliver storage performance, scalability and capacity that can keep up, while maximizing efficiency.
Mitigating web security risk with SSL certificates
Web-based systems are essential tools for running business processes and delivering services to customers.