Hi Chris,
I quickly searched the dxtoolkit documentation but could not find where it said it supported wildcards. I might have missed it though.
In practice, what I have seen customers do is run the commands in steps:
- Run one command, dump the results to a file (format with with grep/awk/etc).
- Run the second command and read the results from the file.
- Remove the temporary file.
You could do this in a single line of code. In this example, I just refresh VDBs with starting with YY:
% ./dx_get_db_env --engine neal6017 --type vdb | grep YY | awk '{print $3}' | while read -r line ; do
./dx_refresh_db --engine neal6017 -name $line
done
Starting job JOB-1251 for database YYA.
0 - 32 - 39 - 100
Job JOB-1251 finished with state: COMPLETED
Starting job JOB-1253 for database YYY.
0 - 32 - 39 - 100
Job JOB-1253 finished with state: COMPLETED
Starting job JOB-1255 for database YYZ.
0 - 36 - 39 - 100
Job JOB-1255 finished with state: COMPLETED
I hope this helps.
Thanks,
Neal
------------------------------
Neal Stack
Senior Principal Technical Support Engineer
Delphix
------------------------------
Original Message:
Sent: 03-09-2023 08:31:10 AM
From: Chris Patton
Subject: Dxtoolkit wildcard for -name for db refresh
Hello,
I'm trying to create a script that will refresh all VDBs with a similar name using a wildcard. I was hoping the below would work:
dx_refresh_db -d DXFANP01 -name purstg3_% -timestamp LATEST_SNAPSHOT
or
dx_refresh_db -d DXFANP01 -name purstg3_* -timestamp LATEST_SNAPSHOT
...where the VDBs are named like: purstg3_facets and purstg3_stgdata . But, the '%' and '*' are not working as expected. Any ideas?
------------------------------
Chris Patton
Database Adminstrator, Sr
CalOptima
------------------------------