Cadet 1st Class Cadet 1st Class
Cadet 1st Class
141 views

How to delete node from database

Hi,

 

Using HPOV 8.1 on solaris.

 

I am seeing many message like "Node aaa.bbb.com is not in the node bank.But it will remain in the opc_node_names DB table because it is still referenced by other tables. (OpC50-300).

 

When I am seeing this in database one NODE_ID is associated with it. 

 

Please tell me how can I go further to remove this node from all table sothat it shoudl not reference to current nodes.

 

THanks

0 Likes
2 Replies
Absent Member.. Absent Member..
Absent Member..

Hello Rubygarg,

 

Here is the procedure:
The correct way for deleting a node from within OMU is as follows:

Modify all templates that reference the node that will be deleted.
Delete applications that reference the node that will be deleted.
Acknowledge all messages for the node that will be deleted.
Note:  When deleting this node, also acknowledge the
messages, but only if the messages are not matched by an
 external node.
Use the GUI to delete the node.
Perform a history download:
/opt/OV/bin/OpC/opchistdwn -older 0s -file
Call the 'opcdbidx' utility to remove unused opc_node_names entries:
/opt/OV/bin/OpC/opcdbidx -orphan
Check to see if the 'opc_node_names' entry still exists.
If the 'opc_node_names' entry does not exist:
          A.  Add the node again.

          B.  Repeat procedure.

          C.  Check for applications and templates.


Here is a list of the tables that could still contain entries for deleted nodes (Verify the accuracy of the table names in "Reporting and Database Schema " and/or "Database Entity Relationship Diagrams" before proceeding!) :

opc_op.opc_node_names

opc_op.opc_nodehier_layout

opc_op.opc_nodes

opc_op.opc_nodes_in_group

opc_op.opc_node_config

Below is how one would go about the SQL statements if the entries were to be removed manually.
This is an unsupported procedure, back up the Database as inconsistencies can result from these statements!
Please talk with a DBA before proceeding!


******************
FIRST EXAMPLE
******************
In this example, the node "nodename.domain.com" will manually be removed from the DB:

===============================================
1- FIND THE NODE ID for nodename.domain.com :
===============================================

SQL> select node_id,node_name from opc_op.opc_node_names
  2  where node_name ='nodename.domain.com';

NODE_ID
--------------
NODE_NAME
--------------
d0d51180-6965-71d4-172b-0f11bb100000
nodename.domain.com

===============================================
2-DELETE the references from the tables :
===============================================
SQL> delete from opc_op.opc_node_names
  2  where node_id like 'd0d51180-6965-71d4-172b-0f11bb100000'
  3  ;

1 row deleted.


SQL> delete from opc_op.opc_nodehier_layout
  2  where node_id like 'd0d51180-6965-71d4-172b-0f11bb100000'
  3  ;

2 rows deleted.

SQL>

SQL> delete from opc_op.opc_nodes
  2  where node_id like 'd0d51180-6965-71d4-172b-0f11bb100000'
  3  ;

1 row deleted.

SQL>

SQL> delete from opc_op.opc_nodes_in_group
  2  where node_id like 'd0d51180-6965-71d4-172b-0f11bb100000'
  3  ;

0 rows deleted.

SQL> delete from opc_op.opc_node_config
  2  where node_id like 'd0d51180-6965-71d4-172b-0f11bb100000'
  3  ;

0 rows deleted.


**************
SECOND EXAMPLE
**************
In this example, the node "node_name1" will be removed from the DB:

===============================================
HERE ARE THE COMMANDS TYPED
===============================================

select node_id,node_name from opc_op.opc_node_names
where node_name like 'node_name1%';

delete from opc_op.opc_node_names where node_id like
'6a5fcf64-50dc-71d3-1fcf-0f11bb100000';

delete from opc_op.opc_nodehier_layout where node_id like
'6a5fcf64-50dc-71d3-1fcf-0f11bb100000';

delete from opc_op.opc_nodes where node_id like
'6a5fcf64-50dc-71d3-1fcf-0f11bb100000';

delete from opc_op.opc_nodes_in_group where node_id like
'6a5fcf64-50dc-71d3-1fcf-0f11bb100000';

delete from opc_op.opc_node_config where node_id like
'6a5fcf64-50dc-71d3-1fcf-0f11bb100000';

===============================================
HERE IS THE COMPLETE OUTPUT
===============================================

SQL*Plus: Release 8.0.5.0.0 - Production on Wed Jun 6 14:55:40 2001

(c) Copyright 1998 Oracle Corporation.  All rights reserved.


Connected to:
Oracle8 Enterprise Edition Release 8.0.5.0.0 - Production
With the Partitioning and Objects options
PL/SQL Release 8.0.5.0.0 - Production

SQL> select node_id,node_name from opc_op.opc_node_names
  2  where node_name like 'node_name1%';

NODE_ID
------------------------------------
NODE_NAME
----------------------------------------------------------------------------
----
6a5fcf64-50dc-71d3-1fcf-0f11bb100000
node_name1.atl.hp.com


SQL> delete from opc_op.opc_node_names where node_id like
'6a5fcf64-50dc-71d3-1f
cf-0f11bb100000';

1 row deleted.

SQL> delete from opc_op.opc_nodehier_layout where node_id like
'6a5fcf64-50dc-71
d3-1fcf-0f11bb100000';

2 rows deleted.

SQL> delete from opc_op.opc_nodes where node_id like
'6a5fcf64-50dc-71d3-1fcf-0f
11bb100000';

1 row deleted.

SQL> delete from opc_op.opc_nodes_in_group where node_id like
'6a5fcf64-50dc-71d
3-1fcf-0f11bb100000';

0 rows deleted.

SQL> delete from opc_op.opc_node_config where node_id like
'6a5fcf64-50dc-71d3-1
fcf-0f11bb100000';

0 rows deleted.

SQL>exit

HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
If you liked it I would appreciate KUDOs.
Micro Focus Expert
Micro Focus Expert

Hello,

 

The best way to find where an entry in opc_node_names is still referenced is the node reference report:

# call_sqlplus.sh node_ref

 

For example this will be the output if there is still a history message for the deleted node fichte:


Node name                      Object type                  Entity name or ID                    Subentity name
------------------------------ ---------------------------- ------------------------------------ --------------------
fichte.deu.hp.com              Message node                 01916b72-d4da-71e3-1591-104d20090000

 

In this case, you could download all the history messages or specifically delete the message with ID

01916b72-d4da-71e3-1591-104d20090000 using opcdelmsg.

 

 

Please note, that manually deleting entries in the database is not supported.

If you miss a table, you may create a database inconsistency, which can lead

to the server processes not being able to start or opccfgdwn failing.

 

Best regards,

Tobias

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.