About Me

My photo
Bangalore, India
I am an Oracle Certified Professional working in SAP Labs. Everything written on my blog has been tested on my local environment, Please test before implementing or running in production. You can contact me at amit.rath0708@gmail.com.

Friday, April 3, 2015

ERROR-Agent is blocked. Blocked reason is: Agent is out-of-sync with repository

Yesterday I faced Below error when I was trying to upload agent :-

hostname:agent:AGENT_HOME/bin> ./emctl upload
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD upload error: uploadXMLFiles skipped :: OMS version not checked yet. If this issue persists check trace files for ping to OMS

hostname:agent:AGENT_HOME/bin> ./emctl pingOMS
Oracle Enterprise Manager 11g Release 1 Grid Control 11.1.0.1.0
Copyright (c) 1996, 2010 Oracle Corporation.  All rights reserved.
---------------------------------------------------------------
EMD pingOMS error: Invalid ping response "ERROR-Agent is blocked. Blocked reason is: Agent is out-of-sync with repository. This mos reinstalled or recovered. Please contact an EM administrator to unblock the agent by performing an agent resync from the console. P nblock the agent"

Solution :-

Login to Problamatic agent :-

1. Stop the agent :-

AGENT_HOME/BIN> ./emctl stop agent 

2. Secure the agent which will generate a new key :-

AGENT_HOME/BIN> ./emctl secure agent 

3. Start the agent: 

AGENT_HOME/BIN> ./emctl start agent 

4. Login to the OEM Grid Console :-

Navigate to Setup >> Agents >> problematic agent home page >> Click on Agent resynchronization

Once synchronization completed.

5. Try to ping OMS

AGENT_HOME/BIN> ./emctl pingOMS

6. Once Ping Successful . Try to upload the agent

AGENT_HOME/BIN> ./emctl upload 

Agent is now sync with repository

I hope this article helped you.

Thanks
Amit Rath

Wednesday, March 18, 2015

NID-00120: Database should be mounted exclusively

Today I was trying to change DBID ad DBNAME of my RAC database ad got below error :-

==>nid target=/ DBNAME=RASTAND

DBNEWID: Release 11.2.0.4.0 - Production on Wed Mar 18 12:18:32 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to database AMIT(DBID=2971225332)

NID-00120: Database should be mounted exclusively

Change of database name failed during validation - database is intact.
DBNEWID - Completed with validation errors.

Solution :-

To change DBId and Database Name of a RAC database , we need to set cluster_database parameter to false and Database should be mounted in One node.

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

System altered.

SQL> shu immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.

Total System Global Area 1060585472 bytes
Fixed Size                  2260000 bytes
Variable Size             817890272 bytes
Database Buffers          230686720 bytes
Redo Buffers                9748480 bytes
Database mounted.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, Oracle Label Security,
OLAP, Data Mining and Real Application Testing options
[server][oracle][RASTAND1]
/usr/local/oracle$
==>nid target=/ DBNAME=RASTAND

DBNEWID: Release 11.2.0.4.0 - Production on Wed Mar 18 12:28:23 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to database AMIT (DBID=2971225332)

Connected to server version 11.2.0

Control Files in database:
    +DATA_0220/rastand/controlfile/control01.ctl
    +FRA_0220/rastand/controlfile/control02.ctl

Change database ID and database name AMIT to RASTAND? (Y/[N]) => Y

Proceeding with operation
Changing database ID from 2971225332 to 3013823719
Changing database name from AMIT to RASTAND
    Control File +DATA_0220/rastand/controlfile/control01.ctl - modified
    Control File +FRA_0220/rastand/controlfile/control02.ctl - modified
    Datafile +DATA_0220/rastand/system01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/sysaux01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/undotbs1.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/undotbs2.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/users_1.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/ts_aud01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/data01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/idx01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/arch01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/test_01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/amit_01.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/amit_02.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/amit_03.db - dbid changed, wrote new name
    Datafile +DATA_0220/rastand/temp01.db - dbid changed, wrote new name
    Control File +DATA_0220/rastand/controlfile/control01.ctl - dbid changed, wrote new name
    Control File +FRA_0220/rastand/controlfile/control02.ctl - dbid changed, wrote new name
    Instance shut down

Database name changed to RASTAND.
Modify parameter file and generate a new password file before restarting.
Database ID for database RASTAND changed to 3013823719.
All previous backups and archived redo logs for this database are unusable.
Database is not aware of previous backups and archived logs in Recovery Area.
Database has been shutdown, open database with RESETLOGS option.
Succesfully changed database name and ID.
DBNEWID - Completed succesfully.

DBID chaged successfully in RAC database

I hope this article helped you.

Regards,
Amit Rath