ug_ch8.htm
来自「db.* (pronounced dee-be star) is an adva」· HTM 代码 · 共 1,833 行 · 第 1/5 页
HTM
1,833 行
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta name="generator" content="HTML Tidy for Linux/x86 (vers 1 September 2005), see www.w3.org"><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"><meta name="Generator" content="Microsoft Word 97"><title>db.* User's Guide Chapter 8</title></head><body><h1><a name="ida" id="ida"></a>Chapter 8<br>Interactive Database Access Utility (ida)</h1><h2><a name="Utility" id="Utility"></a>8.1 The ida Utility</h2><p><font size="2">The Interactive Database Access utility(<b>ida</b>) is a tool for manipulating <b><i>db.*</i></b>databases. It is an easy-to-use, menu-driven utility that allowsyou to:</font></p><ul><li>Maintain an existing database</li><li>Access data stored in the database</li><li>Test a database design</li><li>Create and modify data</li><li>Learn to use <b><i>db.*</i></b></li></ul><p>The <b>ida</b> utility has been designed for applicationdevelopers and database administrators and therefore is notsuitable for most non-technical users.</p><h3><a name="Accessing" id="Accessing"></a>8.1.1 Accessing ida</h3><p><font size="2">To access the <b>ida</b> utility:</font></p><ol><li>Log in to your user account.</li><li>Use the <b>cd</b> command to change to the directory thatcontains the database dictionary file(<b><i><u>dbname</u></i>.dbd</b>) and the data and key files. (Forfurther information, see the note that follows thisprocedure.)</li><li>To access <b>ida</b>, enter the following:</li></ol><div style="margin-left: 4em"><pre><font color="#0000FF">ida <Enter></font></pre></div><ol start="4"><li><font size="2">When the <b>ida</b> title page appears, pressany key to bring up the <b>ida</b> main menu.</font></li></ol><blockquote>Note: Usually, <b>ida</b> should be executed fromwithin the file directory that contains the database dictionaryfile (<b>dbname.dbd</b>) and the data and key files. However, the<b>Parameters Dictionary_path</b> and <b>Parameters Files_path</b>commands can be used from the <b>Parameters</b> command menu tolocate the database files before opening the database.Alternatively, you can use the environment variables DBDPATH andDBFPATH to tell <b>ida</b> where the database files are located, oryou can check the <b>db.star.ini</b> file. See section 5.2.2,"Operational Environment," for a complete discussion of<b><i>db.*</i></b> path environment variables.</blockquote><h3><a name="Main" id="Main"></a>8.1.2 The ida Main Menu</h3><p><font size="2">Figure 8-1 shows the first <b>ida</b> menu,referred to as the main menu. This menu provides access to allother <b>ida</b> menus.</font></p><hr><div style="margin-left: 6em"><pre><font color="#0000FF">IDA - db.* Interactive Database Access Utility<b>Open</b> Access Initialize Close Parameters QuitOpen a db.* database</font></pre></div><hr><p align="center"><font size="2"><b>Fig. 8-1. ida MainMenu</b></font></p><p>All <b>ida</b> menus use the top three lines of each screen.Each menu includes the following:</p><table border="1" cellspacing="1" cellpadding="7" width="541"><tr><td width="18%" valign="top"><p><font size="2">1st line</font></p></td><td width="82%" valign="top"><p><font size="2">Menu title</font></p></td></tr><tr><td width="18%" valign="top"><p><font size="2">2nd line</font></p></td><td width="82%" valign="top"><p><font size="2">A list of available commands, one of which ishighlighted</font></p></td></tr><tr><td width="18%" valign="top"><p><font size="2">3rd line</font></p></td><td width="82%" valign="top"><p><font size="2">A description of the highlightedcommand</font></p></td></tr></table><p><font size="2">You can see what a command does by moving thehighlight to that command. When a command is highlighted, thedescription of that command appears on the 3rd line.</font></p><h4><a name="Highlight" id="Highlight"></a>Moving the Highlight ona Menu</h4><p><font size="2">To move the highlight on a menu:</font></p><ul><li>To the right, press either the <Space> or the <Tab>key.</li><li>To the left, press the <Backspace> key.</li></ul><p>To leave the <b>ida</b> utility, you use the <b>Quit</b> commandfrom the main menu. For more information about using the commandson the <b>ida</b> main menu, including the <b>Quit</b> command, seesection 8.2.</p><h3><a name="Concepts" id="Concepts"></a>8.1.3 Using ida: Conceptsand Procedures</h3><p><font size="2">This section describes the concepts andprocedures you will need in order to use the <b>ida</b> utility.These concepts and techniques include messages from <b>ida</b>,executing a command from an <b>ida</b> menu (from the 2nd line ofthe screen), choosing an option from a numbered list (displayedbelow the top three lines), moving the highlight on a numberedlist, opening a database, accessing a submenu, exiting a submenu,and selecting a record to modify.</font></p><h4><a name="Messages" id="Messages"></a>Messages from ida</h4><p><font size="2">The last two lines of an <b>ida</b> screen maydisplay a message from <b>ida.</b> A message may tell you that acommand has been completed or that there has been an input error ordatabase error. Messages are displayed in reverse video and requirepressing a key to return to the menu.</font></p><h4><a name="Command" id="Command"></a>Executing a Command from aMenu</h4><p><font size="2">To execute a command from a menu:</font></p><ul><li>Highlight the command and press <Enter>.<br>or</li><li>Type the first letter of the command.</li></ul><p>Executing a command from an <b>ida</b> menu invokes a submenu, anumbered list, an <b>ida</b>/<b><i>db.*</i></b> function, ordisplays information.</p><h4><a name="Option" id="Option"></a>Choosing an Option from aNumbered List</h4><p><font size="2">Following the execution of commands such as<b>Open</b>, <b>Scan</b>, and <b>Find</b>, a numbered list ofavailable databases, key fields, records, or sets will bedisplayed. The entry that was last selected will be highlighted or,initially, the first entry will be highlighted.</font></p><p>Figure 8-2 shows an example of a submenu that offers a numberedoption list.</p><hr><div style="margin-left: 6em"><pre><font color="#0000FF">Scan and view records based on database address<b>Scan</b> First Last Next Previous X_exitScan and view records based on database address<br>SELECT RECORD TYPE: 0. AUTHOR 1. INFO 2. BORROWER 3. INFOTEXT 4. KEY_WORD 5. INTERSECT 6. SYSTEM </font></pre></div><hr><p align="center"><font size="2"><b>Fig. 8-2. Example SelectionList</b></font></p><p>To choose an option from a numbered list do one of thefollowing:</p><ul><li>Type the number of the option and press <Enter>.<br>or</li><li>Using the procedure for moving the highlight on a numbered list(described below), highlight the option and press<Enter>.</li></ul><h4><a name="MovingHighlight" id="MovingHighlight"></a>Moving theHighlight on a Numbered List</h4><p><font size="2">When moving the highlight on a numbered list, youuse a different procedure than you do when you move the highlighton a menu.</font></p><p>To move the highlight on a numbered list:</p><ul><li>Down the list, type the <d> key.</li><li>Up the list, type the <u> key.</li></ul><p>Selection lists that extend beyond a single screen will eitherscroll or redisplay, depending on the position of the highlightedselection.</p><h4><a name="Opening" id="Opening"></a>Opening a Database</h4><p><font size="2">Although you can access <b>ida</b> and view themain menu, there is little you can do until you open a database.(You can execute the <b>Parameters</b> and <b>Quit</b> commands,but the <b>Access</b>, <b>Initialize</b>, and <b>Close</b> commandswill not work without an open database.) If you are new to<b>ida</b>, you can use the sample <b>tims</b> database (providedwith <b><i>db.*</i></b>) to learn any of the procedures describedin this chapter.</font></p><p>To open a database:</p><ol><li>From the <b>ida</b> main menu, highlight and execute the<b>Open</b> command.</li><li>On the <b>Open a <i>db.*</i> database</b> submenu, execute thecommand for the type of user access you want. (If you are justlearning to use <b>ida</b>, use the One_User command.)</li><li>From the <b>Select Database</b> list, choose the database youwant to open. When you choose a database, the list disappears.</li></ol><h4><a name="Submenu" id="Submenu"></a>Accessing a Submenu</h4><p><font size="2">To perform most database operations you will usethe <b>Access</b> command on the main menu. Selecting the Accesscommand displays the <b>Database Access Commands</b> submenu shownin Figure 8-3.</font></p><hr><pre><b><font color="#0000FF">Database Access Commands</font>Record Set Currency Transaction Lock Free Miscellaneous X_exit</b></pre><hr><p align="center"><b><font size="2">Fig. 8-3. Database AccessCommands Menu</font></b></p><h4><a name="Exiting" id="Exiting"></a>Exiting a Submenu</h4><p><font size="2">When you exit a submenu, you go back to theprevious menu. There are two ways to exit a submenu:</font></p><ul><li>On the 2nd line of the submenu, highlight the <b>X_exit</b>command and press <Enter>.<br>or</li><li>Press the <Esc> key.</li></ul><h4><a name="Selecting" id="Selecting"></a>Selecting a Record</h4><p><font size="2">Using <b>ida</b>, you can find a record by usingthe <b>Keyscan</b> command to find a keyword or you can use the<b>Recscan</b> command to find a record by using a databaseaddress. The following procedure uses the <b>Recscan</b>command.</font></p><p>To select a record using <b>Recscan</b>:</p><ol><li>Access the <b>Database Access Commands</b> submenu (shown inFigure 8-3).</li><li>From that menu, highlight and execute the <b>Record</b>command.</li></ol><blockquote style="MARGIN-RIGHT: 0px"><p>The <b>Record Manipulation Functions</b> submenu displays (shownin Figure 8-4).</p></blockquote><hr><div style="margin-left: 4em"><pre><b><font color="#0000FF">Record Manipulation Functions</font>Keyscan Get Enter Modify Delete Recscan X_exitScan and view records based on key</b></pre></div><hr><p align="center"><font size="2"><b>Fig. 8-4. Record ManipulationFunctions Menu</b></font></p><ol start="3"><li>From the <b>Record Manipulation Functions</b> submenu,highlight and execute the <b>Recscan</b> command.</li></ol><blockquote style="MARGIN-RIGHT: 0px"><p>The Scan and view records based on database address submenuappears (shown in Figure 8-2).</p></blockquote><div style="margin-left: 4em"><p> </p></div><ol start="4"><li>From the <b>Scan and view records based on database address</b>submenu, highlight and execute the <b>Scan</b> command.</li><li>A numbered list titled <b>SELECT RECORD TYPE</b> displays. Typethe number of the record type you want to select.</li></ol><blockquote style="MARGIN-RIGHT: 0px"><p>The <b>Scan and View Records</b> submenu appears and displays arecord (shown in Figure 8-5).</p></blockquote><hr><div style="margin-left: 6em"><pre><b><font color="#0000FF">Scan and View Records</font>Next First Select X_exitDisplay next page of records<br>RECORD: AUTHOR Page: 1<br>RECORD CONTENTS: 1. {"Martin, James"} 2. {"Myers, G."} 3. {"Teorey T. & Fry, J."} </b></pre></div><hr><p align="center"><font size="2"><b>Fig. 8-5. Scan and View RecordsMenu</b></font></p><ol start="6"><li>Highlight and enter the <b>Select</b> command. The highlightwill move to the numbered list.</li><li>Choose an option from the numbered list. The record will bedisplayed in the <b>ida</b> screen</li></ol><p><b><font face="Helvetica" size="4"><a name="UsingMain" id="UsingMain"></a>8.2 Using the Main Menu Commands</font></b></p><p><font size="2">This section describes the commands on the<b>ida</b> main menu, shown in Figure 8-1. For instructions onusing the main menu to execute commands and access submenus, seesection 8.1.2.</font></p><h4>Open command</h4><p><font size="2">The <b>Open</b> command opens a database. Ifanother database is currently open, it will first be closed. Afterselecting the <b>Open</b> command, you must choose the One_User,Shared, or Exclusive access option from the displayed submenu. Alist of the databases contained in the current (or DBDPATH)directory is then displayed. From this list you can select thedatabase to be opened.</font></p><h4>Access command</h4><p><font size="2">The <b>Access</b> command brings up the<b>Database Access Commands</b> submenu, which provides a set offunctions and submenus for manipulating a particular database. Thismenu, described in section 8.4 includes record functions, setfunctions, currency functions, transaction functions, and lockfunctions. The <b>Access</b> command may only be called after adatabase has been opened.</font></p><h4>Initialize command</h4><p><font size="2">This command, which corresponds to the<b>d_initialize</b> function, initializes the opened<b><i>db.*</i></b> database. This command should only be used aftera database has been opened for exclusive access. It will destroythe contents of the database.</font></p><h4>Close command</h4><p><font size="2">The <b>Close</b> command closes an openeddatabase immediately.</font></p><h4>Parameters command</h4><p><font size="2">Executing the <b>Parameters</b> command accessesthe <b>Set db.* Operational Parameters</b> submenu. It alsodisplays the current <b>ida</b> operational settings.</font></p><p>The <b>Set db.* Operational Parameters</b> submenu is shown inFigure 8-6, followed by a description of each of its commands.These commands are used to change the <b><i>db.*</i></b> settingsand cannot be used when a database is open.</p><hr><pre><b><font color="#0000FF">Set db.* Operational Parameters</font>Dictionary_path Files_path Userid Pages Max_files Logging Chain X_exit</b></pre><hr><p align="center"><font size="2"><b>Fig. 8-6. Set <i>db.*</i>Operational Parameters Submenu</b></font></p><p>Dictionary_path<br>Sets the DBDPATH environment variable, which identifies the fulldirectory path to the <b>.dbd</b> file for the database to beaccessed.</p><p>Files_path<br>Sets the DBFPATH environment variable, which identifies the fulldirectory path to the data and key files for the databases to beaccessed.</p><p>Userid<br>Sets the user ID. If you do not have the DBUSERID environmentvariable defined, you must use this command before opening thedatabase in shared mode through <b>ida</b>.</p>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?