Sunday, February 17, 2013

Transaction Backout - Oracle Flashback Technology

Oracle introduced Flashback Technology many years back (9i), and with version 11g TRANSACTION_BACKOUT capability was introduced.
This is a very powerful feature, which allows a developer or DBA to BACKOUT specific committed transactions. This feature leverages UNDO and supplemental log data to identify the DML changes involved in a specific transaction and the other dependent transactions to BACKOUT the transaction.
Please Note: This feature will allow you to violate Database consistency and Atomicity of Transactions. So use it with care!!!
However, in development and testing environment, I find this feature useful for performing repeated end-to-end testing for applications involving of complex applications.
Specifically in testing of transactions involving
Complex setup of test data.
Test data setup with workflow/different users/roles involvement.
Transaction testing involving external system interfaces, large batch processes or time sensitive transactions.
Transaction changes the state of data in such a way that process to reverse the state is complex.
In these situations, the effort for setting up the test data is significantly more than test step itself. We can use TRANSACTION_BACKOUT feature to revert back the transaction and repeat the test many times.

Let us explore the details of FLASHBACK transactions, specifically the BACKOUT feature.
What is Flashback Transaction BACKOUT?
Flashback Transaction Back-Out is a logical recovery option to roll back a target transaction and its dependent transactions while the database remains online. A dependent transaction is related by either a write-after-write (WAW) relationship, in which a transaction modifies the same data that was changed by the target transaction, or a primary key constraint relationship, in which a transaction re-inserts the same primary key value that was deleted by the target transaction. Flashback Transaction utilizes undo and the redo generated for undo blocks, to create and execute a compensating transaction for reverting the affected data back to its original state.
For Flashback Transactions to work, Oracle has to capture sufficient information in UNDO and supplemental logs.
For Oracle Flashback Transaction to work following are the requirements.
Database must be in ARCHIVELOG mode. (How to switch to ARCHIVELOG mode)
Supplemental Log (with primary key) must be turned on. (How to turn on Supplemental Logging)
User must have following privilege.

EXECUTE privilege on DBMS_FLASHBACK package
GRANT EXECUTE on DBMS_FLASHBACK to userid;
SELECT ANY TRANSACTION privilege.
GRANT SELECT ANY TRANSACTION to userid;
Please note this is a very powerful privilege and should be granted only after care evaluation of security/audit requirements.
In addition the user must have CRUD privilege on the tables that FBT BACKOUT is working on!!!
WAW Dependency
A transaction can have a write-after-write (WAW) dependency, meaning that a transaction updates or deletes row data, that has been inserted or updated by a previous transaction. In these situations, Oracle FBT BACKOUT feature provides options to back out all dependent transactions (keeping DB transaction-ally consistent) or allow you to break the transaction consistency.
The FBT BACKOUT can be used using command line or OEM. The rest of this posting will walk through an example of FBT BACKOUT using command line interface. The OEM interface is lot more intuitive but may be cumbersome when working with complex and large transactions.
Setup
The setup requirements and sample of FBT BACKOUT is well described at Oracle Tutorials. I’ll walk through an example in the context of repeatable testing.
User HR schema (user).
The transaction (referred as T1 includes 6 DMLs.
Also included is a transaction T2 (2 DMLs) that is not related to T1 but is dependent on T1.
Our goal is to repeatedly test the T1 after reverting T1 after each test.
In our test script, we’ll perform following steps.
Create the initially populate the table
Perform two transactions on the table.
Verify the data changes.
Identify the transactions (using XID) that’ll be
BACKOUT the transactions.
Verify that data changes are backed out and original values are restored.
Reapply the transaction by running the same script.
Verify the data changes.
Table’s definition and script to populate them are as follows.
drop table ta;

CREATE table TA (ca int primary key, va varchar2(20));


-- Inserted 10 rows for set up.
insert into ta select level ca, 'AAAA - ' || to_char(to_date(level,'jsp')) from dual connect by level < 5;
commit;
Now with this setup completed, we can run the transactions and explore TRANSACTION BACKOUT feature.
Note:
Both update and delete in T1 are dependent on the insert of T1. Of course this is not transaction dependency.
Note transaction T2 (a different transaction from T1) inserts additional rows and however updates some rows created by transaction T1. Thus T2 transaction is dependent on T1: WAW dependency. In order to BACKOUT transaction T1 without compromising data integrity we must revert transaction T2.

Following script shows the transactions.
SQL> --drop table ta purge;
SQL> --CREATE table TA (ca int primary key, va varchar2(20));
SQL> delete from ta
9 rows deleted.
SQL> commit
Commit complete.
SQL> insert into ta select level ca, 'AAAA - ' || to_char(to_date(level,'jsp')) from dual connect by level &lt; 5
4 rows created.
SQL> commit
Commit complete.
SQL> prompt After initial setup...
After initial setup...
SQL> select ora_rowscn, ta.* from ta

ORA_ROWSCN         CA VA                 
---------- ---------- --------------------
  31925488          1 AAAA - 01-JAN-12   
  31925488          2 AAAA - 02-JAN-12   
  31925488          3 AAAA - 03-JAN-12   
  31925488          4 AAAA - 04-JAN-12   

4 rows selected.
SQL> insert into ta values( 10 , 'BBBB - Ins by T1')
1 row created.
SQL> insert into ta values( 11 , 'BBBB - Ins by T1')
1 row created.
SQL> insert into ta values( 12 , 'BBBB - Ins by T1')
1 row created.
SQL> insert into ta values( 13 , 'BBBB - Ins by T1')
1 row created.
SQL> update ta set va= 'UUUU - Upd by T1' where ca in (1,11)
2 rows updated.
SQL> delete from ta where ca in (2)
1 row deleted.
SQL> commit
Commit complete.
SQL> prompt After Transaction T1...
After Transaction T1...
SQL> select ora_rowscn, ta.* from ta

ORA_ROWSCN         CA VA                 
---------- ---------- --------------------
  31925493          1 UUUU - Upd by T1   
  31925493          3 AAAA - 03-JAN-12   
  31925493          4 AAAA - 04-JAN-12   
  31925493         10 BBBB - Ins by T1   
  31925493         11 UUUU - Upd by T1   
  31925493         12 BBBB - Ins by T1    
  31925493         13 BBBB - Ins by T1   

7 rows selected.
SQL> insert into ta values( 21, 'BBBB - Ins by T2' )
1 row created.
SQL> insert into ta values( 22, 'BBBB - Ins by T2' )
1 row created.
SQL> update ta set va= 'UUUU - Upd by T2' where ca in (3, 10)
2 rows updated.
SQL> commit
Commit complete.
SQL> prompt After Transaction T2...
After Transaction T2...
SQL> select ora_rowscn, ta.* from ta

ORA_ROWSCN         CA VA                 
---------- ---------- --------------------
  31925495          1 UUUU - Upd by T1   
  31925495          3 UUUU - Upd by T2   
  31925495          4 AAAA - 04-JAN-12   
  31925495         10 UUUU - Upd by T2   
  31925495         11 UUUU - Upd by T1   
  31925495         12 BBBB - Ins by T1   
  31925495         13 BBBB - Ins by T1   
  31925495         21 BBBB - Ins by T2   
  31925495         22 BBBB - Ins by T2   

9 rows selected.

Now that transactions have been run, we can go to OEM, and look and manage transactions. Though transactions can be managed by command line environment (described here), OEM provides a robust interface that eases the tasks considerably.








After the transaction BACKOUT…

ORA_ROWSCN         CA VA                 
---------- ---------- --------------------
  31950709         11 UUUU - Upd by T1   
  31950709          1 UUUU - Upd by T1   
  31950709         12 BBBB - Ins by T1   
  31950709         13 BBBB - Ins by T1   
  31950709         21 BBBB - Ins by T2   
  31950709         22 BBBB - Ins by T2   
  31950709          3 UUUU - Upd by T2   
  31950709          4 AAAA - 04-JAN-12   
  31950709         10 UUUU - Upd by T2   

9 rows selected.

At this point we can re-run the transaction that was BACKED-OUT again.

There are views that describe the status of the transactions that were BACKED-OUT.
This way logical transactions can be rolled-back and reapplied for repeated testing.

select * from dba_flashback_txn_state;

select * from dba_flashback_txn_report;


Exceptions:
When performing TRANSACTION BACKOUT there are several errors/ exceptions one can encounter. Some of the common ones are described below.
Transaction back-out is not supported over DDLs on the object. If a transaction is picked that is before a DDL issued on the DB object OEM will not allow the transactions to be backed-out.



Also if the DB is not in ARCHIVELOG mode this feature will not be available.

Hope this helps.
References:
Following references were used.


Thursday, February 14, 2013

Oracle Cloud : Getting Started

Having worked with Oracle Database, APEX, ADF, and Amazon Cloud (AWS) for some time now, like many others I was waiting for arrival of Oracle Cloud. Finally in 2012, Oracle has started delivering its Cloud Offerings. As a not-so-early-adapters, I started a trial account to explore the Oracle Public Cloud (OPC). My expectation was that Oracle Cloud would be something similar to AWS… Boy I was wrong!
Oracle has included some good introductory video’s (on YouTube) and OBE documentation to get started and get feet wet. They can be found here.

In this series of posts, I’ll describe some of my experiences in Oracle Cloud.

Covered in this post:
1. Basic OPC specific terminology
2. Creating an Oracle Cloud account
3. Accessing the Database Service
4. Explore APEX on OPC

1. Basic OPC Terminology
Account - An account corresponds to an individual, organization, or company that is an Oracle customer. An account has one or more Account Administrators who are responsible for creating and nominating the other administrator types, creating identity domains, and managing the customer account information. If you already have an account on Oracle.com, this is the account that is used. This is in alignment with Oracle single sign-on (SSO) strategy.

Data center - Oracle provides data centers in various geographical regions. An identity domain and the services associated with it must belong to a specific data center. For optimal performance when purchasing a service subscription, select a data center closest to the majority of your user population. Normal OPC service users, application developers, administrators and end users will not be directly concerned (or even aware) of Data Centers. However, Cloud administrator and architects need to be aware of and use data center selection taking factors such a network latency, failovers, high-availabilities etc.

Identity domain - Identity domains control authentication and authorization who can log in and what they can access once they log in. Multiple services can be associated with a single identity domain to share user definitions and authentication. Users in an identity domain can be granted different levels of access to each service associated with the domain. An Oracle Cloud Service has to belong to an Identity Domain. Identity Domains control service user authentication and authorization. Service users in an identity domain can have different levels of access.
A self-service administration tool, Oracle Identity Console is used in the provisioning and management of services for end user and administrator accounts for all Oracle Cloud services in the Account. Note these end users and administrators are for OPC services and not that of applications developed and deployed in OPC.

Service - A software offering in the Oracle Cloud. Oracle offers social, application, and platform services. Oracle applications (like HCM, ERP, Financials) are also being offered as services. From developers perspective Java and Developer platforms are offered as service. In this post we’ll explore Database service with APEX. You can request one or more service offerings. They are priced independently, however they are interoperable. For each Service that you request you can assign a unique name within the identity domain.

2. Creating an Oracle Cloud Account
The procedure to procure a free trial account (or a paid services account) is described in Oracle Cloud Tutorials here.
After you activate your account, the confirmation email you receive could be a bit confusing. IT was for me. The review of OPC terminology will help. I’ll briefly review the sections here after activation of one Database Service. OPC account was activated at the same time, as this was the first services I requested. Note that any additional service I request will use the same OPC account.

The email has following 5 sections. Each section contains URL for access, userid/password for access
Service Details
This section contains URL for accessing the Service, userid/password for access, data center name and an FTP account. This FTP account is specific for the service. More on this later. Also included in this section is account administration URL. This account administration is Oracle account with Single Sign On (SSO) and can be used for administer ALL services under this account.
Identity Domain Details
An Identity Domain is created in association with the Service request for the first time. Users accounts of the Services (not your applications deployed in services) can be administered under this Identity Domain.
This section includes URL for Identity Domain access and Identity Management Console. Every OPC service is associated with a unique Identity Domain.
Account Details
This section contains Oracle SSO account details. IF this is the first time your Oracle account has been created then you are required to change the password.
Domain FTP Account Details
There is also an FTP account created for the Identity Domain. This FTP account is different from Service FTP account. This is used to upload/download data to Identity domain.

3. Accessing OPC Database Service
You can access the Database Service using the URL provided under Service Detail section. Following login screen is available.


When you login to the OPC database service APEX user interface (dashboard) which is already configured with a workspace is available. Note the workspace name at right top corner.


If you have worked with APEX before, you’ll recognize the this user interface. This platform provides complete environment for complete application development in a team environment using Oracle database capabilities. We’ll explore the sample application that is already installed in the next section.

2. Explore APEX in OPC

Home screen, by default provides access to Application Builder, SQL Workshop, Team Development, and Administration area. We’ll explore these in later posts. Each of these areas provide functionality for Rapid application development.


There a sample database application available. Click on Application Builder to access the Sample Application. Note that we can right away Run the application or Edit the application to customize it.
In addition there are several prepackaged application that can be installed/deployed to your workspace and customized (if the application is NOT LOCKED.



More in building and customizing APEX applications in future posts.
Till then BYE!

References:

Startup APEX with Oracle 11g on AWS

In my previous post I completed creating an Oracle instance from public AMI on AWS. In a following post we configured OEM.
In this post I’ll start APEX on this instance. This instance of Oracle comes preinstalled with APEX.

First we have to reset the password of ADMIN and APEX_PUBLIC_USER and unlock the accounts. The process to reset these are described here.
For resetting password of ADMIN user we must use apxchpwd.sql. For APEX_PUBLIC_USER we can use ALTER USER command.

ADMIN user password change…

oracle@domU-12-31-39-00-64-53:[/u01/app/oracle/product/11.2.0/db_1/apex]
$ ls
apex_epg_config.sql       apexvalidate.sql  apxdbmig.sql  apxe101.sql  apxldimg.sql  apxremov.sql  apxxemig.sql  catapx.sql   devins.sql  load_trans.sql  utilities
apex_epg_config_core.sql  apxchpwd.sql      apxdevrm.sql  apxe102.sql  apxpatch.sql  apxrtins.sql  apxxepwd.sql  core         endins.sql  owa
apexins.sql               apxconf.sql       apxdvins.sql  apxe111.sql  apxrelod.sql  apxsqler.sql  builder       coreins.sql  images      patches
oracle@domU-12-31-39-00-64-53:[/u01/app/oracle/product/11.2.0/db_1/apex]
$ sqlplus / as sysdba;

SQL*Plus: Release 11.2.0.1.0 Production on Thu Feb 14 20:27:12 2013

Copyright (c) 1982, 2009, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> @/u01/app/oracle/product/11.2.0/db_1/apex/apxchpwd.sql
Enter a value below for the password for the Application Express ADMIN user.


Enter a password for the ADMIN user              []

Session altered.

...changing password for ADMIN

PL/SQL procedure successfully completed.


Commit complete.

SQL>

APEX_PUBLIC_USER password change…


SQL> ALTER USER APEX_PUBLIC_USER IDENTIFIED BY ********;

User altered.

SQL>

Now we can access the APEX via web browser.



We’ll explore the APEX application development environment in the next post.

Till then BYE.

Configuring EM for Oracle 11g on AWS

In my previous post creating-oracle-11g-instance-in-aws we explored how to create an AWS EC2 instance from preconfigured Oracle 11g public AMI.
Many months later, after starting a LINUX instance with Oracle 11g configure AMI, I found that EM (enterprise manager) was not configured properly.
In this post I’ll explore and start EM.

After logging into OS using oracle user, I issued the following commands.


Note the two IP addresses 174-129-62-10 (in emctl response) and 54-234-168-130 (at the header). This indicates AMI previous configuration is file is sitting there.
We need to reconfigure EM.

oracle@domU-12-31-39-00-64-53:[/u01/app/oracle/product/11.2.0/db_1]
$ emca -deconfig dbcontrol db -repos drop;

STARTED EMCA at Feb 13, 2013 4:15:31 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: odmdb
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:

Do you wish to continue? [yes(Y)/no(N)]: Y
Feb 13, 2013 4:15:58 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_2013_02_13_16_15_30.log.
Feb 13, 2013 4:15:59 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Feb 13, 2013 4:15:59 PM oracle.sysman.emcp.ParamsManager checkListenerStatusForDBControl
WARNING: Error initializing SQL connection. SQL operations cannot be performed
Feb 13, 2013 4:15:59 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Feb 13, 2013 4:16:59 PM oracle.sysman.emcp.util.PlatformInterface executeCommand
WARNING: Error executing /u01/app/oracle/product/11.2.0/db_1/sysman/admin/emdrep/bin/RepManager -connect (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=ec2-174-129-62-10.compute-1.amazonaws.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=odmdb))) -repos_user SYSMAN -action drop -verbose -output_file /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_repos_drop_2013_02_13_16_15_59.log
Feb 13, 2013 4:16:59 PM oracle.sysman.emcp.EMReposConfig invoke
SEVERE: Error dropping the repository
Feb 13, 2013 4:16:59 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_repos_drop_<date>.log for more details.
Feb 13, 2013 4:16:59 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Error dropping the repository
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_2013_02_13_16_15_30.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_2013_02_13_16_15_30.log for more details.
oracle@domU-12-31-39-00-64-53:[/u01/app/oracle/product/11.2.0/db_1]

This failed, and on checking the log, I realized the SYSMAN password was wrong. So I am going to correct the SYSMAN account (PW reset) and try EMCA again.

oracle@domU-12-31-39-00-64-53:[/u01/app/oracle/product/11.2.0/db_1]
$ emca -deconfig dbcontrol db -repos drop;

STARTED EMCA at Feb 13, 2013 4:23:25 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: odmdb
Listener port number: 1521
Password for SYS user:
Password for SYSMAN user:

Do you wish to continue? [yes(Y)/no(N)]: Y
Feb 13, 2013 4:23:48 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_2013_02_13_16_23_24.log.
Feb 13, 2013 4:23:49 PM oracle.sysman.emcp.EMDBPreConfig performDeconfiguration
WARNING: EM is not configured for this database. No EM-specific actions can be performed.
Feb 13, 2013 4:24:49 PM oracle.sysman.emcp.EMConfig perform
SEVERE: Listener is not up or database service is not registered with it. Start the Listener and register database service and run EM Configuration Assistant again .
Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_2013_02_13_16_23_24.log for more details.
Could not complete the configuration. Refer to the log file at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_2013_02_13_16_23_24.log for more details.
oracle@domU-12-31-39-00-64-53:[/u01/app/oracle/product/11.2.0/db_1]
$

However this time we get the message that DB is not registered with Listener. Let’s check.
$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 13-FEB-2013 16:27:32

Copyright (c) 1991, 2009, Oracle.  All rights reserved.

Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date                13-FEB-2013 11:14:39
Uptime                    0 days 5 hr. 12 min. 52 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/domU-12-31-39-00-64-53/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=domU-12-31-39-00-64-53)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=domU-12-31-39-00-64-53)(PORT=8080))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "odmdb" has 1 instance(s).
  Instance "odmdb", status READY, has 1 handler(s) for this service...
Service "odmdbXDB" has 1 instance(s).
  Instance "odmdb", status READY, has 1 handler(s) for this service...
The command completed successfully
oracle@domU-12-31-39-00-64-53:[/u01/app/oracle/product/11.2.0/db_1]
$

Well Listener is up and servicing the database. So we are going to create the EM repository.
Note: You’ll need the DB password for SYS, DBSNMP and SYSMAN users.

If you continue this you’ll get an error that SYSMAN already exists. We should have used recreate command on emca
Also in case where AMI was created with ORACLE_HOSTNAME and other parameters set to original instance value, please make sure that those values are changed to reflect the current instance values.
In this instance the .bash_profile had set the HOSTNAME to old value. I corrected that.

oracle@domU-12-31-39-00-64-53:[/home/oracle]
$ emca -config dbcontrol db -repos recreate;

STARTED EMCA at Feb 13, 2013 5:04:48 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: odmdb
Listener port number: 1521
Listener ORACLE_HOME [ /u01/app/oracle/product/11.2.0/db_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1

Local hostname ................ ec2-54-234-168-130.compute-1.amazonaws.com
Listener ORACLE_HOME ................ /u01/app/oracle/product/11.2.0/db_1
Listener port number ................ 1521
Database SID ................ odmdb
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Feb 13, 2013 5:05:30 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at /u01/app/oracle/cfgtoollogs/emca/odmdb/emca_2013_02_13_17_04_47.log.
Feb 13, 2013 5:05:32 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Dropping the EM repository (this may take a while) ...
Feb 13, 2013 5:09:02 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully dropped
Feb 13, 2013 5:09:03 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Feb 13, 2013 5:23:18 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Feb 13, 2013 5:23:26 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Feb 13, 2013 5:26:33 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Feb 13, 2013 5:26:38 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Feb 13, 2013 5:26:38 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Feb 13, 2013 5:27:46 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Feb 13, 2013 5:27:46 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Feb 13, 2013 5:28:56 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Feb 13, 2013 5:28:56 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Feb 13, 2013 5:31:25 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Feb 13, 2013 5:31:25 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://ec2-54-234-168-130.compute-1.amazonaws.com:1158/em <<<<<<<<<<<
Feb 13, 2013 5:31:46 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /u01/app/oracle/product/11.2.0/db_1/ec2-54-234-168-130.compute-1.amazonaws.com_odmdb/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Feb 13, 2013 5:31:46 PM
oracle@domU-12-31-39-00-64-53:[/home/oracle]
$

Now we can use the URL to access the EM from web browser.


That is it. Give it try. Good Luck.

Note with this EC2 instance is Oracle Database is configured to continuously perform work, behind the scenes. So even if you are not actively working with this instance, there are IO and CPU cycles being consumed and will incur some cost. Specifically with this instance if you keep the instance running in default configuration without accessing the instance at all you’ll incur about $40.00 (Estimated) cost per month.
You can create a custom AMI or a SPOT instance to lower the cost.

More in Next.