06-17-2019 11:41 PM
Does someone know a command to get the media serial number ? (not barcode as that can be changed)
Have found this old tech note: https://www.veritas.com/content/support/en_US/article.100027311.html
where it seem that netbackup stores the information in the EMM DB.
Have played aorund with nbemmcmd, but without luck so far.
06-18-2019 12:00 AM - edited 06-18-2019 12:01 AM
It's one of the fields in the EMM_Media table.
If it doesn't appear in nbemmcmd -listmedia output then it's not a field you will get from any other command.
The only way to get it is to loook in the DB directly ...
Search forward for INPUT INTO "EMM_MAIN"."EMM_Media"
You should see something like this
INPUT INTO "EMM_MAIN"."EMM_Media"
ESCAPE CHARACTER '\\'
BY ORDER("MediaKey","DriveKey","MediaGuid","MediaId","PartnerKey" <snip>
You can see the .dat file name for that table (it differs betwwen NBU releases) - the bottom line which I have <snipped> as it is long, shows the fields of the table in the correct order, so field 1 isMediaKey, field 2 is DriveKey and so on ...
The 64th field at the version of NBU I have
64 ,"SerialNumber" varchar(32) NOT NULL DEFAULT ''
You could also search the reload.sql file for : CREATE TABLE "EMM_MAIN"."EMM_Media"
CREATE TABLE "EMM_MAIN"."EMM_Media" (
"MediaKey" unsigned int NOT NULL DEFAULT autoincrement CONSTRAINT "CKC_MEDIAKEY_EMM_MEDI" check("MediaKey
" >= 4000001)
,"DriveKey" unsigned int NOT NULL DEFAULT 0
,"MediaGuid" binary(16) NOT NULL DEFAULT "NEWID"()
,"MediaId" varchar(32) NOT NULL
,"PartnerKey" unsigned int NOT NULL DEFAULT 0
,"PartnerId" varchar(32) NOT NULL DEFAULT ''
,"LegacyMediaType" integer NOT NULL DEFAULT -1
,"MediaTypeName" varchar(64) NOT NULL DEFAULT ''
,"MediaGroupName" varchar(128) NOT NULL
,"DensityName" varchar(32) NOT NULL DEFAULT ''
,"DensityCode" binary(8) NOT NULL DEFAULT 0
,"VerificationFlag" integer NOT NULL DEFAULT 0
,"AssignedAppType" integer NOT NULL DEFAULT 0
,"MediaFlags" integer NOT NULL DEFAULT 0
,"MediaTypeFlags" integer NOT NULL DEFAULT 0
This gives a list of the fields in a easier to read format, but you still need to search to confirm the .dat file name for the table.
06-18-2019 01:51 AM
Thanks, that is something work out from.
Too bad I can't do a select of mediaid and serial number directly on the table in the database.
06-18-2019 04:21 AM
Ended up with using nbdb_load -t EMM_media to limit the output to the relevant table.
Then is just using a script language to pull out the wanted information from the dat file.
06-18-2019 11:29 PM
ahh yes, good thinking, regarding the -t <table option>.
Just be aware that between different NBU versions the .dat files can change, and although perhaps less likely, at least for the EMM_Media table, the fileds can change as well. Not a massive deal, you just have to check and adjust your script if you upgrade.