Monday, October 31, 2016

RMAN-06726: could not locate archived log

oracle backup of logfiles is failing with error

RMAN-06726: could not locate archived log


Issue is that there are some expired logs which still have references in catalogue. To fix this issue the cross check

RMAN> crosscheck archivelog all;

You would notice that there are some validations of some of the files fail with  message

validation failed for archived log


After that check all expired logs

RMAN> list expired archivelog all;

and then delete all expired logs


RMAN> delete expired archivelog all;

This will ask to delete them, type yes and hit enter

Boom !!!

Issue is fixed.

Re-run the backup and it is all good.



Monday, October 24, 2016

ORA-00845: MEMORY_TARGET not supported on this system

Getting the error when trying to start database.

[oracle@rac1 ~]$ srvctl start database -d cdbracp
PRCR-1079 : Failed to start resource ora.cdbracp.db
CRS-5017: The resource action "ora.cdbracp.db start" encountered the following error:
ORA-00845: MEMORY_TARGET not supported on this system
. For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/rac1/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.cdbracp.db' on 'rac1' failed
CRS-2632: There are no more servers to try to place resource 'ora.cdbracp.db' on that would satisfy its placement policy
CRS-5017: The resource action "ora.cdbracp.db start" encountered the following error:
ORA-00845: MEMORY_TARGET not supported on this system
. For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/rac2/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.cdbracp.db' on 'rac2' failed
[oracle@rac1 ~]$

Annoying !!!!

Check the /dev/shm available space

[oracle@rac1 ~]$ df -h /dev/shm
Filesystem      Size  Used Avail Use% Mounted on
tmpfs                 2.4G  635M  1.8G  27% /dev/shm

Look like 1.8G and I know that my database instance has memory_target set up to 2G. Means we do not have enough space for this oracle instance in tmpfs

to fix this what I have done is modified /etc/fstab and set the value of tempfs to 5G. Please note that this value has to be less than available memory on host.

There is no need to restart after this, just remount the volume.

[root@rac1 ~]# mount -o remount /dev/shm
[root@rac1 ~]# df -h /dev/shm
Filesystem      Size  Used Avail Use% Mounted on
tmpfs                 5.0G  635M  4.4G  13% /dev/shm

Now I have 4.4G free space which means I should be able to start the instance with 2G of memory_target.

[oracle@rac1 ~]$ srvctl start database -d cdbracp
PRCR-1079 : Failed to start resource ora.cdbracp.db
CRS-5017: The resource action "ora.cdbracp.db start" encountered the following error:
ORA-00845: MEMORY_TARGET not supported on this system
. For details refer to "(:CLSN00107:)" in "/u01/app/oracle/diag/crs/rac2/crs/trace/crsd_oraagent_oracle.trc".

CRS-2674: Start of 'ora.cdbracp.db' on 'rac2' failed
CRS-2632: There are no more servers to try to place resource 'ora.cdbracp.db' on that would satisfy its placement policy
[oracle@rac1 ~]$


It only failed on node 2 as I am a dum ass and forgot to remount on node2

[oracle@rac1 ~]$ srvctl status database -d cdbracp
Instance cdbracp1 is running on node rac1
Instance cdbracp2 is not running on node rac2
[oracle@rac1 ~]$



after remounting on node2 I could start both database instances.

[root@rac2 ~]# mount -o remount /dev/shm
[root@rac2 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
tmpfs                 5.0G  635M  4.4G  13% /dev/shm

[oracle@rac1 ~]$ srvctl start instance -d cdbracp -i cdbracp2
[oracle@rac1 ~]$
[oracle@rac1 ~]$ srvctl status database -d cdbracp
Instance cdbracp1 is running on node rac1
Instance cdbracp2 is running on node rac2
[oracle@rac1 ~]$




Thursday, October 20, 2016

ORA-15046: ASM file name '+FRA/CDBRAC/CONTROLFILE/Current.261.909834683' is not in single-file creation form

tried copying the control file from +data to +fra and encountered the error.

ASMCMD> cd +DATA/CDBRAC/CONTROLFILE
ASMCMD> ls -l
Type         Redund  Striped  Time             Sys  Name
CONTROLFILE  UNPROT  FINE     OCT 20 15:00:00  Y    Current.261.909834683
CONTROLFILE  UNPROT  FINE     OCT 20 15:00:00  N    Current.261.909834683.copy => +DATA/ASM/CONTROLFILE/Current.261.909834683.copy.277.925746471
ASMCMD>
ASMCMD>
ASMCMD> cp Current.261.909834683 +FRA/CDBRAC/CONTROLFILE/Current.256.909834683
copying +DATA/CDBRAC/CONTROLFILE/Current.261.909834683 -> +FRA/CDBRAC/CONTROLFILE/Current.256.909834683
ASMCMD-8016: copy source '+DATA/CDBRAC/CONTROLFILE/Current.261.909834683' and target '+FRA/CDBRAC/CONTROLFILE/Current.256.909834683' failed
ORA-15056: additional error message
ORA-15046: ASM file name '+FRA/CDBRAC/CONTROLFILE/Current.256.909834683' is not in single-file creation form
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 486
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD>


Please note that it will only work if we specify the file name on target and do not specify the number or incarnation. That is something that asm will choose

ASMCMD> cp Current.261.909834683 +FRA/CDBRAC/CONTROLFILE
copying +DATA/CDBRAC/CONTROLFILE/Current.261.909834683 -> +FRA/CDBRAC/CONTROLFILE/Current.261.909834683
ASMCMD-8016: copy source '+DATA/CDBRAC/CONTROLFILE/Current.261.909834683' and target '+FRA/CDBRAC/CONTROLFILE/Current.261.909834683' failed
ORA-15056: additional error message
ORA-15046: ASM file name '+FRA/CDBRAC/CONTROLFILE/Current.261.909834683' is not in single-file creation form
ORA-06512: at "SYS.X$DBMS_DISKGROUP", line 486
ORA-06512: at line 3 (DBD ERROR: OCIStmtExecute)
ASMCMD>


-- Below is how it should be done.

ASMCMD>
ASMCMD> cp Current.261.909834683 +FRA/CDBRAC/CONTROLFILE/Current
copying +DATA/CDBRAC/CONTROLFILE/Current.261.909834683 -> +FRA/CDBRAC/CONTROLFILE/Current
ASMCMD>


ASMCMD> cd +FRA/CDBRAC/CONTROLFILE/      
ASMCMD> ls -l
Type         Redund  Striped  Time             Sys  Name
CONTROLFILE  UNPROT  FINE     OCT 20 15:00:00  N    Current => +FRA/ASM/CONTROLFILE/Current.488.925746873
CONTROLFILE  UNPROT  FINE     OCT 20 15:00:00  Y    Current.256.909834683
CONTROLFILE  UNPROT  FINE     OCT 20 15:00:00  N    Current.256.909834683.copyFra => +FRA/ASM/CONTROLFILE/Current.256.909834683.copyFra.487.925746605
ASMCMD>



Tuesday, October 18, 2016

Getting oracle parameter value and description

Getting the parameter values and description is very important. Some times show parameter will not show every thing link in this case of underscore parameter

SQL> show parameter _gc_read_mostly_locking
SQL>


to get the values best is running the command below and passing the name of the parameter.


col Parameter FOR a30
col Instance FOR a10
col Description FOR a100 word_wrapped

SELECT a.ksppinm  "Parameter", c.ksppstvl "Instance", a.ksppdesc "Description"
FROM x$ksppi a, x$ksppcv b, x$ksppsv c, v$parameter p
WHERE a.indx = b.indx
AND a.indx = c.indx
AND p.name(+) = a.ksppinm
AND UPPER(a.ksppinm) LIKE UPPER('%&parameter%')
ORDER BY a.ksppinm;



Example:

SQL> col Parameter FOR a30
SQL> col Instance FOR a10
SQL> col Description FOR a100 word_wrapped
SQL>
SQL> SELECT a.ksppinm  "Parameter", c.ksppstvl "Instance",       a.ksppdesc "Description"
  2  FROM x$ksppi a, x$ksppcv b, x$ksppsv c, v$parameter p
  3  WHERE a.indx = b.indx
  4  AND a.indx = c.indx
  5  AND p.name(+) = a.ksppinm
  6  AND UPPER(a.ksppinm) LIKE UPPER('%&parameter%')
  7  ORDER BY a.ksppinm;
Enter value for parameter: _gc_read_mostly_lock
old   6: AND UPPER(a.ksppinm) LIKE UPPER('%&parameter%')
new   6: AND UPPER(a.ksppinm) LIKE UPPER('%_gc_read_mostly_lock%')

Parameter                      Instance   Description
------------------------------ ---------- -----------------------------------------------------------------
_gc_read_mostly_locking        TRUE       if TRUE, enable read-mostly locking

SQL> 

ORA-00230: operation disallowed: snapshot control file enqueue unavailable

Received error

ORA-00230: operation disallowed: snapshot control file enqueue unavailable

in alert log of newly created primary after the switchover from DR and tracefile has following content

*** 2016-10-18 08:58:53.795
*** SESSION ID:(1998.27) 2016-10-18 08:58:53.795
*** CLIENT ID:() 2016-10-18 08:58:53.795
*** SERVICE NAME:(SYS$BACKGROUND) 2016-10-18 08:58:53.795
*** MODULE NAME:(MMON_SLAVE) 2016-10-18 08:58:53.795
*** ACTION NAME:(Autobackup Control File) 2016-10-18 08:58:53.795

Starting control autobackup
Got error: 230
********************  WARNING ***************************
The errors during Server autobackup are not fatal, as it
is attempted after sucessful completion of the command.
However, it is recomended to take an RMAN control file
backup as soon as possible because the Autobackup failed
with the following error:
ORA-00230: operation disallowed: snapshot control file enqueue unavailable
********************  END OF WARNING *******************
ORA-00230: operation disallowed: snapshot control file enqueue unavailable


Solution:

It looks like starting control file autobackup had some issues and resulted in creating

ORA-00230: operation disallowed: snapshot control file enqueue unavailable


Log in on the database and run the command below:

col CLIENT_INFO for a20
col EVENT for a35
Select sysdate, inst_id, sid, client_info,
event, seq#,p1,p2,p3, wait_time, seconds_in_wait,
wait_time_micro, time_since_last_wait_micro, state
from gv$session
where program like '%rman%'
and client_info like '%channel%';


or

SELECT s.sid, username AS "user" , program, module, action, logon_time as "Logon" , l.*   FROM v$session s, v$enqueue_lock l   WHERE l.sid = s.sid and l.type = 'CF' AND l.id1 = 0 and l.id2 = 2;



If you are getting some output with state waiting that means there is already and operation going on causing new operation to fail and showing the error in alert log.


Sometimes the process could be sitting there for ages, which means it is hung. In order to kill the process we need to find its UNIX process id to kill it.


COLUMN EVENT FORMAT a10      
COLUMN SECONDS_IN_WAIT FORMAT 999
COLUMN STATE FORMAT a20      
COLUMN CLIENT_INFO FORMAT a30    

SELECT p.SPID, EVENT, SECONDS_IN_WAIT AS SEC_WAIT,    
STATE, CLIENT_INFO      
FROM V$SESSION_WAIT sw,
V$SESSION s, V$PROCESS p      
WHERE sw.EVENT LIKE 'sbt%'
AND s.SID=sw.SID      
AND s.PADDR=p.ADDR;


once you have the SPID which is server process id or ID of UNIX process

then simply issue

kill -9 <SPID>

It should fix the issue.


Check if MRP process is running on DR instance.

Sometime we need to check if the MRP process is running in our DR database.

Solution:

This can be done using one simple SQL


SELECT PROCESS, DELAY_MINS
FROM V$MANAGED_STANDBY
WHERE PROCESS like 'MRP%';


If the above SQL returns nothing that means MRP is not running. How ever if it returns something that means MRP is running.

SQL> SELECT PROCESS, DELAY_MINS FROM V$MANAGED_STANDBY WHERE PROCESS like 'MRP%';
no rows selected
SQL>

-- MRP is not running 
-- To start MPR issue the SQL below

SQL>  ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;
Database altered.
SQL>
SQL> SELECT PROCESS, DELAY_MINS FROM V$MANAGED_STANDBY WHERE PROCESS like 'MRP%';
PROCESS   DELAY_MINS
--------- ----------
MRP0               0
SQL>

-- MRP process is running now.

Tip: if you want standby logs to be applied instantly then issue

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE USING CURRENT LOGFILE DISCONNECT;


Warning: ORA-16829: fast-start failover configuration is lagging

Automatic failover caused DR to become primary and primary to become DR, but when checked the dgmgrl configuration there were some errors.

$ dgmgrl
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys
Password:
Connected.
DGMGRL> show configuration

Configuration - db1tes_dg

  Protection Mode: MaxPerformance
  Databases:
    db1tesd - Primary database
      Warning: ORA-16829: fast-start failover configuration is lagging

    db1tesp - (*) Physical standby database
      Error: ORA-16810: multiple errors or warnings detected for the database

Fast-Start Failover: ENABLED

Configuration Status:
ERROR

DGMGRL>

DGMGRL> show database db1tesd

Database - db1tesd

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    db1tesd1

  Database Warning(s):
    ORA-16829: fast-start failover configuration is lagging

Database Status:
WARNING

DGMGRL>
DGMGRL>
DGMGRL>
DGMGRL> show database db1tesp

Database - db1tesp

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   (unknown)
  Apply Lag:       3 hours 20 minutes 3 seconds
  Real Time Query: ON
  Instance(s):
    db1tesp1 (apply instance)
    db1tesp2

  Database Warning(s):
    ORA-16826: apply service state is inconsistent with the DelayMins property
    ORA-16829: fast-start failover configuration is lagging

Database Status:
WARNING

DGMGRL>

Fix:

What I did in our case was simply restarted the the new DR and it fixed the issue.

$ srvctl stop database -d db1tesp
$ srvctl start database -d db1tesp


$ dgmgrl 
DGMGRL for Linux: Version 11.2.0.3.0 - 64bit Production

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

Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys
Password:
Connected.
DGMGRL> show configuration

Configuration - db1tes_dg

  Protection Mode: MaxPerformance
  Databases:
    db1tesd - Primary database
    db1tesp - (*) Physical standby database

Fast-Start Failover: ENABLED

Configuration Status:
SUCCESS

DGMGRL> 
DGMGRL> 
DGMGRL> show database db1tesp

Database - db1tesp

  Role:            PHYSICAL STANDBY
  Intended State:  APPLY-ON
  Transport Lag:   0 seconds
  Apply Lag:       0 seconds
  Real Time Query: ON
  Instance(s):
    db1tesp1 (apply instance)
    db1tesp2

Database Status:
SUCCESS

DGMGRL> show database db1tesd

Database - db1tesd

  Role:            PRIMARY
  Intended State:  TRANSPORT-ON
  Instance(s):
    db1tesd1

Database Status:
SUCCESS

DGMGRL> 


Monday, October 17, 2016

Getting time with the ping command

Problem:
Not a big problem but more like created by me. I just wanted to get more information when performing the ping. Sometime it is hand to get the time stamp when ping was performed. We get timestamp using -T in ping but we have to convert it before we can read it.

Fix:
Not a big deal but it can be done as below:

[root@rac1 ~]# ping rac2 | while read cmdoutput; do echo "$(date): $cmdoutput"; done
Mon Oct 17 11:25:28 AEDT 2016: PING rac2.localdomain (192.168.56.102) 56(84) bytes of data.
Mon Oct 17 11:25:28 AEDT 2016: 64 bytes from rac2.localdomain (192.168.56.102): icmp_seq=1 ttl=64 time=0.317 ms
Mon Oct 17 11:25:29 AEDT 2016: 64 bytes from rac2.localdomain (192.168.56.102): icmp_seq=2 ttl=64 time=0.584 ms
Mon Oct 17 11:25:30 AEDT 2016: 64 bytes from rac2.localdomain (192.168.56.102): icmp_seq=3 ttl=64 time=0.405 ms




DGM-17016: failed to retrieve status for database "db1tesd"

Problem:

Dataguard is show multiple error:
ORA-16810 ORA-16737 ORA-16662 DGM-17016
Error: ORA-16810: multiple errors or warnings detected for the database
Error: ORA-16662: network timeout when contacting a database
DGM-17016: failed to retrieve status for database "db1tesd"
DGMGRL> connect sys
Password:
Connected as SYSDG.
DGMGRL> show configuration
Configuration - db1tes_dg
  Protection Mode: MaxPerformance
  Members:
  db1tesp - Primary database
    Error: ORA-16810: multiple errors or warnings detected for the database
    db1tesd - Physical standby database
      Error: ORA-16662: network timeout when contacting a database
Fast-Start Failover: DISABLED
Configuration Status:
ERROR   (status updated 428 seconds ago)
DGMGRL>
DGMGRL> show database db1tesp
Database - db1tesp
  Role:               PRIMARY
  Intended State:     TRANSPORT-ON
  Instance(s):
    db1tesp1
      Error: ORA-16737: the redo transport service for standby database "db1tesd" has an error
    db1tesp2
      Error: ORA-16737: the redo transport service for standby database "db1tesd" has an error
Database Status:
ERROR
DGMGRL>
DGMGRL>
DGMGRL> show database db1tesd
Database - db1tesd
  Role:               PHYSICAL STANDBY
  Intended State:     APPLY-ON
  Transport Lag:      (unknown)
  Apply Lag:          (unknown)
  Average Apply Rate: (unknown)
  Real Time Query:    OFF
  Instance(s):
    db1tesd1
Database Status:
DGM-17016: failed to retrieve status for database "db1tesd"
ORA-16662: network timeout when contacting a database
DGMGRL>




Cause:

Reason in my case is that the DR host is shutdown and primary can not connect to it.


Fix:

Start the DR host and things start looking normal again.






ORA-19554: error allocating device, device type: SBT_TAPE, device name:

Problem:

Getting an error ORA-19554: error allocating device, device type: SBT_TAPE, device name: when trying to duplicate the database to standby database

RMAN> duplicate target database for standby from active database
2> spfile
3> set audit_file_dest='/u01/app/oracle/admin/db1tesd/adump'
4> set db_unique_name='db1tesd'
5> set fal_server='db1tesp1','db1tesp2'
6> set instance_number='1'
7> NOFILENAMECHECK;
Starting Duplicate Db at 17-OCT-16
using target database control file instead of recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 10/17/2016 02:30:46
RMAN-05501: aborting duplication of target database
RMAN-03009: failure of allocate command on ORA_AUX_SBT_TAPE_1 channel at 10/17/2016 02:30:46
ORA-19554: error allocating device, device type: SBT_TAPE, device name:
ORA-27211: Failed to load Media Management Library
Additional information: 2
RMAN>

Issue1:

The issue here is that SBT_TAPE variable is set and causing the problem.

CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 1 BACKUP TYPE TO BACKUPSET;

Fix 1:

Check the current value of SBT_TAPE

$ rman target /
RMAN> show DEVICE TYPE;
RMAN configuration parameters for database with db_unique_name DB1TESP are:
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
RMAN>
RMAN> CONFIGURE DEVICE TYPE 'SBT_TAPE' clear;
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE 'SBT_TAPE' PARALLELISM 1 BACKUP TYPE TO BACKUPSET;
RMAN configuration parameters are successfully reset to default value
RMAN>
RMAN> show DEVICE TYPE;
RMAN configuration parameters for database with db_unique_name DB1TESP are:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
RMAN> 

Issue 2:

RMAN had below setting
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';

Fix 2: 
Just clear this setting and try again
RMAN> CONFIGURE DEFAULT DEVICE TYPE clear;

old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
RMAN configuration parameters are successfully reset to default value

RMAN> show DEVICE TYPE;

RMAN configuration parameters for database with db_unique_name QA1CSMP are:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default

RMAN>

RMAN>

RMAN> show default DEVICE TYPE;

RMAN configuration parameters for database with db_unique_name QA1CSMP are:
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default

RMAN>

Now you will not get the error !!! Happy Days :)


ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE

I am trying to start the database in upgrade mode and received the error as below:

SQL> startup upgrade
ORACLE instance started.
Total System Global Area 3758096384 bytes
Fixed Size                  4503952 bytes
Variable Size            3103786608 bytes
Database Buffers          637534208 bytes
Redo Buffers               12271616 bytes
Database mounted.
ORA-01092: ORACLE instance terminated. Disconnection forced
ORA-39701: database must be mounted EXCLUSIVE for UPGRADE or DOWNGRADE
Process ID: 10523
Session ID: 2092 Serial number: 36861

SQL>

Cause:

The reason for getting this error message in my case was that I was trying to issue this command on RAC database which had two instances.

SQL> show parameter cluster_database
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
cluster_database                     boolean     TRUE
cluster_database_instances           integer     2
SQL>

Fix:

Just turn the database clustering off and try starting it again in upgrade mode

Start database as normal and alter the parameter as below:

SQL> alter system set cluster_database=FALSE scope=spfile sid='*' ;
System altered.
SQL>

Now shutdown the database and then try the startup upgrade

SQL> startup upgrade
ORACLE instance started.
Total System Global Area 3758096384 bytes
Fixed Size                  4503952 bytes
Variable Size            3003123312 bytes
Database Buffers          738197504 bytes
Redo Buffers               12271616 bytes
Database mounted.
Database opened.
SQL>




Tuesday, October 11, 2016

Hurray!!! about to hit 100,000 visitors mark

The blog was started with the intention that I would use this for my notes and share my learning with the word and it looks like that I am achieving the goal very well. So far my blog is able to attract about 100K clicks and I believe that these are 100K moments when someone got some sort of assistance from my blog.


Thanks for coming to my blog and giving me a opportunity to share my knowledge, experience and thought on databases and other technologies.

I have got a keen interest in mobile development and raspberry pi and from time to time I will keep on sharing information related to those areas as well.

This year I am trying to contribute maximum so far and planning to create the most posts compared to other years. I love your feedback and suggestions because those encourage me gives me direction to move ahead. Please keep on posting comments as that is one of the way I can interact with you guys.

Over the next year I would like to explore more on SQL Server, Big Data, MySQL and other databases.


Below are some of the statistics collected from Google Analytics over 6 years and those clearly shows what are the big markets for oracle database and related technologies and most of the search queries / sessions come from those top 5 countries. Based on the data I believe that oracle is very popular in US or may be people in US has more questions about oracle than any other country in the world. But I am glad to write that I was able to create an online information material which could have been a help to most of you.


I would like to state again that it will be great if you can please keep on commenting on my posts so that I can learn from your experiences as well and we all together can make the experiences more valuable and great for other community member.

I would be looking forward to achieve another 100K visits far quicker this time and I promise to keep on sharing my knowledge and experiences.


Friday, October 7, 2016

Manually configure target using emcli oracle 12c

If you want to use emcli and setup the target from command line then do the below:

Log in to OMS server in my case it is unix box and the go to OMS home and bin directory and in my case it is

/u01/app/oracle/product/oem12c/middleware1/oms/bin

then log in using sysman and do a sync

$ ./emcli login -username=sysman
Enter password :

Login successful

$ ./emcli sync
Synchronized successfully

$

after sync issue the command below to add each instance and then add it to the cluster.


$ ./emcli add_target -name=db2datp1 -type=oracle_database -host="host1" -credentials="UserName:dbsnmp;password:*********;Role:Normal" -properties="SID:db2datp1;Port:1521;OracleHome:/u01/app/oracle/product/12.1.0.2;MachineName:host1.example.com"

$ ./emcli add_target -name=db2datp2 -type=oracle_database -host="host2" -credentials="UserName:dbsnmp;password:*********;Role:Normal" -properties="SID:db2datp2;Port:1521;OracleHome:/u01/app/oracle/product/12.1.0.2;MachineName:host2.example.com"

$ ./emcli add_target -name="db2datp.example.com" -type="rac_database" -host="host1" -monitor_mode="1" -properties="ServiceName:db2dat_ha;ClusterName:rachost1" -instances="db2datp1:oracle_database;db2datp2:oracle_database"