The SDM command line functions can be used instead of the GUI. The command line can be used to create a batch file or cron job for SDM operations, but Novell recommends using auto-archiving instead. Auto-archiving can be configured on the Partition Configuration tab of the SDM GUI.
The first step to using the SDM command line is to create a file that stores the connection properties for the database.
General Syntax
Start SDM GUI
Save Connection Properties
Add Partitions
Drop Partitions
View Partitions
Archive Data
Delete Data
Listing Files to Import
Import Data
Delete Import Data
Viewing Sentinel Database Space Usage
Update Map Data
[path to SDM] action [actionname] [action-specific flags] [path to database connection file]
The specific flags for each action are described below.
startGui (DEFAULT)
-action startGui [-connectFile <filePath>]
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.
This action (addPartitions) adds the required number of partitions in the following tables according to the partition configuration settings:
Oracle:
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
SQL Server
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
NOTE: Partitions are added in database both for Events and Correlated events if you select any one of these two. Partitions will be added for all the summary tables if you select any one of them.
If you are configured to have 10 days worth of partitions, every time you run addPartitions it checks to see if you have 10 days of partitions ahead. If you have enough partitions for next 10 days it will not do anything. If not, it will add the required number of partitions for 10 days.
This action uses the following flags:
-action |
addPartitions |
-connectFile |
<filePath> |
-tableName |
<table name> |
-keepDays |
<days to add> |
To run addPartitions:
Execute this command as follows:
-action addPartitions -connectFile <filePath> -tableName <table name> -keepDays <days to add>
Oracle Example:
./sdm -action addPartitions -connectFile sdm.connect -tableName EVENTS -keepDays 10
SQL Server Example:
sdm -action addPartitions -connectFile sdm.connect -tableName EVENTS -keepDays 10
This action (dropPartition) drops all the partitions older than the flag keepDays from the following tables:
Oracle:
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
SQL Server
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
To prevent unintentional loss of data, this action does not drop any partitions that are not archived. If you want to delete unarchived partitions, use the forceDelete flag.
WARNING:
If - forceDelete is used, the deleted data cannot be recovered, so use this option with caution.
This action uses the following flags:
-action |
dropPartitions |
-keepDays |
<number of days to keep> |
-forceDelete (optional) |
<either "true" or "false"> This defaults to false if not specified, meaning that only the partitions that are older than keepDays and are already archived will be dropped. If set to true, all partitions older than keepDays will be dropped, even if they have not been archived. |
-connectFile |
<filePath> |
-tableName |
<table name> |
NOTE: Sentinel partitioned tables are organized into 2 groups. One is the EVENTS table group, which includes EVENTS and CORRELATED_EVENTS; the other is the summary table group, which includes all summary, or aggregate, tables. If any one of the tables in the group is specified by the tableName parameter, the dropPartition operation is applied to all tables in that group.
To run dropPartition:
Execute this command as follows:
-action dropPartitions -keepDays <numberofDaysToKeep> -tableName <table name> [-forceDelete <true/false>] -connectFile <filePath>
The following examples drops all the partitions older than 30 days making sure all the partitions are archived. All partitions that were skipped (not removed) because they have not been archived are listed when the operation completes.
Oracle Example:
./sdm action dropPartitions keepDays 30 tableName CORRELATED_EVENTS forceDelete false connectFile sdm.connect
SQL Example:
sdm action dropPartitions keepDays 30 tableName CORRELATED_EVENTS forceDelete false connectFile sdm.connect
This action (ViewPartitions) displays the partition summary of the following supported tables:
Oracle:
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
SQL Server
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
NOTE: You need to have SDM installed in order to view the partition summary.
This command uses the following flags:
-action |
viewPartitions |
-tableName |
<table name> |
-connectFile |
<filePath> |
To View Partition Summaries:
Execute this command as follows:
-action viewPartitions -tableName <table name> -connectFile <filePath>
The following example, displays the list of partitions of the EVENTS table and status of each partition.
Oracle Example:
./sdm action viewPartitions tableName EVENTS connectFile sdm.connect
SQL Server Example:
sdm action viewPartitions tableName EVENTS connectFile sdm.connect
Run this action (archiveData) after you set your archive configuration (this can be configured in Partition Configuration tab in SDM GUI). This action archives the data from the given table name according to the archive configuration. It archives data from:
Oracle:
EVENTS
CORRELATED_EVENTS
SQL Server
EVENTS
CORRELATED_EVENTS
NOTE: Sentinel partitioned tables are organized into 2 groups. One is the EVENTS table group, which includes EVENTS and CORRELATED_EVENTS; the other is the summary table group, which includes all summary, or aggregate, tables. If any one of the table in the group is specified by the tableName parameter, the archiveData operation is applied to all tables in that table group.
This command uses the following flags:
-action |
archiveData |
-connectFile |
<filePath> |
-tableName |
<table name> |
-keepDays |
<numberOfDaysToKeep> |
To run archiveData:
Execute this command as follows:
-action archiveData -connectFile <filePath> -tableName <table name> -keepDays <numberOfDaysToKeep>
The following examples archive events and correlated events from the EVENTS and CORRELATED_EVENTS tables according to the value set during archive configuration (using the archiveConfig command).
Oracle Example:
./sdm -action archiveData connectFile sdm.connect tableName EVENTS keepDays 30
SQL Server Example:
sdm -action archiveData -connectFile sdm.connect tableName EVENTS keepDays 30
This action (deleteData) deletes the data older than a specified number of days from the given table name. It deletes data from:
Oracle:
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
SQL Server
EVENTS
CORRELATED_EVENTS
EVT_DEST_EVT_NAME_SMRY_1
EVT_DEST_SMRY_1
EVT_DEST_TXNMY_SMRY_1
EVT_PORT_SMRY_1
EVT_SEV_SMRY_1
EVT_SRC_SMRY_1
NOTE: This action does not drop any partitions that are not archived. If you want to delete unarchived partitions, the optional flag forceDelete has to be specified with a value of true.
If forceDelete is used:
false or not specified |
drops only the partitions older than keepDays and those that are archived |
true |
drops all the partitions older than keepDays including unarchived partitions |
This command uses the following flags:
-action |
deleteData |
-keepDays |
<number of days to keep> |
[-forceDelete] |
<either true or false> |
-connectFile |
<filePath> |
-tableName |
<table name> |
To run deleteData:
Execute this command as follows:
-action deleteData -keepDays <numberofDaysToKeep> [-forceDelete <true/false>] -connectFile <filePath> -tableName <table name>
Oracle Example:
The following example drops partitions from all tables older than 13 days making sure all dropped partitions are archived. In the end, a list is generated of any partitions that were not deleted if they have not been archived.
./sdm -action deleteData keepDays 13 -forceDelete false -connectFile sdm.connect tableName EVENTS
SQL Server Example:
The following example drops the partitions from all tables older than 13 days making sure all dropped partitions are archived. In the end, it lists any partitions that were not deleted if they have not been archived.
sdm -action deleteData keepDays 13 -forceDelete false -connectFile sdm.connect tableName EVENTS
This action (filesToImport) is used to list the files needed to import the data between the given dates into the following supported tables:
SQL Server
HIST_EVENTS
HIST_CORRELATED_EVENTS
Note: The tables are imported in Oracle with the same name they are archived with.
If these files have been moved to another location since the original archiving operation (F, moved to tape), they must be restored to a directory accessible from the database server with their original file names.
This command uses the following flags:
-action |
filesToImport |
-tableName |
<table name> |
-startDate |
<mm/dd/yyyy hh24:mi:ss> |
-endDate |
<mm/dd/yyyy hh24:mi:ss> |
-connectFile |
<filePath> |
Note: hh24 is hours represented in 24 hour format. For example, 1:15:00 p.m. is 13:15:00 and 3:00:00 a.m. is 03:00:00.
To run filesToImport:
Execute this command as follows:
-action filesToImport -tableName <table name> -startDate <mm/dd/yyyy hh24:mi:ss> -endDate <mm/dd/yyyy hh24:mi:ss> -connectFile <filePath>
The following example lists all files containing data between dates "09/25/2007 00:00:00" (Sep 25th midnight) and "09/26/2007 00:00:00" (Sep 26th midnight) that have been previously archived.
Oracle Example:
./sdm action filesToImport -tableName Events startDate 09/25/2007 00:00:00 endDate 09/26/2007 00:00:00 connectFile sdm.connect
SQL Server Example:
sdm action filesToImport -tableName Events startDate 09/25/200\7 00:00:00 endDate 09/26/2007 00:00:00 connectFile sdm.connect
The following example lists all the files containing the data between dates "09/25/2007 16:00:00" (Sep 25th 4 PM) and "09/26/2007 18:00:00" (SEP 26, 6 PM) that has been archived earlier and can be imported back.
Oracle Example:
./sdm action filesToImport -tableName Events startDate 09/25/2007 16:00:00 endDate 09/26/2007 18:00:00 connectFile sdm.connect
SQL Server Example:
sdm action filesToImport -tableName Events startDate 09/25/2007 16:00:00 endDate 09/26/2007 18:00:00 connectFile sdm.connect
This action (importData) imports data between the given dates into the Sentinel database so it can be used for historical reporting or other purposes. The data is imported into the following tables:
SQL Server
HIST_EVENTS
HIST_CORRELATED_EVENTS
Note: The tables are imported in Oracle with the same name they are archived with.
If the data has already been imported or there is no archived data is found between the specified dates, it returns a notification.
The application imports data from each file into a table and builds the historical view on all the historical tables. The report view joins on the original table and historical view. All Sentinel reports use the report view and thus will see any imported data.
This command uses the following flags:
-action |
importData |
-tableName |
<table name> |
-startDate |
<mm/dd/yyyy hh24:mi:ss> |
-endDate |
<mm/dd/yyyy hh24:mi:ss> |
-connectFile |
<filePath> |
Note: hh24 is hours represented in 24 hour format. For example, 1:15:00 p.m. is 13:15:00 and 3:00:00 a.m. is 03:00:00.
NOTE: The files to be imported must exist in the directory with their original file names.
To run importData:
Place all the files you want to import in a specific directory (that is, dirPath - <directory to import files from>) and execute the following command
-action importData -startDate <mm/dd/yyyy hh24:mi:ss> -endDate <mm/dd/yyyy hh24:mi:ss> -tableName <table name> -connectFile <filePath>
The following example imports the archived files from the tmp directory containing the data between dates "09/25/2007 00:00:00" (Sep 25 midnight) and "09/26/2007 00:00:00" (Sep 26 midnight).
Oracle Example:
./sdm action importData startDate 09/25/2007 00:00:00 endDate 09/26/2007 00:00:00 -tableName Events connectFile sdm.connect
SQL Server Example:
sdm action importData dirPath c:\tmp startDate 09/25/2007 00:00:00 endDate 09/26/2007 00:00:00 -tableName Events connectFile sdm.connect
This action (dropImported) deletes the imported data between the given dates from the following supported tables:
SQL Server
HIST_EVENTS
HIST_CORRELATED_EVENTS
Note: The tables are imported in Oracle with the same name they are archived with.
If there is no data imported between two specified dates, it returns a notification.
This command uses the following flags:
-action |
dropImported |
-startDate |
<mm/dd/yyyy hh24:mi:ss> |
-endDate |
<mm/dd/yyyy hh24:mi:ss> |
-tableName |
<table name> |
-connectFile |
<filePath> |
Note: hh24 is hours represented in 24 hour format. For example, 1:15:00 p.m. is 13:15:00 and 3:00:00 a.m. is 03:00:00.
To run dropImported:
Execute this command as follows:
-action dropImported -startDate <mm/dd/yyyy hh24:mi:ss> -endDate <mm/dd/yyyy hh24:mi:ss> -tableName <table name> -connectFile <filePath>
The following example deletes the imported data between the given dates from the above mentioned tables.
Oracle Example:
./sdm action dropImported startDate 09/25/2007 00:00:00 endDate 09/26/2007 00:00:00 -tableName Events connectFile sdm.connect
SQL Server Example:
sdm action dropImported startDate 09/25/2007 00:00:00 endDate 09/26/2007 00:00:00 -tableName Events connectFile sdm.connect
In Tablespace Management, the command line option allows you to:
View Sentinel database space usage
This action (dbstats) displays the Sentinel database usage for all Sentinel tablespaces in Oracle and Sentinel filegroups in MS SQL.
This command uses the following flags:
-action |
dbstats |
-connectFile |
<filePath> |
To view Sentinel Database Space Usage (Command Line):
Execute the following command:
-action dbStats -connectFile <filePath>
The following example displays the tablespaces of Sentinel database with their total space, used space and free space available.
Oracle Example:
./sdm action dbStats connectFile sdm.connect
SQL Server Example:
Sdm action dbStats connectFile sdm.connect
This action allows you to replace the map source data file of a map on the server running DAS with another file. Your new map source data file must have the same delimiter, number of columns, and overall structure as the existing map data source file in order for the map to function properly after the update. The new map source data file should only differ from the existing file by the values that appear in the columns. If the new map source data file has a different structure than the existing file, use the Edit feature to update the map definition.
This command uses the following flags:
-action |
updateMapData |
-map |
<mapName> |
-file |
<fileName> |
-backup (Optional) |
<true/false> |
-connectFile |
<filePath> |
To run updateMapData:
Execute this command as follows:
-action updateMapData -map <mapName> -file <fileName> [-backup <true/false> (DEFAULT: true)] -connectFile <filePath>
Oracle Example:
./sdm -action updateMapData -map Maps/rMap -file D:\EDLocal_Updated.csv -connectFile D:\sdm.connect
SQL Server Example:
sdm -action updateMapData -map Maps/rMap -file D:\EDLocal_Updated.csv -connectFile D:\sdm.connect