You are on page 1of 13

Datastage Essentials

Datastage commands
Orchadmin & dsrecords

Objectives
Understanding Dataset Pre-Reqeuisit setup for datastage commands orchadmin command dsrecords commands

DS Environment Setup
DSHOME displays the Datastage engine directory.

DSEVN setup the environment to execute datastage commands.

Setting Environment Parameters

Execution of orchadmin command


Execution of orchadmin command Details about Datastage version and copyrights

Actual result of the command executed.

Log of the command

Orchadmin command options.


1. orchadmin check <dataset_name> Validates the configuration file contents like , accessibility of all nodes defined in the configuration file, scratch disk definitions and accessibility of all the nodes etc.

Orchadmin command options.


2. orchadmin copy <source.ds> <destination.ds>
The copy command could be used to preserve a back-up of the dataset or create different copies. The cp (copy) command in Unix would not copy the dataset(actual data), but only the descriptor file, which means that the new copied file will also refer to the older data files. Whereas when cp|copy command is used in orchadmin utility, it creates entirely new set of descriptor and data files which means that the source dataset is real safe, and one more set of descriptor and data files are created.

Orchadmin command options.


3. orchadmin <delete|del|rm> descriptorfile.ds [-f|-x]

The unix rm utility cannot be used to delete the datasets, since it would actually delete only the descriptor file, in other words the real data would be lying on different nodes of server as orphans, thereby blocking the memory. The orchadmin delete or rm command should be used to delete one or more persistent data sets. -f option makes a force delete. If some nodes are not accesible then -f forces to delete the dataset partitions from accessible nodes and leave the other partitions in inaccesible nodes as orphans.
-x option forces to use the current config file to be used while deleting than the one stored in data set.
Note: There are no difference between delete/del/rm command. All the three perform the same operations.

Orchadmin command options.


4. orchadmin describe [options] descriptorfile.ds
Without any option this command lists the no.of.partitions, no.of.segments, valid segments, and preserve partitioning flag details of the persistent dataset. The possible options used are as below: -c -p -f -e -s -v -l : Print the configuration file that is written in the dataset if any : Lists down the partition level information. : Lists down the file level information in each partition. : List down the segment level information. : List down the meta-data schema of the information. : Lists all segments, valid or otherwise. : Long listing. Equivalent to -f -p -s -v -e

Orchadmin command options.


5. orchadmin dump [options] descriptorfile.ds
Without any options the dump command lists down all the records starting from first record from first partition till last record in last partition.
-delim : Uses the given string as delimiter for fields instead of space.
E.g.: orchadmin dump -delim '|' Test.ds

-field

: Lists only the given field instead of all fields. Eg: orchadmin dump -field COL1 field COL10 Test.ds - will display only COL1 and COL10 from the dataset Test.ds
: List all the values preceded by field name and a colon : List only the given number of records per partition. : Lists every Nth record from each partition starting from first record. : Skip the first N records from each partition. : Use the current system configuration file rather than the one stored in dataset.

-name -n -p -skip -x

Orchadmin command options.


6. orchadmin -help OR $orchadmin <command> -help
A help command is documentation for the orchadmin command. The above mentioned topics are covered along with additional commands and its option flags. orchadmin command [-help] orchadmin [-help] orchadmin -f command-file . : prints help message for one command : prints help message for all commands : executes commands from specified file

dsrecords command options.


1. dsrecords [-n] <dataset_name>
The command returns the count of records present in the dataset data file. -n : display the only number of records eliminating additional texts.

Q&A