Query nodes that is locked

TaSMania

ADSM.ORG Member
Joined
Nov 17, 2015
Messages
126
Reaction score
1
Points
0
PREDATAR Control23

How do I query for nodes that are locked or not locked?
under Table = Nodes, there is Locked
There's no "locked" info in the admin reference guide.
Tried:
Code:
 Query Node MYNODE locked='no' f=d
Doesn't work. What's another option for querying decom'ed nodes?
 
PREDATAR Control23

How do I query for nodes that are locked or not locked?
under Table = Nodes, there is Locked
There's no "locked" info in the admin reference guide.
Tried:
Code:
 Query Node MYNODE locked='no' f=d
Doesn't work. What's another option for querying decom'ed nodes?
First, not all locked nodes are decommissioned, but all decommissioned nodes are locked. So checking the locked status is not a good approach to determine if a node is decommissioned.

If you still want to look at locked nodes, use:
select node_name from nodes where locked='YES'

If you want to look at decommissioned nodes, use:
select node_name,decomm_date from nodes where decomm_state='YES'
 
PREDATAR Control23

oh I have to run sql statement and I don't have to:
Code:
 select locked from nodes?
I was going to add to my previous select statement for nodes with no backup or access for over 30 days that is NOT decom that's why I use locked='NO'
 
PREDATAR Control23

Sorry, you meant not locked. Just change YES to NO in my queries.
 
PREDATAR Control23

Thanks you so much.
Now, how would I query for the opposite? Where decomm_state is n/a. Tried below and it doesn't work.
decomm_state='no'
decomm_state=''
decomm_state=' '
decomm_state<>'YES'

First, not all locked nodes are decommissioned, but all decommissioned nodes
If you want to look at decommissioned nodes, use:
select node_name,decomm_date from nodes where decomm_state='YES'
 
PREDATAR Control23

Try this.

Code:
select node_name from nodes where decomm_state is null

Thanks you so much.
Now, how would I query for the opposite? Where decomm_state is n/a. Tried below and it doesn't work.
decomm_state='no'
decomm_state=''
decomm_state=' '
decomm_state<>'YES'
 
PREDATAR Control23

Keep finding myself back to this thread.
I want to query nodes that hasn't been access over 30 days that are not decom.
So I was at thobias.org/tsm/sql

I want to put to statement together.
1. List of nodes that have not accessed the tsm server in the last 30 days
Code:
SELECT node_name, TO_CHAR(lastacc_time,'YYYY-MM-DD HH24:MI') as "lastacc_time" FROM -
  nodes WHERE DAYS(current_date)-DAYS(lastacc_time)>30
2. List of nodes not locked.
Code:
SELECT node_name FROM nodes WHERE locked not like 'YES'

I'd realized when i ran the #1 Query some of the nodes lastacc_time show a date from yesterday. Why?
Once I know the reason why, I will add #2 to the end of #1 with 'and locked not like 'YES' '
 
Top