SQL query to return the servername

eRogue

ADSM.ORG Member
Joined
Jul 21, 2008
Messages
27
Reaction score
0
Points
0
Location
Toronto
PREDATAR Control23

Does anyone knows how you can find out the servername using a select query ? I can't find any table containg it....
 
PREDATAR Control23

The status table contains the server name.
 
PREDATAR Control23

select server_name from servers

Thx moon-buddy, however, that will return all the servers that i have configured along with any lanfree clients. What i need is just the servername where the command is run...
 
PREDATAR Control23

Does anyone knows how you can find out the servername using a select query ? I can't find any table containg it....

Actually
>select server_name from status
getting many lines because there is one status for every node so output will like
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1

etc depending how many nodes are there ....
so correct one is
SELECT distinct(server_name) from status
and answer will be

SERVER_NAME
---------------------------------------------------------------------------------------------------------------------------------
tsm_inst1
 
PREDATAR Control23

so useful query could be :
Protect: TSM_INST1>SELECT distinct(status.SERVER_NAME),CAST(FLOAT(SUM(auditocc.BACKUP_MB))/1024/1024 as DEC (8,1)) as TB from STATUS,auditocc group by status.SERVER_NAME

SERVER_NAME TB
--------------------------------------------------------------------------------------------------------------------------------- -----------
TSM_INST1 ---------------------------------------------- 5599.0
 
PREDATAR Control23

Actually
>select server_name from status
getting many lines because there is one status for every node so output will like
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1
tsm_inst1

etc depending how many nodes are there ....
so correct one is
SELECT distinct(server_name) from status
and answer will be

SERVER_NAME
---------------------------------------------------------------------------------------------------------------------------------
tsm_inst1
This sounds odd. There should only be 1 row in the status table.

Code:
Protect: SERVER1>select count(*) from status

  Unnamed[1]
------------
           1
 
Top