此内容没有您所选择的语言版本。
Chapter 5. Record Session Commands in a File
In this section you will learn how to use the VDB Builder CLI to record your session commands for later playback. You can use the command file to fully script the construction of your VDBs.
The recorded output is saved to a file specified in the VDB Builder’s global properties configuration file (RECORDING_FILE). In the example below, the output is written to ./mySession.txt:
Figure 5.1. Code sample
Explanation of the Commands Used in this Example
- list
- shows all children at the CLI workspace context. (The workspace in this example initially contains no VDBs.)
- show-global
- shows the VDB Builder global constants. One of the constants specifies the recording output file (RECORDING_FILE).
- set-global RECORDING_FILE ./mySession.txt
- this changes the name of the file where our session commands will be saved.
- set-record on
- starts recording all subsequent commands.
- create-vdb SampleVDB
- creates the VDB called SampleVDB.
- cd SampleVDB
- navigates into the SampleVDB directory.
- add-model Model1
- adds a model called Model1.
- cd Model1
- navigates into Model1.
- add-table Table1
- adds a table called Table1
- cd Table1
- navigates into Table1.
- add-column Col1
- adds a column called Col1.
- add-column Col2
- adds a column called Col2.
- workspace
- navigates to the workspace context.
- set-record off
- tells the system to stop recording commands.
This is what the recording looks like:
Figure 5.2. Code sample