Installing OEM 12C in silent mode – Part II – Preparing the response files and running the installer

Please read Part-I @ https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-i-basic-prerequisites/ before reading this

Now we’ll see the contents and mandatory fields of the OEM installation response file…
The response file is similar to the ones required by all the Oracle silent mode installation frameworks…
Below are the minimum field required to be filled up apart from the defaults assumed by Oracle…

UNIX_GROUP_NAME= Primary group of Oracle user

ORACLE_MIDDLEWARE_HOME_LOCATION= The base installation directory under which you want to put all your installation components like OMS, Agent, Weblogic etc…

DATABASE_HOSTNAME=machine name/IP address of the Database host where your OEM repository Database is located

LISTENER_PORT=port number of the listener on which your repository database service is running

SERVICENAME_OR_SID= Your repository database service_name/SID

SYS_PASSWORD=password for the sys user

SYSMAN_PASSWORD=password for the sysman user

SYSMAN_CONFIRM_PASSWORD=confirm sysman password

ORACLE_INSTANCE_HOME_LOCATION=it’s usually MIDDLEWARE_HOME/gc_inst but you can give a directory of your choice. This is the location where OEM creates an instance for our current oms installation

MANAGEMENT_TABLESPACE_LOCATION= Location of the OEM’s management tablespace’s data file

CONFIGURATION_DATA_TABLESPACE_LOCATION=Location of the OEM’s configuration tablespace’s data file

JVM_DIAGNOSTICS_TABLESPACE_LOCATION=Location of the OEM’s diagnostics tablespace’s data file

These are like normal datafiles every database uses for its tablespaces.

Now we’re complied to all the prerequisites, prepared our response file; let’s move on to the actual installation…

Download the OEM 12C packages from

http://www.oracle.com/technetwork/oem/enterprise-manager/downloads/index.html

unzip the packages in some staging directory and find a file called “runInstaller”.

now issue the command

runInstaller -silent -responseFile OEM_install.rsp

There’re lot more options available to direct the installation; you can find them @ http://docs.oracle.com/cd/E24628_01/install.121/e24089/install_em_exist_db_slnt.htm

This will start the installer and complete your installation.

Check the installation logs and perform the post installation steps specified by the OEM installer and you are done…

Your OEM is ready…You can access it from https://your_installation_host:7799/em

Keep watching my next post to install agents and add targets to be monitored in silent mode…

I appreciate you feedback and comments…

regards,
CSM

Advertisements

Installing OEM 12C in silent mode – Part I – Basic Prerequisites

Hi Guys,

I was trying to install OEM 12C last week. Installing 12C is nothing special but I wanted to do everything in silent mode. My plan was to automate the installation of OMS, Agents deployment and addition of the targets.

Oracle’s GUI mode installation is a bit easier as Oracle corporation has improved the accessibility very much and reduced the number of screens compared to it’s predecessor! but the silent mode installation is a bit painful even now!!

I’m writing the entire procedure in separate parts as it’s not that readable for the users if I post the entire thing in one post…

Ok, let’s move on…

I assume you had already checked and made your system comply with the prerequisites specified by Oracle

For OMS – http://docs.oracle.com/cd/E25178_01/install.1111/e24089/install_em_exist_db_slnt.htm

For Agent – http://docs.oracle.com/cd/E25054_01/install.1111/e24089/install_agent_usng_rsp.htm

After that you have to install one Database, with partitioning option enabled (obviously an EE database), which will be used by the OEM for its internal storage purposes.

But don’t get panic if you want to install OEM to monitor your targets which are SE/SE1 and you don’t have a EE license. Oracle allows you to run an EE Database, even in your production systems, without any extra license, for OEM storage purposes. All you need is you have to have a proper license for all the targets monitored by the OEM and the OEM itself.

The most important thing is, the OEM installer will abort if the Repository Database already contains SYSMAN schema. And much more dangerous thing is the installer will move forward if you don’t have SYSMAN schema but have others like SYSMAN_MDS, MGMT_VIEW etc…This is dangerous because the installer will not complete all the actions properly because of the existence of these other things…

So you have to make sure you don’t have SYSMAN and other things mentioned above as well…

execute the below commands in your repository Database by logging in as sys user…

drop user SYSMAN cascade;
drop user SYSMAN_MDS cascade;
drop user MGMT_VIEW cascade;
drop user SYSMAN_RO cascade;
drop user SYSMAN_OPSS cascade;
drop user SYSMAN_APM cascade;
drop user SYSMAN_BIP;
drop user CLOUD_SWLIB_USER cascade;
drop user CLOUD_ENGINE_USER cascade;
drop role MGMT_USER;
spool synonyms.lst
select ‘drop ‘|| decode(owner,’PUBLIC’,owner||’ synonym ‘||synonym_name, ‘ synonym ‘||owner||’.’||synonym_name) ||’;’ from dba_synonyms where table_owner in (‘SYSMAN’, ‘SYSMAN_MDS’, ‘MGMT_VIEW’, ‘SYSMAN_BIP’, ‘SYSMAN_APM’, ‘SYSMAN_OPSS’, ‘SYSMAN_RO’) ;
spool off
@synonyms.lst
spool tablespaces.lst
select ‘drop tablespace ‘||tablespace_name||’ including contents and datafiles;’ from dba_tablespaces where tablespace_name like ‘MGMT%’;
spool off
@tablespaces.lst
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME=’Metadata Services’;
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME=’Authorization Policy Manager’;
delete from SCHEMA_VERSION_REGISTRY where COMP_NAME=’Oracle Platform Security Services’;
commit;

Please have a look into the part II for the response file creation and remaining steps…

Part II is @ https://querycsm.wordpress.com/2012/07/31/installing-oem-12c-in-silent-mode-part-ii-preparing-the-response-files-and-running-the-installer/

contd…

“ORA-01081: cannot start already-running ORACLE” While creating a new Database

Hi Geeks,

When I was doing a research on Oracle Database creation, through DBCA, last week, I came across a very interesting scenario which I couldn’t stop sharing with you 🙂

I have a cluster of machines (don’t confuse it with a RAC cluster but just a group of machines required for my application deployment) with 11.2.0.2 installed and a Database instance running.

I got a requirement to remove everything accumulated in the machine as a result of the Oracle installation and the Database creation: The installation directories, the datafiles, oratab entries etc…

After removing all these things, I need to do a fresh installation again, create a Database and make the system running as it was before the reset activity. But the main point to consider here is, we have to do this on a cluster of machines and as quickly as possible.

So, I thought of removing the Databases with DBCA and do a ‘brute-force’ removal of all the physical files. I’ve noticed that the DBCA is taking at least 3-5 minutes for each Database to remove so in a cluster of 10 Databases it’ll add a burden of 30-50 minutes unnecessarily.

So, I’ve decided to remove everything related to Oracle from each machine in a brute-force way and start the installation and Database creation steps.

After finishing up the installation and receiving a zero return value from DBCA I thought of cross checking the things and observed that the Database is not created properly; no datafiles were created even but just an entry in /etc/oratab and some other stuff despite the success reported by DBCA…

To my bad, of course good, after seeing the DBCA logs, I found that the Database creation was failing with a very weird error.

ORA-01081: cannot start already-running ORACLE

I’m almost surprised on seeing this message!!!

As we all know that DBCA first prepares an instance and do a clone. So it’s trying to create the instance as per the plan but failing to start the instance saying the instance is already exist!!!

I swear I’ve removed each and every file related to Oracle even the registry entries 🙂
It’s a clean machine with just Oracle installed but why this thing is happening???

See the log below to get a clarity on the issue.

Copying database files
DBCA_PROGRESS : 1%
DBCA_PROGRESS : 2%
ORA-01075: you are currently logged on
ORA-01081: cannot start already-running ORACLE – shut it down first
DBCA_PROGRESS : 4%
DBCA_PROGRESS : 37%
Creating and starting Oracle instance
ORA-01075: you are currently logged on
DBCA_PROGRESS : 38%
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-01092: ORACLE instance terminated. Disconnection forced
DBCA_PROGRESS : 100%

After digging in, and doing a fair amount of research, I found the mistake that I’ve committed!!!

I’ve cleaned the physical files but what about the memory structure Oracle built in the operating system’s shared memory segments?

Yes, your guess is correct; The memory structures created by Oracle are remained intact in the shared memory. An ipcs has shown me that there are the latches and semaphores acquired by this particular Oracle instance were not released.

I wouldn’t have come across this issue if I’ve chosen a different name for my instance or with the same name but from different ORACLE_HOME as Oracle’s key to acquire the shared memory structures is the combination of OH and SID. If I use a different OH or SID, the DBCA will try to acquire the latches and the semaphores using this new key.

So I did a shutdown abort (I could do any kind of shutdown in fact but my idea is to do it as fast as possible) before doing the brute-force reset, which would release all the shared memory structures, latches and semaphores cleanly and able to complete my task.

The biggest mystery is why DBCA is not aborting upon noticing this? why it’s reporting a success upon a ‘disastrous failure’??

Oracle confirmed it’s a bug in DBCA not to report failures in silent mode. So you couldn’t just rely on the return status to the OS but have to do a lot more validations to confirm your mission is accomplished 🙂

I welcome your feedback and suggestions.

Regards,
CSM

Can you create objects in a READ ONLY tablespace?

Hi Oracle geeks,
Last Friday, I’ve noticed a strange thing happening in my 11.2.0.3 Database: I’m able to create objects in a tablespace which is marked READ ONLY !!!

Don’t believe this?? See the below

SQL> create tablespace ro datafile ‘/xxx/RO.DBF’ size 10M AUTOEXTEND ON;
Tablespace created.

SQL> alter tablespace ro read only;
Tablespace altered.

SQL> select status from dba_tablespaces where tablespace_name=’RO’;
STATUS
———
READ ONLY

SQL> sho user
USER is “CSM

SQL> create table csm(a number) tablespace ro;
Table created.

looking strange!!!

but connect as a ‘sys’ user now. and do the same exercise

SQL> conn sys/sys as sysdba
Connected.

SQL> sho user
USER is “SYS

SQL> create table csm(a number) tablespace ro;
create table csm(a number) tablespace ro
*
ERROR at line 1:
ORA-01647: tablespace ‘RO’ is read-only, cannot allocate space in it

OMG!! it’s working as (un)expected…

After investigating a bit I found the reason behind this strange behavior(only in our perspective) is,

There is an option called ‘deferred_segment_creation’ starting from 11.2 which just adds an entry into the data dictionary but won’t actually create a segment.
So even in case of a locally managed tablespace, Oracle need not update the bitmaps in the current tablespace (RO in our case).
As it is just adding an entry into some of the data dictionary tables, Oracle doesn’t throw any errors.

You can’t even find a segment created in this tablespace

SQL> select segment_name,segment_type from dba_segments where tablespace_name=’RO’;
no rows selected

If you try to create a table by forcing it not to use the deferred_segment mode like this,

SQL> create table csm2(a number) segment creation IMMEDIATE tablespace ro;
create table csm2(a number) segment creation IMMEDIATE tablespace ro
*
ERROR at line 1:
ORA-01647: tablespace ‘RO’ is read-only, cannot allocate space in it

you’ll encounter the ORA-01647 error.

But the biggest question is, why a sys user was unable to do the same???
The answer is, differed segment option is not available for the objects in sys and system schema 🙂

Regards,
CSM