The saveConnection command saves the database connection details to a specified file. These connection details are necessary for all other SDM command line operations.
If you have run the SDM GUI with "Save connection settings" selected, the saveConnection command is not necessary. You can use the sdm.connect file located in %ESEC_HOME%\sdm for Windows or $ESEC_HOME/sdm for UNIX.
The saveConnection command uses the following flags:
-action |
saveConnection |
-server |
<oracle or mssql2005> |
-host |
<database host IP Address or host name to connect to> |
-port |
<database port number to connect to [Oracle default: 1521/SQL Server default: 1433]> |
-database |
<database name/SID> |
-driverProps |
<Properties File> |
-dbuser |
<database username> |
-password |
<database password> |
-winAuth |
Used for Windows authentication. When using this option, -user and password are not needed. |
-connectFile |
<filenameToSaveConnection> |
The application saves all the above connection details along with the encrypted password to the sdm.connect file. All other SDM command line commands will refer to the specified file. This step should be completed first time you use the SDM command line on a machine and every time you want to change the connection details the application uses.
To run saveConnection:
Execute the command as follows:
-action saveConnection -server <oracle/mssql2005> -host <hostIpaddress/hostName> -port <portnum> -database <databaseName/SID> [-driverProps <propertiesFile] {-user <dbUser> -password <dbPass> | -winAuth} -connectFile <filenameToSaveConnection>
The following example will save connections for a host with an IP address of 172.16.0.36 at port 1521 (default for Oracle, for SQL Server, default is 1433).
Oracle Example:
./sdm -action saveConnection -server oracle -host 172.68.0.47 -port 1521 -database esec -user esecdba -password XXXXXX -connectFile sdm.connect
SQL Server Example (using SQL Server Authentication)
sdm -action saveConnection -server mssql -host 172.16.0.36 -port 1433 -database esec -user esecdba -password XXXXXX -connectFile sdm.connect
SQL Server Example (Windows Authentication):
sdm -action saveConnection -server mssql -host 172.16.0.36 -port 1433 -database esec winAuth -connectFile sdm.connect
This will save the connection details to the sdm.connect file. All the rest of the commands will take this filename as input to connect to the designated database and to perform their actions.