TimeBase Repair Shop is a web application for diagnosing and fixing database problems. Repair Shop identifies a wide range of issues, ranging from tune-up recommendations to a potential database corruption. User can proceed with recommended resolutions once issues have been identified.
TimeBase offers two ways of running a Repair Shop:
tbrepscript form the
\binto open a Repair Shop web console.
tbrepshellscript form the
\binto open a Repair Shop CLI.
Repair Shop Console
Opening a TimeBase Folder
On start-up, Repair Shop immediately prompts the user to select and open a TimeBase folder. Typically, the TimeBase folder is a sub-folder of QuantServer home, called tickdb. Other folders at this level are called config, logs and services. The TimeBase folder is identified in the Open dialog by a “database” icon.
After you open a TimeBase folder, you will see the database icon in the main area of the window. This mode is called Database Tree Mode. However, right after opening a database, you see only one node in the tree. This is because Repair Shop does not scan the database structure automatically. If you want to diagnose and/or repair the entire database, there is no need to scan the structure separately. Note, that the database root node is pre-selected and you can proceed directly with the
Full Scan command. However, if you would like to troubleshoot only a part of a database structure, you will need to click the
Scan Structure command in order to display all database components. Launching the
Scan Structure command will put the Repair Shop in
Task Mode, which is described below. After the structure scan is completed, select Return, and you will return to the Database Tree Mode, with the full database structure displayed in the tree.
The five levels of the database tree represent (see attached picture for reference):
- At the root level, the entire logical database instance.
- Under the root, the database folder, or a number of folders, if the database has been distributed to multiple locations.
- Under the database folder, one or more physical stream folders.
- Under the stream folder, the logical stream object.
- And, finally, under the stream object, a number of M-Files (each occupying a pair of physical files)
Scanning for Problems
Not only does the database tree give you visual representation of the database structure, but, more importantly, it allows you to select a subset of the database, such as a stream, or an M-File, or any combination of streams and M-Files, to be diagnosed and repaired.
For example, you may have a multi-terabyte database, but you only want to diagnose one particular stream, which you suspect is having problems, or requires tuning.
In that case:
- Open the database
- Click Scan Structure
- Address any issues diagnosed during the scan
- Select the desired stream in the tree
- Proceed with Full Scan
After you click Full Scan, the Repair Shop enters a so-called Task Mode. In a Task Mode, the top portion of the window represents a list of executing tasks, while at the bottom there is a list of diagnostics and optional reports - see attached picture. Click Stop to interrupt the process at any time.
At the end of a perfect diagnostic run, all tasks are green, and there are no warnings in the diagnostic window. You can re-run the diagnostic process after it completes, or return to the Database Tree Mode.
Diagnostics are displayed in the bottom screen if any issues have been detected. Click any diagnostic to get a detailed information in the details screen. It is normal for some (not all of them) diagnostics to have resolutions displayed in the Action column. A single effect or a combination of effects can produce multiple diagnostics, but only one will carry a repair action. For example, on the attached picture, the Missing Index diagnostic is not associated with any resolution, but it is immediately followed by an Unindexed Data message, carrying the Rebuild index action.
Resolve after carefully reviewing the suggested actions to proceed with repairing.
Alternatively, you can restore the database from the backup and fix issues manually.
For example, Repair Shop suggests removing any unrecognized file in the database folders. If you recognize a valuable file that has been accidentally stored into the TimeBase folder, you might want to intervene manually and move it out, rather than having the tool proceed with removing the file.
When you click
Resolve, the task list is re-initialized with new tasks, corresponding to the resolution actions. The tasks are executed, and any additional issues are again diagnosed. You cannot re-run resolution tasks, because they modify data. After the resolution process has completed, you can return to the Database Tree Mode and either exit the tool, or re-scan the database to make sure it is completely clean.
Scan and Repair Options
There are a few options to the right of the command buttons on the tool bar, which control the diagnostic and repair process:
Normally, the Full Scan command only reads and does not modify anything. However, if desired, you can check the Rebuild Indexes box and the Repair Shop will automatically rebuild all indexes when scanning data. The cost of rebuilding indexes is fairly small, if the data has to be scanned anyway. Check this option when you suspect massive problems with index files, or when it is suggested so by a customer support representative.
Checking this option will cause the Repair Shop to immediately execute all suggested resolutions. Check this option only if you expect the scan process to take a long time and you are absolutely certain that you will want to execute all repair options suggested by the Repair Shop.
Check Message Content
Checking this to check message fields for incorrect encodings and/or constraint violations.
Check this option to generate a report with time range, number of messages, and index characteristics for every M-File. When this option is checked, an additional tab appears in the lower part of the Task Mode view - see the attached picture for reference.
Repair Shop CLI
tbrepshell script form the
\bin to open a Repair Shop CLI.
open <folder> Open TimeBase to manipulate. Folder should be exactly folder of TimeBase, not QS_HOME. Usually it's QS_HOME/tickdb. scan Scan and print structure of TimeBase. scan full Scan and check the health of all elements of TimeBase. scan stream <stream> Scan and check the health of the specified stream. scan mfile <stream>/<mfile> Scan and check the health of the specified MFile of the specified stream. resolve Fix if possible all problems found by last 'scan full|stream|mfile' command. show Print structure of the current TimeBase and last scan diagnostics. show db The same as the 'show' command. show report Prints the last detailed report of the 'scan full|stream|mfile' command. set rebuildIndexes true|false false by default. When set to true, the command 'scan full|stream|mfile' will rebuild the indexes. set ri true|false The same as "set rebuildIndexes". set checkContent true|false false by default. When set to true, the command 'scan full|stream|mfile' will check content of messages. set cc true|false The same as "set checkContent". set autoResolve true|false false by default. When set to true, the command 'scan full|stream|mfile' will automatically try to resolve found problems. set ar true|false The same as "set autoResolve". set detailedReport true|false false by default. When set to true, the command 'scan full|stream|mfile' will prepare detailed report. set dr true|false The same as "set detailedReport". # Examples open /home/user/QS_HOME_A/tickdb scan stream securities scan mfile securities/0000