Sunday, July 7, 2013

Upgrade of Database, Real Application Testing, SQL Performance Analyzer




Upgrading with the DBUA- The DBUA is essentially unchanged from the Oracle Database 10g release. There are a couple of important changes which you’ll see when we go through a manual upgrade process. You’ll have an additional screen during the upgrade process, which asks you to specify a location for the diagnostic directory. The DBA automatically starts when you choose to upgrade your database during the installation of the Oracle Database 11gserver software. Note that when you use the manual upgrade method, you must upgrade an ASM instance separately, Where as the DBUA lets you perform the ASM upgrade along with the upgrade of the database instance.

Scripts to Run for Upgrading a Database- Upgrade an Oracle Database 10grelease database to the Oracle Database 11grelease using the Oracle-supplied scripts for upgrading a database. The following are the steps you use in upgrading a database to the Oracle Database 11g release:

# utlu111i.sql - The Pre-Upgrade Information tool
# catupgd.sql - The script that performs the actual upgrade process
# utlu111s.sql - The Post-Upgrade Status tool
# catuppst.sql - The post-upgrade actions script
# utlrp.sql - The script you run at the end of the upgrade process, to recompile all objects that were invalidated during the upgrade.

Real Application Testing
The Real Application testing feature, which consists of two separate tools, Database Replay and the SQL Performance Analyzer, is arguably the most significant new feature in the Oracle Database 11.1 release. The two new features address significant unmet needs regarding change management. Organizations often find that upgrading operating system or database server software or making major application changes is fraught with considerable risk. There simply is no way to predict how a production system is going to perform pursuant to major changes. Real Application Testing addresses this need by letting you quickly and exhaustively test changes using Oracle’s own tools instead of your having to resort to third-party tools that may not be able to capture all the required changes.

The new Oracle-supplied packages DBMS_WORKLOAD_CAPTURE and DBMS_WORKLOAD_REPLAY provide the APIs for the Database Replay feature. The DBMS_SQLPA package supports the SQL performance Analyzer feature. The following sections first look at the Database Replay feature and then the SQL Performance Analyzer.

Database Replay - System changes such as a database upgrade require substantial testing and validation before you can actually migrate the changes to a production system. The trick is to simulate a real production workload on a test system. The Database Replay feature enables you to perform real-life testing of major changes by letting you capture the actual database workload on the production system and replay it on a test system. Thus, you essentially re-create the production workload effortlessly on a test system. Database Replay performs a sophisticated replay of the production workload by adhering to the original concurrency and timing characteristics. Once you complete the testing, you can analyze and review the reports produced by Database Replay to see if there was a performance divergence between the two runs and also if there were any errors. Finally, you can choose to implement the recommendations made by Database Replay to fix any problems it encountered during the replay of the production workload.

You can employ Database Replay to test significant system changes such as the
following:
#Operating system and database upgrades and migrations.
# Configuration changes such as moving to an oracle RAC environment.
# Storage changes.

Database Replay doesn’t capture the following types of client requests:
# SQL*Loader direct path load of data
# Oracle Streams
# Data Pump Import and Export
# Advanced replication streams
# Non–PL/SQL-based Advanced Queuing (AQ)
# Flashback Database and Flashback queries
# Distributed transactions and remote describe/commit operations
# Shared server
# Non–SQL-based object access

The following data dictionary views help you manage the Database Replay feature:
# DBA_WORKLOAD_CAPTURES - It shows all workload captures you performed in a database.
# DBA_WORKLOAD_FILTERS – It shows all workload filters you defined in a database.
# DBA_WORKLOAD_REPLAYS – It shows all workload replays you performed in a database.
# DBA_WORKLOAD_REPLAY_DIVERGENCE – It helps monitor workload divergence.
# DBA_WORKLOAD_THREAD – It helps monitor the status of external replay clients.
# DBA_WORKLOAD_CONNECTION_MAP – It shows all connection strings used by workload replays.

SQL Performance Analyzer
SQL Performance Analyzer, which, along with the Database Replay constitutes the Total Replay
feature, lets you test the impact of potential changes such as a server or database upgrade on SQL workload response time. The SQL Performance Analyzer focuses on comparing the performance of a specific SQL workload before and after a major system change. The analyzer does this by building two versions of the SQL workload performance, which includes both the SQL execution plans as well as their execution statistics. After analyzing SQL performance both before and after you make a major
change, the SQL Performance Analyzer provides suggestions to prevent potential performance degradation of SQL statements. This is especially handy when you’re planning an upgrade of your database to a newer release of the Oracle database. The SQL Performance Analyzer, by enabling you to compare SQL performance on two systems running on different versions of the Oracle database, lets you know ahead of the upgrade which of the SQL statements may show a deterioration in performance. Thus, you can reengineer those statements prior to the actual upgrade.

You can use the SQL Performance Analyzer to predict performance changes resulting from the following system changes:
# Database and application upgrades
# Hardware upgrades
# Operating system upgrades
# Initialization parameter changes
# SQL tuning actions such as the creation of SQL profiles
# Statistics gathering
# Schema changes

DBCA New Features, Cheanges is Default Parameter Values, Upgrade of Database



New DBCA Options
Oracle Database 11gcontains quite a few changes in configuring databases through the DBCA. These include the configuration of the new automatic memory management feature, secure database configuration by default, and others. They are

Automatic Memory Management- The DBCA doesn’t specify values for the memory-related initialization parameters sga_targetand pga_aggregate_target by default. Instead, it uses the memory_target parameter, which allows you to configure the new automatic memory management feature. You select automatic memory management in the Memory Management page, as you’ll see
later in the DBCA database creation example.
Automatic Secure Configuration- The DBCA will configure a secure database by default in Oracle Database 11g. If you want, you can even configure this later on, but Oracle recommends that you opt for automatic secure configuration when you create the database.
Automatic switching to Grid Control- In previous releases, it took quite a bit of work to reconfigure a database from Database Control to Grid Control. In Oracle Database 11g, you can use the Enterprise Manager plug-in provided by the DBCA to automate the switching of a database from Database Control to Grid Control.
Configuration of Oracle Base and Diagnostic Destination- DBCA now uses the values for the Oracle base directory, stored in the Oracle home inventory, to derive the default locations for datafiles and the diagnostic_dest initialization parameter, which is the ADR base directory.

Some Parameter Default Values
#FAILED_LOGIN_ATTEMPTS - Specifies the maximum number of times a user can try to log in. The default value for this parameter is 10, which is the same as in the previous release.
# PASSWORD_GRACE_TIME - Specifies the number of days within which users must change their password before it expires. The default value for this setting is 7 days, whereas it was unlimited before.
# PASSWORD_LIFE_TIME- Sets the duration for which users can use the same password. This is set to 180 days by default, whereas it was unlimited before.
# PASSWORD_LOCK_TIME - Sets the number of days for which an account will remain locked after a set number of failed attempts to log in. The default value is 1, compared to unlimited in the previous release.
# PASSWORD_REUSE_MAX - Sets the number of days that must pass before you can reuse a password after it expires. The default value is set to unlimited, the same value as before.
# PASSWORD_REUSE_TIME - Sets the number of new passwords you must use before you are permitted to reuse the current password. By default, there is no limit on the number of times you can reuse a password.
# PASSWORD_GRACE_TIME – It is now 7 days by default, instead of being unlimited.
# PASSWORD_LIFE_TIME - It is set by default to 180 days, instead of being unlimited.
# PASSWORD_LOCK_TIME – It is 1 day, instead of being set to the value of DEFAULT as in the Oracle Database 10grelease.

Oracle 11g  Upgrade Path
Depending on your current database release, you may or may not be able to directly upgrade to the Oracle Database 11gRelease 1 (11.1) version. You can directly upgrade to Oracle Database Release 1 if your current database is based on an Oracle 9.2.0.4 or newer release. For Oracle database releases older than Oracle 9.2.0.4, you have to migrate via one or two intermediate releases, as shown by the following upgrade paths:

#7.3.3 (or lower) => 7.3.4 => 9.2.0.8 => 11.1
# 8.0.5 (or lower) => 8.0.6 => 9.2.0.8 => 11.1
# 8.1.7 (or lower) => 8.1.7.4 => 9.2.0.8 => 11.1
# 9.0.1.3 (or lower) => 9.0.1.4 => 9.2.0.8 => 11.1
# 9.2.0.3 (or lower) => 9.2.0.8 => 11.1