upgrade_database
Upgrades a database.
Format
emcli upgrade_database -dbTargetName="target_to_be_upgraded" -dbTargetType="oracle_database|rac_database" -newOracleHome="directory_full_path" -hostCreds="named_credentials" -sysdbaCreds="named_credentials" [-precheck="YES|NO|ONLY" [-ignoreWarnings] [-diagnosticDest="diagnostic_destination"] [-disableArchiveLogMode] [-recompileInvalidObjects] [[-restoreSettingsOnly] | [-backupLocation="backup_location_full_path"]] [-listeners=<name:port[:NEW]> [-scriptsFromSoftwareLibrary "scripts_from_software_library"] [-beforeUpgradeCustomScript="custom_SQL_file_name"] -continueOnScriptError [-afterUpgradeCustomScript="Custom_SQL_file_name_upgrade"] [-noBlackout] [ ] indicates that the parameter is optional
Options
-
dbTargetName
Enterprise Manager target name of the database to be upgraded. Versions 10.2.0.4 and above are supported for upgrade.
-
dbTargetType
Target type of the database — oracle_database for a single instance database, or rac_database for a cluster database.
-
newOracleHome
New Oracle Home directory full path. Upgrade to 11g Release 2 and later is supported. Does not support a database downgrade.
-
hostCreds
Named host credentials of the user who owns the Oracle Home installation. Should have necessary privileges on the database files to be upgraded.
-
sysdbaCreds
Named database credentials having SYSDBA privileges on the database to be upgraded.
-
precheck
Option to run prerequisite checks during the upgrade job. Valid values are:
YES — Run prerequisite checks and proceed to the database upgrade if there are no errors during prerequisite checks.
NO — Proceed to the database upgrade directly. Do not run prerequisite checks.
ONLY — Run prerequisite checks only. Do not upgrade the database.
-
ignoreWarnings
Ignores any warnings during prerequisite checking and proceeds with the upgrade. Used only when pre-check is set to YES, otherwise ignored. Does not ignore errors.
-
diagnosticDest
Full directory path for Oracle trace and diagnostic files for the upgraded database. By default, ORACLE_BASE is used as the location.
-
disableArchiveLogMode
Disable archive logging during the database upgrade.
-
recompileInvalidObjects
The upgrade process may invalidate the objects in the database. You can choose to recompile invalid objects at the end of the upgrade. This increases the upgrade time, but minimizes subsequent latencies caused by on-demand automatic recompilation at run time.
-
restoreSettingsOnly
Reverts only the configuration changes made during the upgrade if upgrade fails. You can restore the database outside the upgrade using your custom restore strategy. Choose this option if you already have a custom backup and restore strategy for this database. In case of an upgrade failure, this setting will be used.
-
backupLocation
Full directory path to back up the database. Performs a full backup of the database. A script will be created to restore the database. All files are placed in the specified backup location. Reverts all the changes made during the upgrade if the upgrade fails.
-
listeners
Comma-separated list of the listener name and port (name1:port1,name2:port2) to register the upgraded database. Specify at least one listener in the case of a single-instance database target. These listeners should be configured in the new Oracle home or TNS_ADMIN location. Additionally, you can choose to create a new listener in the new Oracle home by specifying :NEW (name1:port1:NEW).
-
scriptsFromSoftwareLibrary
Specify the custom scripts from the software library components. The parameters 'beforeUpgradeCustomScript' and 'afterUpgradeCustomScript' are interpreted as entity URNs of the components that contain the scripts.
-
beforeUpgradeCustomScript
Full file path of the custom SQL script to be run before the database upgrade.
-
continueOnScripteError
Ignores a non-zero exit code when executing a custom SQL script and continues the upgrade job.
-
afterUpgradeCustomScript
Full file path of the custom SQL script to be run after the successful database upgrade.
-
noBlackout
Suppresses a blackout of the database target. A blackout suspends monitoring of the database target from Enterprise Manager, which is the default behavior during a database upgrade.
Examples
emcli upgrade_database -dbTargetName=test1 -dbTargetType=oracle_database -newOracleHome=/u01/app/oracle/product/11.2.0/dbhome_2 -hostCreds=HOST_CREDS -sysdbaCreds=SYSDBA_CREDS -precheck=YES -ignoreWarnings -disableArchiveLogMode -beforeUpgradeCustomScript=/home/user1/sqlfiles/script1.sql -continueOnScriptError -afterUpgradeCustomScript=/home/user1/sqlfiles/script2.sql -diagnosticDest=/u01/app/oracle -recompileInvalidObjects -noBlackout