Sybase provides a validation utility called snrfck that lets you validate the format of the service name redirection file.
The snrfck basic command requires only the -i option. When you use this option, snrfck reads the redirection file, validates each line, and flags the first incorrect line it encounters.
For example, suppose you enter:
snrfck -ic:\cfg\testfile
where:
cfg is the directory containing the service name redirection file.
testfile is the service name redirection file.
The path cfg\testfile is shown as a PC-based system in this example and in the remainder of the examples in this chapter.
Next, assume the redirection file contains the entries shown in the following table:
In this example, snrfck returns:
c:\cfg\testfile: line3: duplicate/ambiguous row
If the file does not contain errors, the rows are sorted in the order used in the redirection operation and printed to the current window.
The following table shows an example of a correctly formatted access service name redirection file, as output by snrfck. The snrfck utility adds line numbers for clarity.
You can test the redirection process by supplying values for requested_service, user_id, and application_name, subject to the following restrictions:
You must specify values for user_id and application_name.
You can use a null argument for requested_service to allow matching on a null service.
When you supply these values, snrfck displays the sorted entries and the assigned service to which the request would be directed.
For example, suppose you use the preceding sample file and enter the following:
snrfck -itestfile -Sdb2 -Ujane -Aisql
where:
db2 is the requested service.
jane is the user ID.
isql is the application name.
You receive the match shown in the following table:
The following is displayed:
assigned service for (db2,jane,isql): svc_db2b
If the service redirection comparison does not find a match, the value returned for assigned_service is simply the requested_service value.
For example, suppose you use the preceding sample file and enter:
snrfck -itestfile -Sdb2 -Uramon -Aisql
where:
db2 is the requested service.
ramon is the user ID.
isql is the application name.
You receive the failed entry match shown in the following table:
The following is displayed:
assigned service for (db2,jane,isql): svc_db2b
You can add lines to the service name redirection file list by specifying the -t option.
When you use this option, snrfck displays the normal redirection file and prompts you to enter new lines consisting of “service,” “user,” “application,” and “assigned_service,” each separated by a tab character. The snrfck utility reads the lines, validates them, adds them to the output file, and displays the amended file.
For example, you use the preceding sample file and enter:
snrfck -itestfile -t -onewfile
where:
-t activates the test or update capability.
-onewfile specifies the output file. To save changes to the redirection file, you must use this option.
If you use -t without using -o, your additions are displayed but not saved.
You receive a file with instructions for adding lines, as shown in the following table:
The following is displayed:
Enter service name redirection file lines:
service<tab>user<tab>application<tab>assigned_service
end with '.' on line by itself
8:
Then, you add the following lines in response to the prompt (snrfck supplies the line numbers):
8: db2 rachel * svc_db2gen 9: .
The snrfck utility produces a new service name redirection file, as shown in the following table:
The snrfck utility adds the new entry and sorts the file.
Copyright © 2005. Sybase Inc. All rights reserved. |