Monday, January 5, 2015

How to Start the Oracle Cloud Control OMS



This is for cloud control 12.1.0.4  but should work for most Cloud Control variants

We're assuming here that you have installed the Cloud Control database, and run all the installation etc but you've forgotten how to start the OMS, so this is a fairly basic Oracle Cloud Control installation.



Assumptions : We're working on Oracle Linux here but it's fairly simple to do this on any platform.


First thing to do is to source the environment :

export ORACLE_BASE=/u01/oracle/
export ORACLE_HOME=/u01/oracle/oms12104/oms
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=EMREP

Your paths and SID will of course vary.   If  you don't want to spend too much time looking for those values 

SID should be easy to find 

and the first two values can be found by checking 
/etc/oragchomelist which is a file that should exist on every OMS with usually the first two lines being that of the BASE and HOME 

e.g. 

[oracle@ebscloud ~]$ cat /etc/oragchomelist
/u01/oracle/oms/oms
/u01/oracle/oms12104/oms

/u01/oracle/agent/core/12.1.0.4.0:/u01/oracle/agent/agent_inst
[oracle@ebscloud ~]$



Steps to check

1.  OMS repository database is available
2.  OMS Repository listener is available and you can connect to it.

The above steps are easy to check by using a SQLPLUS check from SYSMAN/@ if you have defined it in TNSNAMEs 

[oracle@ebscloud ~]$ tnsping EMREP

TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 05-JAN-2015 11:54:16

Copyright (c) 1997, 2013, Oracle.  All rights reserved.

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = ebscloud)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = EMREP)))
OK (90 msec)
[oracle@ebscloud ~]$ sqlplus sysman/password@emrep

SQL*Plus: Release 11.2.0.4.0 Production on Mon Jan 5 11:54:31 2015

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


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

SQL>

so that is all OK.

OK so now we can see the database.

next step is to start the OMS.

[oracle@ebscloud ~]$ emctl start oms
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Starting Oracle Management Server...
Starting WebTier...
WebTier Successfully Started
Oracle Management Server Already Started
Oracle Management Server is Up
[oracle@ebscloud ~]$

This can take a few minutes. 

note that this can cause a lot of database throughput so be aware that "Management Server is Up"  may not be entirely correct, but we will show it off as the management server will not start until some database work is complete. 

How do we check it is started OK ? 

Simple Method : 

[oracle@ebscloud ~]$ emctl status oms
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
WebTier is Up
Oracle Management Server is Down

So we realize that starting cloud control can take a LONG time 

top - 12:11:48 up 31 min,  2 users,  load average: 3.50, 2.52, 2.20
Tasks: 456 total,   2 running, 454 sleeping,   0 stopped,   0 zombie
Cpu(s): 23.0%us,  2.6%sy,  0.0%ni, 70.2%id,  4.0%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  14387520k total,  8291548k used,  6095972k free,    59120k buffers
Swap:        0k total,        0k used,        0k free,  5566052k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
10373 oracle    20   0 7133m 888m  54m S 152.4  6.3   5:34.56 java
 2858 oracle    20   0 4509m 817m 773m S 43.4  5.8   2:40.02 oracle
 1999 oracle    -2   0 4461m  16m  14m S  4.0  0.1   0:29.90 oracle


If we look at top or iotop we can see lots of Java or DBW on the database server.  Wait till it all dies off and then run the status command again.  This can take up to 25-30 minutes on slow OMS machines 


but finally 

[oracle@ebscloud ~]$ emctl status oms
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
WebTier is Up
Oracle Management Server is Up
[oracle@ebscloud ~]$


so that's not very detailed so let's ask for the details  ( note you need the sysman password for this ) .  If you don't have the sysman password you shouldn't really be starting and stopping the OMS .....  but it might happen.  However to get the detail status you need it. 


if we add the detail and sysman_pwd in

[oracle@ebscloud ~]$ emctl status oms -details -sysman_pwd
Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Console Server Host        : ebscloud.bsx.com
HTTP Console Port          : 7790
HTTPS Console Port         : 7803
HTTP Upload Port           : 4890
HTTPS Upload Port          : 4904
EM Instance Home           : /u01/oracle/gc_inst1/em/EMGC_OMS1
OMS Log Directory Location : /u01/oracle/gc_inst1/em/EMGC_OMS1/sysman/log
OMS is not configured with SLB or virtual hostname
Agent Upload is locked.
OMS Console is locked.
Active CA ID: 1
Console URL: https://ebscloud.bsx.com:7803/em
Upload URL: https://ebscloud.bsx.com:4904/empbs/upload

WLS Domain Information
Domain Name            : GCDomain
Admin Server Host      : ebscloud.bsx.com
Admin Server HTTPS Port: 7103
Admin Server is RUNNING

Oracle Management Server Information
Managed Server Instance Name: EMGC_OMS1
Oracle Management Server Instance Host: ebscloud.bsx.com
WebTier is Up
Oracle Management Server is Up

BI Publisher is not configured to run on this host.
[oracle@ebscloud ~]$


Note that the Console URL should be recorded as that is what you want to put into the browser address bar and that will be the title of the next post. 

so from above we record  https://ebscloud.bsx.com:7803/em


How do we stop the OMS

emctl stop oms should work just fine.


Oracle Enterprise Manager Cloud Control 12c Release 4
Copyright (c) 1996, 2014 Oracle Corporation.  All rights reserved.
Stopping WebTier...
WebTier Successfully Stopped
Stopping Oracle Management Server...
Oracle Management Server Successfully Stopped
Oracle Management Server is Down
[oracle@ebscloud ~]$



Tuesday, August 19, 2014

More new Checks in DBMS_FEATURE_USAGE

After yesterdays post I decided to just run a quick diff against 12.1.0.1 and 12.1.0.2 catfsusrg.sql

This returned about 2000 lines, so I filtered it by new procedures

this results in

 CREATE OR REPLACE PROCEDURE dbms_feature_ba_owner
CREATE OR REPLACE PROCEDURE dbms_feature_adaptive_plans
CREATE OR REPLACE PROCEDURE dbms_feature_auto_reopt
CREATE OR REPLACE PROCEDURE dbms_feature_zmap
create or replace procedure DBMS_FEATURE_JSON
create or replace procedure DBMS_FEATURE_IOT(
create or replace procedure DBMS_FEATURE_IMC(
create or replace procedure DBMS_FEATURE_ADV_TABCMP(
create or replace procedure DBMS_FEATURE_DATABASE_ODM
CREATE OR REPLACE PROCEDURE DBMS_FEATURE_GATEWAYS
CREATE OR REPLACE PROCEDURE dbms_feature_emx
create or replace procedure DBMS_FEATURE_IMA(

A quick look at a couple of these
zmap=Zone Maps ( ? )

dbms_ba_owner looks like something to do with RMAN as there is much stuff in recover.bsq to back it.    Hmmmm....


Monday, August 18, 2014

dbms_feature_usage in 12.1.0.2 and the in-memory option.

With all the kerfuffle about in-memory reporting usage recently I thought I'd write a post about it.

DBMS_FEATURE_USAGE is a set of packages and procedures produced by Oracle to check ( the clue is in the title ) about how whether particular features are in use, and usually, if a license fee is due.

It does this by running a set of checks and recording the output.

Over a couple of blog posts I will see if we can figure out how it works.

We will take a topical example, that of the In-Memory Option.

So : How does Oracle figure out one is using In-Memory ?

in $ORACLE_HOME/rdbms/admin are several scripts.  The one we are interested in is
catfsusrg.sql

In this long piece of SQL ( 13000+ lines )  are procedures to check if anything from ASM to Exadata is in use.

So how does In-Memory Column Option get checked ?

Step forward

/****************************************************************
 * DBMS_FEATURE_IMC
 * The procedure to detect In-Memory Column Store usage
 ****************************************************************/

What does this do ?
It takes
   'select count(*) from dba_tables where ' ||
       'inmemory_compression is not null',
    'select count(*) from dba_tab_partitions where ' ||
       'inmemory_compression is not null'
   'select count(*) from dba_tab_subpartitions where ' ||
       'inmemory_compression is not null'
    'select count(*) from gv$im_segments_detail where ' ||
       'segtype=0'
( apparently to exclude in-memory journals ) 

Adds up the answer from the above 4 counts;  if the number is > 0 then the feature is in use. 










Wednesday, July 9, 2014

Oracle Fusion Middleware 12c 12.1.3 released


Hi folks and sorry for the big gap in blogging !


Well folks we at Version 1 keep a close eye on what is happening in the Oracle world.  Oracle have recently released Fusion Middleware 12c 12.1.3 which is a major release of their middleware stack

Over the next short while we will be releasing blogs and looking at the new features that showcase this major release but for now here are the major links to get you started

The Oracle Main FMW page :

http://www.oracle.com/us/products/middleware/overview/index.html

The Oracle OTN page

( includes downloads )

http://www.oracle.com/technetwork/middleware/fusion-middleware/overview/index.html

the main documentation set

http://docs.oracle.com/middleware/1213/index.html

and finally a link to the main infrastructure "What's New" ( e.g. OPMN has been removed )

http://docs.oracle.com/middleware/1213/core/ASCON/whatsnew.htm#ASCON11223

Best regards and speak to you all soon !

Chris

Wednesday, October 23, 2013

Editing a Putty Session to always point at the correct AWS Instance.



Problem : Putty Sessions are in the registry.

So we want to edit the registry to insert the new public DNS name after we have started it.  ( our intent is to start and stop nightly so we are lazy about picking up the new DNS name )

We can get the dns name from the previous step.

Probably the best way to do this is write and execute a registry .reg file.

Relevant key is
HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions.


So.... if we do something along the line of exporting the relevant session hive and the substituting in the rest... i.e. like

aws ec2 describe-instances --filters "Name=instance-id,Values=i-xxxx" --quer
y "Reservations[*].Instances[*].{dz:PublicDnsName}" --output text  > pdn1.out
set /p myvar=type firstpart.in > update.reg
echo "HostName"="%myvar%" >> update.reg
type lastpart.in >> update.reg
C:\Users\Chris\.aws>

Sub in the relevant instance-id and then run update. reg .... also don't forget to edit the registry if you want to divert X window tunnels etc for Vnc desktop , you need the internal IP for that though so a slightly different call but should not be excessive.

If you wanted to make that easy you could run it up as a .bat with admin rights to avoid the UAC prompt but .. as I said... exercise for the reader !


Using the AWS CLI to get a public hostname



We use this for the next step,  amending Putty.


  • Assumptions : 
  • We know the instance-id 
  • We have a working CLI. 
So we use ec2-describe-instances 


C:\Users\Chris\.aws>
We use a filter to only get info for our instance. 
We use a query to only output the Public DNSNAME 
aws ec2 describe-instances 

--filters "Name=instance-id,
Values=i-xxxxxx"
 --query
 "Reservations[*].Instances[*].{dz:PublicDnsName}" 
--output  text



C:\Users\Chris\.aws>aws ec2 describe-instances --filters "Name=instance-id,Value
s=i-xxxxxxxx" --query "Reservations[*].Instances[*].{dz:PublicDnsName}" --output
 text
ec2-255-255-255-5255.eu-west-1.compute.amazonaws.com


So now we have our public DNSNAME, and with that we can change our putty settings ! 

Getting the Amazon SDK Running.

Hi folks we will talk about getting Amazon AWS command line tools

We assume you have signed up with Amazon and given them your credit card etc etc.

First thing to do is download the Windows installer from


http://aws.amazon.com/cli/


https://s3.amazonaws.com/aws-cli/AWSCLI64.msi


this is 5.7 mb currently .  So when you run that



So accept the license and click next next next 




So the next thing to do is to follow the rest of  http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html


If we look at our PATH setting now by opening a command window we can see that AWSCLI has been added to the end of the variable, usually c:\program files\Amazon\AWSCLI
If we now try 

C:\Users\Chris>aws

usage: aws [options] [parameters]
aws: error: too few arguments

C:\Users\Chris>

it is evident we must do a lot of things to get it all configured to start talking to our instances. 

First thing to do is to look at getting the config file set up. 

This will need to be in a directory .aws, so usually %USERPROFILE%\.aws\config

C:\Users\Chris>mkdir .aws


C:\Users\Chris>cd .aws

C:\Users\Chris\.aws>dir
 Volume in drive C is OS
 Volume Serial Number is F619-A748

 Directory of C:\Users\Chris\.aws

23/10/2013  12:43    

         .
23/10/2013  12:43    

         ..
               0 File(s)              0 bytes
               2 Dir(s)  13,599,453,184 bytes free


So what will this config file contain ?  Well this is the important credential and region information. 

We see an example in the getting started 

[default]
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
region = us-west-2


OK so where do we get our values.

Region should be easy as it is where you will be doing most of your work for me that will be eu-west-1

yours will probably be different. 

OK that was easy.  For our access key and secret we got these when we signed up first for AW.  You can get them from https://portal.aws.amazon.com/gp/aws/securityCredentials

So edit the liitle config file with the relevant information in it 



 Directory of C:\Users\Chris\.aws

23/10/2013  12:56    
         .
23/10/2013  12:56    
         ..
23/10/2013  12:57               137 config
               1 File(s)            137 bytes
               2 Dir(s)  13,595,860,992 bytes free


C:\Users\Chris\.aws>


One point to note is that if you are using notepad to edit the config file it saves it as .txt which is wrong it needs to be just called config. 

OK so let's give it a try 

C:\Users\Chris\.aws>aws ec2 describe-regions|more

{
    "Regions": [
        {
            "Endpoint": "ec2.eu-west-1.amazonaws.com",
            "RegionName": "eu-west-1"
        },
        {
            "Endpoint": "ec2.sa-east-1.amazonaws.com",
            "RegionName": "sa-east-1"
        },
        {
            "Endpoint": "ec2.us-east-1.amazonaws.com",
            "RegionName": "us-east-1"
        },
        {
            "Endpoint": "ec2.ap-northeast-1.amazonaws.com",
            "RegionName": "ap-northeast-1"
        },
        {
            "Endpoint": "ec2.us-west-2.amazonaws.com",
            "RegionName": "us-west-2"
        },
        {
            "Endpoint": "ec2.us-west-1.amazonaws.com",
-- More  --



OK... all working

In the next post we will show how to grab some value out of this.