Oracle® Database High Availability Overview 11g Release 2 (11.2) Part Number E10804-01 |
|
|
View PDF |
Planned downtime can be just as disruptive to operations as unplanned downtime. This holds especially true for global enterprises that must support users in multiple time zones, or for those that must provide Internet access to customers 24 hours a day, seven days a week.
In the past, planned downtime was necessary to perform periodic maintenance or to upgrade to new deployments including:
Periodic maintenance—such as patching or reconfiguring the system to update a database, application, operating system, middleware, or network.
New deployments—such as to perform major upgrades or new rollouts of the hardware, database, application, operating system, middleware, or network.
Table 4-1 shows the high availability solutions to eliminate or reduce planned downtime.
Table 4-1 High Availability Solutions to Reduce Planned Downtime
Solution | Reduces Planned Downtime Due to ... |
---|---|
Online patching, rolling upgrades, and migrations (planned maintenance topics in Section 4.1) |
System, clusterware, operating system, and database upgrades |
System and database changes |
|
Data changes |
|
Database migration to a new platform |
|
Application changes |
Section 4.1 summarizes Oracle's high availability solutions that prevent, tolerate, and reduce downtime for all types of planned maintenance.
Oracle provides high availability solutions to prevent, tolerate, and reduce downtime for all types of planned maintenance. Table 4-2 describes the various Oracle high availability solutions for planned downtime, along with the outage time that can be attained with each solution. In all cases, Oracle recommends that you extensively test before performing any rolling upgrade.
See Also:
Table 7-5 for a summary of the attainable recovery times for all types of planned downtime for each Oracle high availability architectureTable 4-2 Oracle High Availability Solutions for Planned Downtime
Maintenance Type | Oracle Recommended Solution | Solution Description | Outage Time |
---|---|---|---|
Operating system and hardware upgrades |
No downtime |
||
Oracle interim patches |
Oracle Real Application Clusters (Oracle RAC) |
No downtimeFoot 1 |
|
Online patches |
No downtime |
||
Oracle Clusterware upgrades and patches |
Oracle Clusterware |
No downtime |
|
Oracle ASM upgrades |
No downtime |
||
Storage migrationFoot 2 |
No downtime |
||
Migrating to Exadata Storage |
Oracle MAA best practices discussed in the "Best Practices for Migrating to Oracle Exadata Storage Server" white paper |
Outage time depends on solution chosen |
|
Upgrading Exadata Storage |
The Exadata Patch Manager |
No downtime |
|
Migrating a single-instance database to Oracle RAC |
Oracle Clusterware |
No downtime |
|
Migrating to Oracle ASM or migrating a single-instance database to Oracle RAC |
Seconds to minutes |
||
Patch set and database upgrades |
Oracle Data Guard using SQL Apply |
Seconds to minutes |
|
Platform migration across Windows and Linux platforms and other select platformsFoot 3 |
Seconds to minutes |
||
Platform Migration across the same endian format platforms |
Transportable database |
Minutes to hours |
|
Platform migration across different endian format platforms |
Transportable tablespaces |
Minutes to hours |
|
Patch set and database upgrades, platform migration, rolling upgrades, and when different character sets are required |
Section 4.1.10, Section 4.1.11, Section 4.1.12, and Section 4.5 |
Seconds to minutes |
|
Application upgrades |
No downtime |
Footnote 1 Patches that cannot be applied by performing a rolling upgrade can be applied with the MINIMIZE_DOWNTIME
option of the OPatch utility to reduce the availability impact of the patch application.
Footnote 2 An example is migration from traditional storage to low-cost storage.
Footnote 3 See My Oracle Support (formerly OracleMetalink) Note 413484.1 at http://metalink.oracle.com/
.
See Also:
Oracle Data Guard Concepts and Administration for more information about using Oracle Data Guard with SQL Apply to upgrade an Oracle database
Oracle Database Concepts and the Oracle Database Administrator's Guide for more information about transportable tablespaces
The MAA white papers about rolling upgrade best practices at
http://www.otn.oracle.com/goto/maa
Using Oracle RAC is the recommended solution for avoiding downtime during system and hardware upgrades.
If you cannot perform the upgrade using Oracle RAC, then the recommended solution is to use Oracle Data Guard and physical standby databases as described in Section 4.1.2. Alternatively, you can use cold cluster failover with Oracle Clusterware as described in Section 4.1.5.
Oracle RAC Solution Description
To perform upgrades using Oracle RAC:
Stop the application service if the application service runs on more than one instance in the cluster. If the application service runs on only the instance being upgraded, then relocate the service to another node in the cluster.
Stopping the application service implicitly redirects connections off of the destination instance when using fast application notification (FAN).
Shut down destination instance or instances with the IMMEDIATE
option.
Shut down and disable Oracle Clusterware.
Disabling Oracle Clusterware prevents it from starting automatically.
Perform maintenance.
Enable and start Oracle Clusterware.
This step implicitly starts the database instances.
Start the application service.
This step implicitly redirects connections to the destination instance when using FAN.
Repeat all steps on the next node.
Additional Considerations
Verify the following:
Ensure that the planned maintenance can be done in a rolling fashion from an operating system perspective.
Ensure that the database and clusterware versions are certified with the new system and hardware changes.
See Also:
Your operating system-specific Oracle Real Application Clusters installation guideOracle Data Guard and physical standby databases are the recommended solution for performing system and cluster upgrades that you cannot upgrade using Oracle RAC rolling upgrades. Oracle Data Guard is also recommended for migrations to Oracle ASM, Oracle RAC, 64-bit systems, Windows to Linux or Linux to Windows, or the same processor architecture platforms. For example:
Use Oracle Data Guard for system upgrades that cannot be upgraded using Oracle RAC rolling upgrades due to system restrictions.
Use Oracle Data Guard when migrating to Oracle ASM, from a noncluster environment to Oracle RAC, to a different platform with the same endian format, or to a different platform with the same processor architecture.
In general, you first upgrade the physical standby database and then perform an Oracle Data Guard switchover to the physical standby database.
To upgrade the physical standby database and perform a switchover:
Upgrade the system or change the physical standby database system to your destination environment.
For example, you can convert the standby database from a single-instance database to an Oracle RAC database by using Oracle ASM, without any impact on the primary database. Then, restart the standby database, ensure that it matches your destination environment, and wait for Redo Apply to finish applying all redo data to the standby database.
Perform an Oracle Data Guard switchover. Optimally, the switchover should take only seconds to minutes.
Shut down the original primary database (now the standby database).
Upgrade or make system changes to the original primary database.
Restart the upgraded database as a standby database and allow recovery to automatically synchronize the databases.
Optionally, perform an Oracle Data Guard switchover to return the standby database to the primary database role.
Additional Considerations
For fastest switchover, configure the standby database to use real-time apply and, if possible, ensure that the databases are synchronized before the switchover operation.
Use Oracle Data Guard and physical standby databases to perform system and cluster upgrades if Oracle RAC rolling upgrade or online patching is not possible. See Oracle Data Guard Concepts and Administration for more information.
The conversion from 32-bit to 64-bit is automatic if you are applying an Oracle Database patch set or doing an Oracle Database upgrade at the same time. If you are upgrading only the operating system, then you may need to perform additional post-upgrade steps that are described in support note 414043.1 at http://metalink.oracle.com/
. Also, see the Oracle Database Upgrade Guide for more information about upgrades.
Use Oracle RAC to avoid downtime when applying Oracle interim database patches. You can apply approximately 90% of the new patches using Oracle RAC.
If you cannot apply patches using Oracle RAC, then use Oracle Data Guard and physical standby databases. See Section 4.1.2 for more information.
Solution Description
Oracle interim (one-off) patches to database software are usually applied to implement known fixes for software problems, or to apply diagnostic patches to gather information about a problem. Plan to apply patches during a scheduled maintenance outage.
Oracle provides the capability to do rolling patch upgrades with Oracle RAC with little or no database downtime using the OPatch command-line utility.
An Oracle RAC rolling upgrade enables all but one of the instances of the Oracle RAC installation to be available during the scheduled outage, further reducing the impact on the application downtime required for scheduled outages. The Oracle OPatch utility enables you to apply the patch successively to the different instances in an Oracle RAC installation.
Additional Considerations
Performing a rolling upgrade is possible only for patches that are certified for rolling upgrades. Typically, patches that can be installed in a rolling upgrade include:
Patches that do not affect the contents of the database, such as the data dictionary
Patches not related to Oracle RAC internode communication
Patches related to client-side tools such as SQL*Plus, Oracle Database utilities, development libraries, and Oracle Net
Patches that do not change shared database resources, such as data file headers, control files, and common header definitions of kernel modules
Do not use Oracle RAC to perform rolling upgrades of patch sets.
See Also:
Your operating system-specific Oracle Real Application Clusters installation guideOnline patching is the recommended solution for avoiding downtime when an online patch is available for debug patches and interim patches.
Solution Description
Online patches are a special type of interim patch that you can apply while the instance remains online.
Oracle provides the capability to perform online patching with any Oracle database using the OPatch command-line utility.
Additional Considerations
Oracle provides combo patches, which are online patches that can also be applied when the instance is offline.
Thus, you can apply the online patch initially to avoid unplanned downtime. However, because online patches have a memory overhead, you should roll back the online patch and apply the offline patch during schedule downtime.
Oracle provides certified online patches for diagnostic patches or various bug fixes.
Oracle provides online patches when the patch does not change shared memory structures in the System Global Area (SGA), or other critical internal code structures.
Applying an online patch increases memory consumption on the system because each Oracle process uses more memory from the Program Global Area (PGA) during the patch application. Consider memory requirements before you begin applying an online patch. Each online patch is unique, and the memory requirements are patch-specific. Apply the patch on your test system first so that you can assess the effect of the online patch on your production system and estimate any additional memory usage.
See Also:
Oracle Universal Installer and OPatch User's Guide for Windows and UNIX for information about online patching and the OPatch utility
Oracle Database Upgrade Guide for an overview of rolling upgrades and rolling patches
Performing rolling upgrades of Oracle Clusterware is the recommended solution for avoiding downtime when upgrading Oracle Clusterware.
Solution Description
You can perform all upgrades to Oracle Clusterware in a rolling fashion.
See Also:
Your operating system-specific Oracle Clusterware installation guidePerforming rolling upgrades is the recommended solution for upgrading Oracle ASM.
Solution Description
You can perform all upgrades starting with Oracle Database 11g (and later releases) in a rolling fashion.
Using Oracle ASM is the recommended solution for performing storage migrations.
Solution Description
Oracle ASM enables you to add all disks in one storage array and subsequently drop all disks from another array. Oracle ASM automatically rebalances and migrates data to the new storage while the database remains operational.
Additional Considerations
Before removing the source storage array, ensure that the rebalancing is complete.
See Also:
The chapter about performing Oracle ASM Data Migration in the Oracle Database Backup and Recovery User's GuideThe guidelines in the MAA white paper "Best Practices for Migrating to Oracle Exadata Storage Server" define best practices for pre-migration, migration, and post migration from legacy storage to Oracle Exadata Storage Server. The best practices help you determine the most appropriate migration strategy given the application service levels and attributes.
The MAA white paper is available at http://www.oracle.com/technology/products/bi/db/exadata/pdf/migration-to-exadata-whitepaper.pdf
.
Solution Description
This section summarizes the steps described in the "Best Practices for Migrating to Oracle Exadata Storage Server" MAA white paper.
To migrate Oracle Exadata Cell deployments:
Pre migration:
Perform capacity planning
Employ Exadata configuration automation
Ensure the Infiniband network is used for Oracle Clusterware and Oracle RAC communication
Ensure proper Oracle ASM software and disk group attributes
Ensure proper database software and compatibility
Enable the DB_BLOCK_CHECKSUM
initialization parameter
Migration:
Configure the Oracle ASM allocation unit size to 4 MB
Configure optimal database extent sizes
Choose to migrate to Oracle Exadata Storage Server either logically or physically:
Logical migrations: database extent size changes
Physical migrations: no database extent size change
Create new tablespaces on Oracle Exadata Storage Server
Post-Migration:
Check disk groups for rebalance
Assess index requirements
See Also:
The HP Oracle Exadata Storage Server Web site athttp://www.oracle.com/technology/products/bi/db/exadata/index.html
See the Oracle Exadata Storage Server Software documentation to learn about the solutions and tools used to perform upgrades.
See Also:
My Oracle Support (formerly OracleMetalink) Note 791275.1 at http://metalink.oracle.com/
that includes:
Oracle Exadata Storage Server Software Documentation Addendum
Oracle Exadata Storage Server Software Planning and Deployment Guide
Oracle Exadata Storage Server Software Patch Application Example
The HP Oracle Exadata Storage Server Web site at http://www.oracle.com/technology/products/bi/db/exadata/index.html
Oracle Data Guard using SQL Apply is the recommended solution for performing patch set and database upgrades with minimal downtime. Section 4.1.10.1 describes this solution. If the source database is using data types not natively supported by SQL Apply, you can use Extended Datatype Support (EDS) to accommodate several more advanced data types.
If the source database is using a software version not supported by SQL Apply rolling upgrade (earlier than Oracle Database release 10.1.0.3) or using EDS cannot sufficiently resolve SQL Apply data type conflicts, then consider using Database Upgrade Assistant (DBUA)Foot 1 , transportable tablespace, or Oracle Streams:
DBUA provides a graphical user interface (GUI) utility that guides you through the upgrade process and is the simplest and recommended method of upgrading a database. However, if the time it takes DBUA to upgrade a database does not fit in the defined maintenance window, then consider using transportable tablespaces to perform a database upgrade in less than one hour.
Transportable tablespaces is the solution if you cannot use SQL Apply but the maintenance window requires downtime to be less than an hour in duration, and the database being upgraded has a small number of simple schemas and data files that do not need to be transferred as part of the transport process (such as when the data files will be used in place). Section 4.1.10.2 describes the transportable tablespace solution.
Oracle Streams is the solution that provides the most flexibility when performing database upgrades and additional data type support. Section 4.1.10.3 describes this solution.
See Also:
Oracle Database High Availability Best Practices for more information and for help choosing the database upgrade method appropriate for your configurationTo upgrade an Oracle database using SQL Apply:
Upgrade logical standby database to the new release and evaluate the change.
Ensure that SQL Apply has applied all redo data to the logical standby database.
Disconnect applications.
Perform an Oracle Data Guard switchover.
Reconnect applications to the new primary database.
Shut down the original primary database (now the logical standby database).
Execute database software upgrade steps on the new standby database.
Restart the standby database and allow recovery to synchronize.
Optionally, perform an Oracle Data Guard switchover to return to the original database.
Additional Considerations
SQL Apply rolling upgrades are only supported for Oracle Database release 10.1.0.3 and later. For complete information, see the chapter about using SQL Apply to upgrade Oracle Database in Oracle Data Guard Concepts and Administration.
SQL Apply has some data type restrictions (see Oracle Data Guard Concepts and Administration for a list of the restrictions). If there are data type restrictions, consider implementing Extended Datatype Support (EDS).
EDS enables SQL Apply to replicate changes to tables that contain some data types not natively supported from one database to another. Beginning with Oracle Database 10g Release 2 (10.2.0.4) Patch Set 3, SQL Apply supports the ability for triggers to fire on the logical standby database, which provides the basis of EDS. For an overview of EDS, see the MAA white paper "Extended Datatype Support" available at http://www.otn.oracle.com/goto/maa
.
For examples using EDS to support data types that are not natively supported by SQL Apply, see support note 559353.1 at http://metalink.oracle.com/
.
Beginning with Oracle Database 11g release 11.1, you can use a physical standby database to execute a rolling database upgrade using the KEEP IDENTITY
clause and a transient logical standby database.
Oracle Data Guard is the best approach if performing an Oracle RAC rolling upgrade is not possible and there are no data type restrictions.
See Also:
The following MAA white papers available at http://www.otn.oracle.com/goto/maa
:
"Database Rolling Upgrade Using Data Guard SQL Apply"
"Database Rolling Upgrade Using Transient Logical Standby"
If you cannot use SQL Apply because of data type conflicts, and testing shows that upgrading with DBUA cannot meet uptime requirements, then consider using transportable tablespaces to upgrade your database.
To use the transportable tablespaces feature to upgrade an Oracle database:
Install Oracle Database software on the destination system and perform the initial steps on the source database to prepare for the transport process.
Prepare the source and destination databases:
Gather information from the source database.
Create the destination database with Database Configuration Assistant (DBCA).
Prepare the destination database for Oracle Data Pump usage and to accept the tablespaces being transported.
Transport the user tablespaces:
Ready the source database for transport by disconnecting users and restricting access to the source database, making all user tablespaces READ ONLY
, and capturing sequence starting values from the source database.
Stop Redo Apply and shut down the standby database.
Transport the user tablespaces.
Verify that the destination database is complete and functional, and then back up the destination database.
See Also:
The MAA white paper "Database Upgrade Using Transportable Tablespaces" available athttp://www.otn.oracle.com/goto/maa
Additional Considerations
The transportable tablespace feature is an option for performing a database upgrade in less than one hour for databases that have simple schemas and where the data files do not need to be transferred as part of the transport process (such as when the data files will be used in place). See the MAA white paper "Database Upgrade Using Transportable Tablespaces" available on the MAA Web site at
Using transportable tablespaces reduces database upgrade time by moving all user tablespaces from a database running an earlier software release to an empty destination database running a current software release. With transportable tablespaces, tablespace data files are plugged in to the database by copying the data files to the destination database, then importing the object metadata into the destination database.
Oracle Streams is similar in function to Oracle Data Guard SQL Apply. Like SQL Apply, Oracle Streams can use Extended Datatype Support (EDS) to replicate changes to tables that contain some data types not natively supported from one database to another.
To perform a database upgrade using Oracle Streams:
Before you begin the upgrade process, see Oracle Streams Concepts and Administration for information about how to perform a database upgrade on a database that has user-defined types.
Create a duplicate database. (The ideal replica will begin as a physical standby database that is up-to-date.)
Activate and upgrade the database to the later version.
Enable Oracle Streams replication.
During the upgrade of the replica, the source database continues ahead. After the replica is caught up, perform a switchover.
See Also:
Oracle Streams Concepts and Administration for complete information about performing an online database upgrade with Oracle Streams
Oracle Database Backup and Recovery User's Guide to learn about duplicating a database
Consider the following approaches when you perform platform migrations across the same endian format platforms:
Oracle Data Guard (physical standby database) is the recommended solution for performing platform migration across Linux and Windows platforms. Section 4.1.2 describes this solution.
If cross-platform physical standby database is not available for the platform combination to be migrated, then use the transportable database feature. Section 4.1.11.1 describes this solution.
If the transportable database feature cannot perform the migration quickly enough, then use Oracle Streams. Section 4.1.11.2 describes this solution.
Use transportable database for platform migration only when cross-platform physical standby database or logical standby database is not supported for the platform combination in questionFoot 2 .
For example, to move from Windows x86-64 to Linux x86-64, it is best to use a cross-platform standby database instead of transportable database. There is less downtime (only the time it takes to switch over) and it is possible to run the standby database on the new platform temporarily to ensure that everything is working as planned.
To perform a platform migration using transportable database (with destination system conversion):
The high-level steps are as follows:
Place the source database in read-only mode.
Run the RMAN CONVERT DATABASE
command.
Move files to the destination system.
Run RMAN generated script to convert data files with undo data to destination platform format.
Run RMAN generated script to complete the migration.
When using transportable database, the downtime required for a platform migration is determined by the time needed to:
Place the source database in read-only mode
Convert data files that contain UNDO
to the new platform format (data files without UNDO
do not require conversion)
Transfer all data files from the source system to the destination system
You can significantly minimize this time by using a storage infrastructure that can make the data files available to the destination system without the need to physically move the files.
Invalidate and recompile all PL/SQL using SQL scripts utlirp.sql
and utlrp.sql
See Also:
The "Platform Migration using Transportable Database" white paper available athttp://www.otn.oracle.com/goto/maa
Oracle Streams enables replication of updates between multiple databases, independent of Oracle platform or database release. Therefore, Oracle Streams may provide the fastest approach for database upgrades and platform migration.
Oracle Streams provides database support for a wide variety of datatypes, but does not provide native support for data movement of some advanced datatypes, such as for SDO_GEOMETRY
and object types. However, you can work around datatype restrictions as follows:
By using Extended Datatype Support (EDS), you can take advantage of the flexibility of Streams to accommodate several more advanced datatypes.
A PL/SQL package, EXTENDED_DATATYPE_SUPPORT
(EDS), is available to generate the appropriate database objects to accomplish this workaround. The EXTENDED_DATATYPE_SUPPORT
package is available for download as an attachment to this article. The downloaded file (available from My Oracle Support Note 556742.1:1) contains a Readme file and SQL files to load in the database.
The EDS package generates workaround scripts to enable Oracle Streams support on tables with the following data types:
Object column with simple object types
Object column with nested object types
Varray
Spatial type SDO_GEOMETRY
XMLType
After installing the EDS package, you can query the EDS_SUPPORTED
view to identify the list of tables with datatypes unsupported natively by Oracle Streams that can be supported with EDS.
By creating shadow tables on the source database.
You can create a trigger on tables with unsupported data types to capture and propagate changes to tables with supported data types. Those changes are replicated by Oracle Streams to the destination database. You can customize the apply mechanism to apply the changes to the original tables in the destination database.
Oracle Streams implementations are very flexible and can be customized, and thus may require additional effort for configuration, testing, and administration.
To perform a platform migration with Oracle Streams:
Set up the Oracle Streams environment on the source database.
Instantiate the replica database (destination database) using the new destination version or on the destination platform.
Set up the Oracle Streams environment on the destination database.
Enable Oracle Streams to propagate all changes made on the source database to the destination database to completely synchronize the destination database with the source.
Connect users to destination database and shutdown source database.
Remove the Oracle Streams configuration.
See Also:
The MAA white paper "Extended Datatype Support: SQL Apply and Streams" at http://www.otn.oracle.com/goto/maa
My Oracle Support Note 556742.1:1 at http://metalink.oracle.com
Consider the following approaches when performing platform migrations on different endian format platforms:
Transportable tablespace is the recommended solution for performing platform migration across different endian format platforms and reduces downtime significantly. See the "Solution Description for Transportable Tablespace" section for more details.
Oracle Data Pump is the simplest of all the approaches. See Oracle Database Utilities for complete information about using Oracle Data Pump.
For planned downtime of potentially seconds, consider using Oracle Streams as described in Section 4.1.11.2, "Solution Description for Platform Migration Using Oracle Streams".
Solution Description for Transportable Tablespace
Migrating a database to a new platform using a different endian format with transportable tablespaces requires the following high level steps.
To migrate a database to a new platform using Transportable Tablespace:
Create a new, empty database on the destination platform.
Import objects required for transport operations from the source database into the destination database.
Export transportable metadata for all user tablespaces from the source database.
Transfer data files for user tablespaces to the destination system.
Use RMAN to convert the data files to the destination system's endian format.
Import transportable metadata for all user tablespaces into the destination database.
Import the remaining database objects and metadata (that were not moved by the transport operation) from the source database into the destination database.
If the destination database is being moved to a new location (for example, to a new data center) during the migration, then create a physical standby database from the original primary database co-located with the destination database. After an Oracle Data Guard switchover, transport the tablespaces from the source to the destination without incurring the file transfer time as part of the downtime.
Additional Considerations
Transportable tablespace has limitations and restrictions in regard to character sets, opaque types, and system tablespace objects. Unlike previous solutions, the steps are not automated.
Perform a platform migration using transportable tablespaces if all of the following are true:
The source and destination platforms have different endian formats.
The time required to perform a full Data Pump Export and Import does not fit in the maintenance window.
See Also:
The MAA white paper "Oracle Database 10g Release 2 Best Practices: Platform Migration using Transportable Tablespaces" available at http://www.otn.oracle.com/goto/maa
Oracle Database Backup and Recovery User's Guide for information about data file conversion
For system and database changes, use the dynamic resource provisioning features that are discussed in the following sections:
Oracle continues to broaden support for dynamic reconfiguration of the database, enabling it to adapt to changes in hardware demands without any service interruptions. Oracle Database dynamically accommodates various changes to hardware and database configurations by providing the ability to:
Add and remove processors from a symmetric multiprocessing (SMP) server
Add and remove nodes and instances in an Oracle RAC environment
Dynamically grow and shrink its shared memory allocation and automatically tune memory online using automatic shared memory management
Add and remove database disks online without disturbing database activities using Oracle ASM
Add and remove storage arrays or Exadata Cells online without disturbing database activities using Oracle ASMFoot 3
Automatically rebalance the I/O load across the database storage using Oracle ASM
Move data files online when adding or dropping disks using Oracle ASM, which automatically rebalances database storage whenever the storage configuration is changed
Change almost all initialization parameters without shutting down the instance, by using either of the following SQL*Plus statements:
The ALTER SESSION
statement changes the value of a parameter during a session.
The ALTER SYSTEM
statement changes the value of a parameter in all sessions of an instance for the duration of the instance.
These capabilities provide no-cost system changes and capacity on-demand provisioning, both of which are fundamental requirements of enterprise grid computing.
Two memory management initialization parameters, MEMORY_TARGET
and MEMORY_MAX_TARGET
, enable automatic management of the System Global Area (SGA), Program Global Area (PGA), and other memory required to run Oracle Database.
MEMORY_MAX_TARGET
specifies the maximum value to which MEMORY_TARGET
can grow dynamically.
Table 4-3 MEMORY_MAX_TARGET and MEMORY_TARGET
IF ... | AND ... | THEN ... |
---|---|---|
You omit |
You omit |
The initialization parameters are left at their default values (0) and Oracle Database does not automatically tune memory |
You omit |
Include a value for |
The database automatically sets |
You omit |
Include a value for |
The |
Oracle Database uses a noncentralized policy to free and acquire memory in each subcomponent of the SGA and the PGA. Oracle Database automatically tunes memory by prompting the operating system to transfer granules of memory from less needy to more needy components. The granularity of the memory transfer is dependent on the current free memory and the amount of memory the operating system requires to maintain a basic level of service.
Note:
Automatic memory management with theMEMORY_TARGET
and MEMORY_MAX_TARGET
initialization parameters is supported on Linux, Windows, Solaris, HP-UX, and AIX. See Oracle Database Concepts and the Oracle Database Administrator's Guide for more information about all supported platforms.Oracle ASM automatically distributes data files, control files, and log files across all available disks. Database storage is rebalanced whenever the storage configuration changes, including adding and removing disks, Exadata Cells, or storage arrays. Oracle ASM provides redundancy through the mirroring of database files, and provides optimal performance by automatically striping database files across available disks.
See Also:
For more information about Oracle ASM:One way to enhance availability and manageability is to allow user access to the database during a data reorganization operation. The Online Reorganization and Redefinition feature in Oracle Database offers administrators significant flexibility to modify the physical attributes of a table and transform both data and table structure while allowing user access to the database. This capability improves data availability, query performance, response time, and disk space usage. All of these are important in a mission-critical environment and make the application upgrade process easier, safer, and faster.
This online architecture provides the following benefits:
Online table reorganization and redefinition:
Change any physical attribute of the table online, including moving the table to a new location, partitioning the table, and converting the table from one organization (such as heap-organized) to another (such as index-organized).
Change many logical attributes such as column names, types, and sizes. Columns can be added, deleted, or merged. However, you cannot modify the primary key of the table.
Online index operations:
Create indexes online and analyze them simultaneously. You can also use online repair of the physical guess component of logical rowids (used in secondary indexes and in the mapping table for index-organized tables).
Reorganize an index-organized table and secondary indexes online to eliminate the reorganization maintenance window. Secondary indexes support efficient use of block hints (physical guesses). You can also perform online repair of invalid physical guesses of logical rowids stored in secondary indexes on an index-organized table.
Reorganize an index-organized table or table partition without rebuilding its secondary indexes, resulting in a short reorganization maintenance window.
Online moves of partitioned tables
Online reorganization support for advanced queues, clustered tables, materialized views, and abstract data types (objects)
Fast ADD COLUMN
operations with default value (does not need to update all rows to default value)
Speedier application migration and testing with Invisible Indexes:
Speeds up migration with explicit hints, then drops when finished
Prevents premature use of newly created indexes
Tests effects of DROP INDEX
, making the index visible if needed, thus there is no need for an index rebuild
Online index builds with no pause to DML (no exclusive DML locks are required)
No recompilation of dependent objects when online redefinition does not logically affect objects (for example, when columns are added to tables, or when procedures are added to packages)
Easier table DDL operations online (there is an option to wait for active DML operations instead of aborting)
Support for redefinition of tables that have materialized views or materialized view logs
The ability to modify table physical attributes and transform both data and table structure has been available since Oracle8i. Table 4-4 provides a comprehensive table of data reorganization capabilities.
Table 4-4 New Data Reorganization Capabilities by Release
Action | Oracle 9i | Oracle Database 10g Release 1 | Oracle Database 10g Release 2 | Oracle Database 11g |
---|---|---|---|---|
Online Reorganization using the package |
Modify table storage parameters Move the table to a different tablespace Add support for parallel queries Add or drop partitioning support Re-create the table to avoid fragmentation Change from a table to an Index-Organized Table, or vice-versa Add or drop a column Transform a column using a function |
Clones grants, constraints, and triggers Convert a LONG to a LOB Reorganize using a unique key Specify columns to order table by |
Reorganize a single partition Advanced queue and clustered tables Table containing an ADT Retain and clone statistics Clone check and not null constraints Copies dependent objects for nested tables |
Table with materialized view logs or materialized views No recompilation of dependent objects when redefinition does not logically affect objects |
Reclaiming Unused Space |
Not applicable |
Use the ALTER TABLE ALTER INDEX ALTER MATERIALIZED VIEW ALTER MATERIALIZED VIEW LOG |
Not applicable |
Not applicable |
Index Create Online |
|
Not applicable |
Not applicable |
DML lock-free online index creation, allowing transparent creation with no dependency on workload |
Index Coalesce Online |
|
Not applicable |
Not applicable |
Not applicable |
Index-Organized Table Move Online |
|
Not applicable |
Not applicable |
Not applicable |
See Also:
Oracle Database Administrator's GuideFor database migration to a new platform, use the transportable technology features. Transportable technologies provides transportable database and transportable tablespace:
Transportable database moves an entire database (user data and the Oracle dictionary) to a new platform with the same endian format. Transportable database permits a minimal downtime migration to a new platform by avoiding the time-consuming method of unloading all user data from the source database and loading it into the destination database.
Transportable tablespaces moves a subset of one database into another, even among platforms that differ in endian format:
You can use the cross-platform capability of transportable tablespaces to migrate all user data in a database to a new platform with a different endian format. Leveraging transportable tablespaces in this manner permits a minimal downtime migration to a new platform by avoiding the time-consuming method of unloading all user data from the source database and loading it into the destination database.
You can use transportable tablespaces to reduce downtime for database upgrades in circumstances where the database has simple schemas and when the data files do not have to be copied during the transport process (for example, when the data files are used in place.
See Also:
Section 4.1.10.2, "Solution for Database Upgrades Using Transportable Tablespaces" and Section 4.1.11.1, "Solution Description for Platform Migration Using Transportable Database"
Oracle Database Administrator's Guide for details about how to move or copy tablespaces to another database, including details about transporting tablespaces across platforms
For application changes, use the features described in the following list that can significantly reduce (or eliminate) the application downtime required to make changes to an application's database objects:
Edition-based redefinition allows you to upgrade the database component of an application while the application is in use, thereby minimizing or eliminating down time. Your changes do not affect users of the application who continue to run the unchanged application until you make the upgraded application available to all users.
In favorable cases, rollover is possible. The pre-upgrade and the post-upgrade editions can be used concurrently so that sessions that were started before the post-upgrade edition was published can continue to use the pre-upgrade edition until they are terminated naturally while new sessions use the post-upgrade edition. In less favorable cases, all pre-upgrade sessions must be terminated before new sessions can be allowed to use the post-upgrade edition. In such cases, the application suffers a small amount of downtime.
The following sections describe the Editions, Editioning Views, and Crossedition Triggers features of edition-based redefinition.
Editions are nonschema objects; as such, they do not have owners. Editions are created in a single namespace, and multiple editions can coexist in the database. The edition feature allows you to copy database objects and redefine the copied objects in isolation.
Editions provide a privacy mechanism for installing new code and for making data changes so that the running production application does not see the changes. When all the required changes have been made in private, they are published in a single atomic operation.
If you change the structure of one or more tables, you must also use the editioning view feature to insulate application code from changes made to the underlying table during online application upgrade. Tables are not editionable.
Columns are added to the underlying table and a new editioning view is created in the post-upgrade edition to expose and to populate them. (Editions do not allow versions of the underlying table.)
Triggers may be created on an editioning view and its columns may be used in SQL hints. The defining SELECT
statement for an editioning view has exactly one table in its FROM
list and NO WHERE
clause. The SELECT
list is used to project a subset of the table's columns and, typically, to rename them. It therefore defines a mapping of physical columns to logical columns.
Crossedition triggers are used as part of edition-based redefinition to keep the data in the pre-upgrade and post-upgrade editions in step with each other. The pre-upgrade application remains in use concurrently while changes are applied, redefining the pre-upgrade edition to a post-upgrade edition.
If users must be able to change data in the tables while you are changing the table structure, you also use forward crossedition triggers. If you make the upgraded application available to some users while others continue to use the older version of the application, you also use reverse crossedition triggers. Crossedition triggers are not a permanent part of the application because you drop or disable them after you have made the upgraded application available to all users.
Consider using Oracle Streams for fast rolling upgrades. However, while Oracle Streams upgrades can achieve little or no database down time, your ability to configure this solution will require some operational investment. See Section 3.6, "Oracle Streams" and Oracle Streams Concepts and Administration for more information.
Data definition language (DDL) commands require exclusive locks on internal structures. If DDL commands are issued, then these locks may not be available causing the statement to immediately fail even though the DDL could have possibly succeeded subseconds later. Specifying DDL with the WAIT
option (the new default) resolves this issue. You specify the wait time instance-wide (in the initialization parameter file) and modify the wait time on a session level.
Specifying DDL commands with the WAIT
option provides more flexibility to define grace periods for such commands to succeed instead of raising an error right away, thus requiring additional application logic to handle such errors.
See Also:
Oracle Database Administrator's GuideThe states (ENABLE
and DISABLE
) and ordering (FOLLOWS
) are triggers to control the firing of triggers. These additional states allow greater administrative control for triggers. You can use the CREATE TRIGGER
statement in a disabled state to validate successful compilation before enabling. In addition, the trigger order can be controlled with the FOLLOWS
clause.
Default values of columns are maintained in the data dictionary for columns specified as NOT NULL
.
Adding new columns with DEFAULT
values and NOT NULL
constraint no longer requires the default value to be stored in all existing records. This enhancement not only enables a schema modification in subseconds and works independently of the existing data volume, but it also consumes no space.
See Also:
Oracle Database Administrator's GuidePrior to Oracle Database 11g, metadata would record mutual dependencies between objects with the granularity of the whole object. For example, PL/SQL unit P depends on PL/SQL unit Q, or view V depends on table T. In cases such as these, the dependent objects were sometimes invalidated when there was no logical requirement to do so. For example, if view V depends only on columns C1, C2, and C3 in table T and a new column, C99, is added, the validity of view V is not logically affected. Nevertheless, in earlier releases, V was invalidated by the addition of column C99.
Beginning with Oracle Database 11g release 1 (11.1), dependency metadata is recorded at a finer level of granularity so that the addition of C99 does not invalidate view V. Similarly, if procedure P depends only on elements E1 and E2 in package PKG, then if element E99 is added to PKG, procedure P is not invalidated. (In Oracle Database 10g, this change to PKG would invalidate procedure P.)
By reducing the consequential invalidation of dependent objects in response to changes in the objects they depend upon, application availability is increased. The benefit occurs both in the development environment and when a live application is parsed or upgraded. The benefit occurs when an Oracle Database patch set is applied because changes to schema objects must be compatible and, therefore does not cause consequential invalidations.
An invisible index provides an alternative to making an index unusable or even to dropping the index. An invisible index is maintained for any DML operation but is not used by the optimizer unless you explicitly specify the index with a hint.
Applications often have to be modified without being able to bring the complete application offline. Invisible indexes enable you to use temporary index structures for certain operations or modules of an application without affecting the overall application. Furthermore, you can use invisible indexes to test the removal of an index without dropping it right away, thus enabling a grace period for testing in production environments.
See Also:
Oracle Database Administrator's GuideOracle Database includes session-level control for materialized view logs. You can disable the capture of changes for materialized views (materialized view logs) for an individual session while logging continues for changes made by other sessions. This feature reduces application patching downtime.
See Also:
Oracle Database Data Warehousing GuideThis feature minimizes the need to recompile dependent PL/SQL packages after an online table redefinition. If the redefinition does not logically affect the PL/SQL packages, recompilation is not needed. This optimization is turned on by default.
This feature reduces the time and effort to manually recompile dependent PL/SQL after an online table redefinition. This also includes views, synonyms, and other table dependent objects (with the exception of triggers) that are not logically affected by the redefinition.
See Also:
Oracle Database Administrator's Guide for information about redefining tables onlineFootnote Legend
Footnote 1: DBUA incurs downtime. The amount of downtime is dependent on a number of factors. See Oracle Database High Availability Best Practices for additional considerations when choosing DBUA as an upgrade option. See Oracle Database Upgrade Guide for instructions on using DBUA to upgrade Oracle Database software.http://metalink.oracle.com/
.http://www.oracle.com/technology/products/bi/db/exadata/index.html
.