cancel
Showing results for 
Search instead for 
Did you mean: 

Using IRCMD to start (modify/create) and stop databases from the command line

GeraldC
Hero

Using IRCMD to start (modify/create) and stop databases from the command line

This article provides a brief summary with some tips and examples for getting started. The IRCMD utility requires all operations (start, stop, list) to be defined in a text file that contains a definition (or name, for the 'list command') of the database. That text file can be written from scratch but it is easier to first create the database in the PROGNOSIS GUI and export it to a text file. The text file can then be modified to reconfigure the database or to start or stop the database. The following procedure is an example for a database called "TESTDB". (Note that this example uses Windows file and path names, but the same method is applicable for UNIX and NonStop platforms, with minor modifications to file and path names as appropriate for those platforms).

1. Create the database in the PROGNOSIS GUI, for this example called "TESTDB". Then start the database.

2. Create a text file that contains instructions to list the database. For example create a file called LISTDB.txt containing the following lines to list the database called "TESTDB":
LIST DBCOLLECT DB TESTDB

3. Running the command "IRCMD LISTDB.txt" would list the database to standard output. So to create a database text file called for example TestDB.txt would require the following command to redirect the output to the TestDB.txt file.
cd \Server\Configuration
..\IRCMD LISTDB.txt > TestDB.txt

4. To use the export output text file to start the database involves modifying the file as follows.
4a. First delete the following lines at the beginning of the file:
Prognosis Command-Line Utility
------------------------------
4b. Insert "START DBCOLLECT [database name]" at the beginning of the file. For example to start the "TESTDB" insert the following line at the beginning of the file.
START DBCOLLECT "TESTDB"
4c. Save the file and then run "IRCMD [text file]" such as in the following example command for the TestDB.
..\IRCMD TESTDB.txt
This should start the database with the configuration as it is in the text file - that is, how it was originally created in the GUI.

5. To modify the database simply edit the text file making the desired changes and then run it again with the above "IRCMD [text file]" command. To see details of any issues encountered during database start add "OPTION d" to the end of the command so that it would be
"..\IRCMD [text file] OPTION d"
. PROGNOSIS Online Help provides details of the IRCMD command for this purpose under: "System Guide -> PROGNOSIS User Interfaces -> Command Line Utilities -> IRCMD".

HTH