ASA Database Administration Guide
Database Administration Utilities
The Data Source utility
dbdsn [ modifier-options ]
{ -l[ u | s ] [ qq ]
| -d[ u | s ] dsn
| -g[ u | s ] dsn
| -w[ u | s ] dsn [details-options;...]
| -cl[ qq ] }
Major option | Description |
---|---|
-l[ u | s ] [ qq ] | List either all Adaptive Server Anywhere users or all Adaptive Server Anywhere system data sources. You can also list both Adaptive Server Anywhere user and Adaptive Server Anywhere system data sources. User data sources is the default. Using -qq with this option lists the DSNs without any banner or titles. |
-d[ u | s ] dsn | Delete the named Adaptive Server Anywhere user or Adaptive Server Anywhere system data source. User data sources is the default. |
-g[ u | s ] dsn | List (get) details about the named Adaptive Server Anywhere user or Adaptive Server Anywhere system data source. User data sources is the default. |
-w[ u | s ] dsn [ details-options ] | Create (write) a user or system data source definition. User data sources is the default. |
-cl[ qq ] | List available connection parameters. Using -qq with this option lists the available connection parameters without any banner or titles. |
Modifier option | Description |
---|---|
-b | Brief. Print connection string for the data source |
-q | Quiet. Do not print banner |
-v | Verbose. Print connection parameters in tabular form |
-y | Delete or overwrite data source without confirmation |
Details-option | Description |
---|---|
-cw | Ensure that the DBF parameter (specified using -c) is an absolute filename. If the value of DBF is not an absolute filename, the Data Source utility prepends the current working directory (CWD). |
-c "keyword=value;..." | Supply database connection parameters |
-ec encryption type | Encrypt all network packets |
-o filename | Write client message to filename |
-p size | Set maximum network packet size |
-r | Disable multiple record fetching |
-tl seconds | Client liveness timeout period |
-x list | List network drivers to run |
-z | Display debugging information |
server-name | Connect to named database server |
Working with ODBC data sources
Using ODBC data sources on UNIX
The Data Source utility is a cross-platform alternative to the ODBC Administrator for creating, deleting, describing, and listing Adaptive Server Anywhere ODBC data sources. On Windows operating systems, the data sources are held in the registry. On UNIX operating systems, the data sources are held in the .odbc.ini file. The utility is useful for batch operations.
The modifier options can occur before or after the major option specification. The order makes a difference only when a connection parameter value is specified more than once. In such a case, the last value specified is used.
Exit codes are 0 (success) or non-zero (failure).
This utility accepts @filename parameters. For more information, see @filename server option.
Write a definition of the data source newdsn. Do not prompt for confirmation if the data source already exists.
dbdsn -y -x tcpip -w newdsn -c "uid=DBA;pwd=SQL" -v
or, with a different option order,
dbdsn -w newdsn -c "uid=DBA;pwd=SQL" -x tcpip -y
List all known user data sources, one data source name per line:
dbdsn -l
List all known system data sources, one data source name per line:
dbdsn -ls
List all data sources along with their associated connection string:
dbdsn -l -b
Report the connection string for user data source MyDSN:
dbdsn -g MyDSN
Report the connection string for system data source MyDSN:
dbdsn -gs MyDSN
Delete the data source BadDSN, but first list the connection parameters for BadDSN and prompt for confirmation:
dbdsn -d BadDSN -v
Delete the data source BadDSN without prompting for confirmation.
dbdsn -d BadDSN -y
Create a data source named NewDSN for the database server MyServer:
dbdsn -w NewDSN -c "uid=DBA;pwd=SQL;eng=MyServer"
If a NewDSN already exists, the previous definition is overwritten.
The following example connects to the sample database server. The server name sample overrides the previous specified value of MyServer:
dbdsn -w NewDSN -c "uid=DBA;pwd=SQL;eng=MyServer" sample
List all connection parameter names and their aliases:
dbdsn -cl
List all user DSNs (without banner and titles):
dbdsn -l -qq
List all connection parameter names (without banner and titles):
dbdsn -cl -qq
Specify an absolute filename. When the DSN is created, it will contain dbf=E:\asa90\my.db.
E:\asa90> dbdsn -w testdsn -cw -c uid=dba;pwd=sql;eng=asa;dbf=my.db