## 22.5.3 Commonly used disaster recovery queries 

Note:  For more information about using the ptcli tool, see the command-line interface topic in IBM System Storage TS7600 with ProtecTIER Version 3.3 , SG24-7968. 

The following list describes several commonly used DR queries that you can run: 

GLYPH<SM590000> To create a snapshot of the current replication status, run the following command: 

./ptcli InventoryRefresh --ip xxx.xxx.xxx.xxx -login file 

Important:  Creating a snapshot must be done before you run any other queries. Before you begin to filter the cartridges or to move cartridges by using the CLI, you must create a snapshot of the cartridges by running InventoryRefresh . This snapshot captures the current properties of all cartridges. Any filter or move operation is run based on the content of the snapshot. Moving a cartridge before you create a snapshot might fail if the snapshot is not up-to-date (not taken directly before the move). 

GLYPH<SM590000> To list all in-sync cartridges, run the following command: 

./ptcli InventoryFilter --ip xxx.xxx.xxx.xxx --querytype replica --query “in_sync = true” –login file –output /tmp/not_dirty_carts 

GLYPH<SM590000> To list all unsynchronized cartridges marked with dirty bit, run the following command: 

./ptcli InventoryFilter --ip xxx.xxx.xxx.xxx --querytype replica --query "in_sync = false" -login file -output /tmp/dirty_carts 

GLYPH<SM590000> To list cartridges synchronized with the destination at a certain time range on the source, run the following command: 

./ptcli InventoryFilter --ip xxx.xxx.xxx.xxx --querytype replica --query "source_time_for_last_sync_point > datetime(?2009-11-13 08:00:00')" -login file 

GLYPH<SM590000> To list all cartridges that are replicated to repository 18 in grid 1, run the following command: 

./ptcli InventoryFilter --ip xxx.xxx.xxx.xxx --querytype origin --query "destination_repository_id = 18 and destination_grid_id = 1" -login file 

GLYPH<SM590000> To list all cartridges in bar code range BR0300 - BR0330, run the following command: 

./ptcli InventoryFilter --ip xxx.xxx.xxx.xxx --querytype all --query "bar code > BR0300 and bar code < BR0330" -login file -output barcodes_file 

GLYPH<SM590000> To move all synchronized cartridges to the shelf, run the following command: 

./ptcli InventoryMoveFilter --ip xxx.xxx.xxx.xxx --querytype replica --query "in_sync = true" -destination shelf -login file 

## 22.5.4 Returning to normal operations 

This section explains the meaning of failback and failback policy, and provides the steps for using the ProtecTIER Manager failback wizard. 

## Failback 

Failback is the procedure for returning visibility to the primary site and replicating any new data that is created at the DR site to the original (or replaced) primary repository. You use failback to return to the original working mode of the primary site. 

