|Oracle® Database 2 Day DBA
12c Release 1 (12.1)
|PDF · Mobi · ePub|
This chapter describes how to keep your Oracle Database software up-to-date. It contains the following sections:
Software management involves keeping your Oracle Database software up-to-date with the latest product fixes. When a product defect, or a bug, is discovered, a patch is created to fix the problem. A patch corrects a single defect in the installed software. Individual patches, also referred to as interim patches, are made available to customers who for business reasons cannot wait until the next patch set to receive the product fix.
Oracle periodically issues maintenance releases for its software, in the form of patch sets. A patch set is a collection of product fixes that have been released up to the time of the maintenance release. Patch sets are fully tested and integrated product fixes. All the product fixes in the patch set have been tested and are certified to work with each other.
Every patch or patch set is associated with a bug number for identification purposes. Patch sets are also associated with version numbers. For example, if you use Oracle Database 11g Release 1 (184.108.40.206), then an available patch set might be 220.127.116.11. The version number of the patched software does not change if an interim patch is applied.
Every patch has an associated README file that describes how it fixes the software. The README file also has instructions for applying the patch.
Every patch set is accompanied by a Patch Set Notes file that contains installation instructions and information about the product fixes contained within the patch set. When you apply a patch set to your Oracle software, you change the maintenance release number for your installed software. Applying a patch set affects the software residing in your Oracle home only, with no change to the data in the database.
You can use Oracle OPatch and Oracle Universal Installer (OUI) to apply patches and patch sets respectively. Alternatively, you can automate the application of these patches using Oracle Enterprise Manager Cloud Control. Use of these products is beyond the scope of this documentation.
Use Database Upgrade Assistant (DBUA) to upgrade an existing database to the current release of Oracle Database.
This section contains these topics:
Database Upgrade Assistant (DBUA) guides you through the upgrade process and configures your database for the new release. DBUA automates the upgrade process and makes appropriate recommendations for configuration options such as tablespaces and online redo log files.
DBUA can be used to upgrade databases created using any edition of the Oracle Database software, including Express Edition (XE) databases.
DBUA does not begin the upgrade until it completes all of the following pre-upgrade steps:
Checks for any invalid user accounts or roles
Checks for any invalid data types or invalid objects
Checks for any desupported character sets
Checks for adequate resources, including rollback segments, tablespaces, and free disk space
Checks for any missing SQL scripts needed for the upgrade
Disables Database Vault, if Database Vault is enabled
When upgrading Oracle Database to Oracle Database 12c, if you have enabled Database Vault in your current (pre-Oracle Database 12c) Oracle home, then by default Database Vault is disabled in the new target Oracle home. Once the upgrade is complete, enable Database Vault again.
See Also:Oracle Database Upgrade Guide for more information about upgrading databases that use Database Vault
After completing the pre-upgrade steps, DBUA automatically performs the following tasks:
Modifies or creates new required tablespaces
Invokes the appropriate upgrade scripts
While the upgrade is running, DBUA shows the upgrade progress for each component. DBUA writes detailed trace and log files and produces a complete HTML report for later reference. To enhance security, DBUA automatically locks new user accounts in the upgraded database. DBUA then proceeds to create new configuration files (initialization parameter and listener files) in the new Oracle home.
DBUA is fully compliant with Oracle Real Application Clusters (Oracle RAC) environments. In Oracle RAC environments, DBUA upgrades all database and configuration files on all nodes in the cluster.
Oracle ASM Configuration Assistant (ASMCA) enables you to upgrade an existing Oracle ASM instance to the current software level. However, the recommended practice is to upgrade an Oracle ASM instance with Oracle Universal Installer (OUI). OUI automatically defaults to upgrade mode when it detects an Oracle ASM instance at a previous release level.
Oracle Automatic Storage Management Administrator's Guide for information about upgrading Oracle ASM
DBUA supports a silent mode of operation in which no user interface is presented to the user. Silent mode enables you to use a single statement for the upgrade.
If the release number of your current Oracle Database appears in the following list, you can use DBUA to perform a direct upgrade of your database to Oracle Database 12c Release 1 (12.1):
18.104.22.168 or later
10.2.0.4 or earlier
If your current Oracle Database is a release earlier than 10.2.0.4, or is release 22.214.171.124, then directly upgrading your current release of Oracle Database to the latest release is not supported. In this case, you must upgrade to an intermediate release before upgrading to the new Oracle Database 12c release.
See Also:Oracle Database Upgrade Guide for information on upgrading your Oracle Database if a direct upgrade to the new Oracle Database 12c release is not supported
If you install the Oracle Database software only and specify that you are upgrading an existing database to the new Oracle Database release, then DBUA is launched automatically after the software installation. You can then continue as described in "Upgrading a Database Using DBUA."
If you perform a software-only installation and do not upgrade your database at that time, then you can do so later by launching DBUA.
Be aware of the following before you begin using DBUA:
When upgrading a single-instance Oracle database, you must run Oracle Net Configuration Assistant (NETCA) before running DBUA. When upgrading an Oracle RAC database, as part of the Oracle Clusterware upgrade, Oracle Universal Installer (OUI) automatically runs NETCA to upgrade the network listener. Therefore, do not separately run NETCA.
See Also:Oracle Database Upgrade Guide for more information about running Net Configuration Assistant prior to running DBUA
It is not possible to upgrade a database with DBUA when the source and target Oracle homes are owned by different users.
If you stop the upgrade, but do not restore the database, then you should not restart DBUA until you start the database instance in
UPGRADE mode using the Oracle Database 12c software. You cannot go back to the original software version unless you restore your database.
If you restore your database manually (not using DBUA), then remove the following file from the Oracle Database 12c home directory before starting DBUA:
The presence of this file indicates to DBUA that this operation is a reattempt of a previous operation.
Configure the operating system environment variables, as described in "Configuring the Operating System Environment Variables."
Click Start, then select Programs (or All Programs)
Select Oracle - HOME_NAME
Select Configuration and Migration Tools
Select Database Upgrade Assistant
The DBUA Select Operation page appears.
Open a command window.
Configure the operating system environment variables, as described in "Configuring the Operating System Environment Variables."
Enter the following command:
The Database Upgrade Assistant: Select Operation page appears.
dbuaexecutable is typically found in your
Oracle Database Upgrade Guide for more information about Database Upgrade Assistant
Complete the following steps to upgrade a database using DBUA. If you need help at any page or want to consult more documentation about DBUA, then click the Help button to access the online Help.
Start DBUA. See "Starting DBUA."
At the Select Operation page of DBUA, choose Upgrade Oracle Database. Then, click Next.
The Select Database page appears.
At the Select Database page, the Target Oracle Home field shows the location of the new Oracle home for the Oracle Database 12c software installation.
In the Select Database area, from the Source Oracle Home list, choose the database you want to upgrade to Oracle Database 12c. DBUA fills in the information for the release and selects the Oracle database associated with the selected Oracle home.
You can select only one database at a time. If you do not see the database that you want, then make sure an entry with the database name exists in the
oratab file in the
If you run DBUA from a user account that does not have
SYSDBA privileges, then enter the user name and password credentials to enable
SYSDBA privileges for the selected database.
DBUA displays a message saying it is getting database information. DBUA analyzes the selected database, performing pre-upgrade checks and displaying warnings as necessary. Examples of DBUA database checks include:
Empty database recycle bin
Deprecated or desupported initialization parameters
Time zone data file version
When DBUA finishes its checks, the Prerequisite Checks page appears. The analysis takes several minutes to complete.
The Prerequisite Checks page shows the validation and results, the severity, whether the result is fixable if there is a problem, and the action you can take. When you select the validation result, the Fixable column displays whether the result can be fixed or not. The Action drop-down list shows actions you can take. For example, select Fix for DBUA to run a script or command to fix the problem.
When you select a result in the Validation column, DBUA displays information about the result in the bottom area of the screen.
Click the more details link in the text information area. The Validation Details box appears with more information.
If there are validation errors or warnings and these are fixable, you can select an Action to take.
The Upgrade Options Configuration page appears with the Upgrade Options tab selected.
The Upgrade Options Configuration page with the Upgrade Options tab selected provides the following options:
The Upgrade Parallelism section enables the degree of parallelism for the upgrade process. This option reduces the time needed to perform the upgrade, based on the number of CPUs available to handle the running of scripts and processes simultaneously.
By default, DBUA sets Upgrade Parallelism to the number of CPUs or 2 if the number of CPUs is less than 4. You can adjust this default value by selecting a new value from the Degree of Parallelism drop-down list.
Upgrade Options section
Recompile Invalid Objects During Post-Upgrade
Select Recompile Invalid Objects During Post-Upgrade if you want DBUA to recompile all invalid PL/SQL modules after the upgrade is complete. Specify the parallelism for the recompilation of invalid objects during post upgrade. DBUA provides a recommended degree of Recompilation Parallelism, which it sets to one less than the number of CPUs you have available. Taking advantage of parallism can significantly reduce the upgrade time. If you do not have DBUA recompile invalid objects in its post-upgrade phase, then you must manually recompile invalid objects after the database is upgraded.
Upgrade Timezone Data
Select Upgrade Timezone Data for DBUA to update the time zone data file for this release. If you do not select this option, then you will need to update the time zone configuration file manually after the upgrade.
Gather Statistics Before Upgrade
Select Gather Statistics Before Upgrade to reduce the overall time for the upgrade process.
Change Tablespace Offline/Read Only During Upgrade
Select Set User Tablespace Read Only During Upgrade if you are upgrading a database for which you must transport tablespaces. In this case, the file headers must be made read/write before transporting.
The File Locations area enables you to browse for the location for output that DBUA creates for diagnostics. You can enter a full path into the field, or you can click Browse to navigate to a location.
Optionally, click the Custom Scripts tab to specify custom SQL scripts that you would like to run before and after the upgrade
The Upgrade Options Configuration page appears with the Custom Scripts tab selected.
You can also click Next without using the Custom Scripts option.
The Custom Scripts tab in the Upgrade Options Configuration page allows you to optionally run custom SQL scripts. If you want to run a script before the upgrade, click Browse for the Before Upgrade field to browse to the location of the script you would like to run before the upgrade. If you want to run a script after the upgrade, click Browse for the After Upgrade field to browse to the location of the script you would like to run after the upgrade.
You can specify either one or both, or leave the fields blank to skip this page.
The Management Options page appears.
In the Management Options page, select an option:
Configure Enterprise Manager (EM) Database Express
Register with Enterprise Manager (EM) Cloud Control
If you select this option, then you must provide information in the following fields:
EM Admin Username
EM Admin Password
If you are upgrading a single-instance database (the assumption for readers of this manual) or Oracle Express Edition (XE), the Move Database Files page appears.
The Move Database Files page is optional. If you want to move database files as part of the upgrade, then select an option:
Move Database Files as Part of Upgrade
Move Fast Recovery Area as Part of Upgrade
Note:The fast recovery area is an Oracle managed disk location used for storing backup and recovery related files. Oracle strongly recommends configuring a fast recovery area, because it significantly enhances speed, reliability, and manageability of the database recovery process. The location of the fast recovery area is also used by Oracle Enterprise Manager if you enable local management on the Management Options screen.
If you choose Move Database Files as Part of Upgrade, then you must also configure Storage Type for the database files.
In the Storage Type list, select File System or Oracle ASM.
If you select File System, your database files are moved to the host file system.
If you select Oracle Automatic Storage Management (Oracle ASM), your database files are moved to Oracle ASM storage, which must currently exist on your system. If you do not have an Oracle ASM instance, then you can create one using Automatic Storage Management Configuration Assistant (ASMCA) from the Oracle Grid Infrastructure home and then restart DBUA.
Oracle Database Upgrade Guide for more information about moving database files
Oracle Grid Infrastructure Installation Guide for information about installing and configuring Oracle ASM
Oracle Automatic Storage Management Administrator's Guide for information about managing Oracle ASM instances with ASMCA
If you choose Move Fast Recovery Area as Part of Upgrade, then you must also configure the storage type and location for the fast recovery area and specify the size to be allocated as described in this step.
The Move Database Files and Move Fast Recovery Area options are independent of each other. For example, you can choose to move database files to Oracle ASM and leave the fast recovery area on the file system.
When you choose to move the fast recovery area, DBUA does not physically move existing archived redo logs to a new location. Instead, DBUA sets the
DB_RECOVERY_FILE_DEST_SIZE initialization parameters to the new location and new size when the database is started from the new Oracle home.
If an Oracle Express Edition database is being upgraded to Oracle Enterprise Edition, then you must configure a fast recovery area. If a fast recovery area is currently configured, then the current settings are retained but the screen displays to enable you to override these values.
Fast Recovery Area Storage Type
In the Storage Type list, select File System or ASM.
If you select File System, your fast recovery area will be on the host file system.
If you select Oracle Automatic Storage Management (Oracle ASM), your fast recovery area will be on Oracle ASM storage, which must currently exist on your system. If you do not have an Oracle ASM instance, then you can create one using Automatic Storage Management Configuration Assistant (ASMCA) from the Oracle Grid Infrastructure home and then restart DBUA.
Fast Recovery Area Location
Browse to the location on the host file system, or on Oracle ASM storage.
Fast Recovery Area Size
Specify the size to allocate for the fast recovery area. The default is 1024 MB.
Click Next. The Network Configuration page appears.
The Listener Selection area of the Network Configuration screen shows a table with: Name, Port, Oracle Home, Status, and Migrate columns. To the left of the listener name is a box for selecting the listener.
Select one or more listeners from the source Oracle home to be migrated to the new upgraded Oracle home.
DBUA adds the selected listener to the
listener.ora. of the target Oracle home and starts it.
DBUA removes the entry of the upgraded database from the old (source)
DBUA reloads the
listener.ora file in both the source and target Oracle Database environments.
Note:If there are other databases registered with the same listener, then their new client connection requests may be affected during listener migration.
You can also select existing listeners in the new Oracle home or choose to create a new listener.
DBUA displays the Recovery Options screen. DBUA performs the listener migration during the pre-upgrade steps.
In the Recovery Options Configuration page, select the recovery method to use in case the upgrade process encounters a problem.
The following recovery options and configurations are available:
Use RMAN Backup
If you select Create RMAN Backup before Upgrade, then enter the full path for a location for the backup in the Backup Location field.
If you select Use RMAN Backup but do not choose to create an RMAN backup before upgrading, then DBUA displays the time stamp for the latest RMAN backup that exists. You can click Restore Script next to the time stamp to select an existing script to run for restoring this backup.
Use Flashback and Guaranteed Restore Point
Select Create a Guaranteed Restore Point before Upgrade to have DBUA create a restore point before DBUA enters the upgrade process.
If you previously enabled Flashback Database and configured a fast recovery area with a flashback retention target, then you can select Use Existing Guaranteed Restore Point and pick the named SCN from the drop-down list. Your current settings for the restore point are retained. DBUA displays a page to permit you to override these values if needed.
I have my own backup and restore strategy
Click this option only if you used your own backup procedure to back up the database. In this case, Restore restores only the original database settings. To restore the database itself, you must restore the backup you created with your own backup utilities.
Note:The database you are upgrading must be release 126.96.36.199 or later in order to take advantage of Flashback and Guaranteed Restore Point, and this must be enabled in the source database.
See Also:Oracle Database Backup and Recovery User's Guide for more information on using Flashback Database and guaranteed restore points
The Database Upgrade Summary page appears.
The Database Upgrade Summary page shows the following information about the upgrade before it starts:
Name, version, and Oracle home of the source and target databases
Database backup location, available space, and space required
Database components to be upgraded
Initialization parameters changes
Database files location
See Also:Oracle Database Upgrade Guide for information about setting the
COMPATIBLEinitialization parameter after the upgrade
Check all of the specifications. Then click Back or Finish as follows:
Click Back if anything is incorrect until you reach the page where you can correct it.
Click Finish if everything is correct.
The Progress page appears and DBUA begins the upgrade.
In the Progress page, you can click Activity Log to view the activity log, Alert Log to view the alert log, or Stop to stop the upgrade.
After the upgrade has completed, the Upgrade Results page appears.
The Upgrade Results page displays a description of the original database and the upgraded database and shows the changes made to the initialization parameters. The page also shows the directory where various log files are stored after the upgrade.
Optionally, you can examine the log files to obtain more details about the upgrade process. The DBUA log files are located under the
Note:An HTML version of the Upgrade Results is also saved in the log files directory. You can click the links in this HTML page to view the log pages.
If you are satisfied with the upgrade results, then click Exit to quit DBUA and use your newly upgraded database.
See Also:Oracle Database Upgrade Guide for information about additional tasks that should be completed after upgrading your database
If you want to remove an Oracle software installation, you can use the deinstallation tool to completely uninstall the software from your computer.
Starting with Oracle Database 12c, the deinstallation tool is integrated with the database installation media. You can run the deinstallation tool using the
runInstaller command with the
-home options from the base directory of the Oracle Database, Oracle Database Client or Oracle Grid Infrastructure installation media.
The default method for running the deinstallation tool is from the
deinstall directory in the Oracle home as the installation owner:
Execute the deinstallation tool using these commands:
$ cd $ORACLE_HOME $ $ORACLE_HOME/deinstall/deinstall
Note:Do not shut down the Oracle database or stop any database processes prior to running the deinstallation tool.
Enter the specified information at the prompts, or just press Enter to accept the default values.
When prompted, follow the directions to run the root script. You must be the
root user to do so.
Oracle Database Installation Guide for your platform for more information about the deinstallation tool
Oracle By Example (OBE) has a series on the Oracle Database 2 Day DBA guide. This OBE steps you through the tasks in this chapter, and includes annotated screenshots.
To view the Managing Oracle Database Software OBE, enter the following URL in your web browser: