Atul.Singh 270002HUVT Tags:  delete commands dataset design command copy help unix checkpoint orchadmin datastage 85,523 Views
Orchadmin is a command line utility provided by datastage to research on data sets.
The general callable format is : $orchadmin <command> [options] [descriptor file]
1. Before using orchadmin, you should make sure that either the working directory or the $APT_ORCHHOME/etc contains the file “config.apt” OR
The environment variable $APT_CONFIG_FILE should be defined for your session.
The various commands available with orchadmin are
1. CHECK: $orchadmin check
Validates the configuration file contents like , accesibility of all nodes defined in the configuration file, scratch disk definitions and accesibility of all the nodes etc. Throws an error when config file is not found or not defined properly
2. COPY : $orchadmin copy <source.ds> <destination.ds>
Makes a complete copy of the datasets of source with new destination descriptor file name. Please not that
a. You cannot use UNIX cp command as it justs copies the config file to a new name. The data is not copied.
b. The new datasets will be arranged in the form of the config file that is in use but not according to the old confing file that was in use with the source.
3. DELETE : $orchadmin < delete | del | rm > [-f | -x] descriptorfiles….
The unix rm utility cannot be used to delete the datasets. The orchadmin delete or rm command should be used to delete one or more persistent data sets.
-f options 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 forces to use the current config file to be used while deleting than the one stored in data set.
4. DESCRIBE: $orchadmin describe [options] descriptorfile.ds
This is the single most important command.
1. Without any option lists the no.of.partitions, no.of.segments, valid segments, and preserve partitioning flag details of the persistent dataset.
-c : Print the configuration file that is written in the dataset if any
-p: Lists down the partition level information.
-f: Lists down the file level information in each partition
-e: List down the segment level information .
-s: List down the meta-data schema of the information.
-v: Lists all segemnts , valid or otherwise
-l : Long listing. Equivalent to -f -p -s -v -e
5. DUMP: $orchadmin dump [options] descriptorfile.ds
The dump command is used to dump(extract) the records from the dataset.
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 ‘<string>’ : Uses the given string as delimtor for fields instead of space.
-field <name> : Lists only the given field instead of all fields.
-name : List all the values preceded by field name and a colon
-n numrecs : List only the given number of records per partition.
-p period(N) : Lists every Nth record from each partition starting from first record.
-skip N: Skip the first N records from each partition.
-x : Use the current system configuration file rather than the one stored in dataset.
6. TRUNCATE: $orchadmin truncate [options] descriptorfile.ds
Without options deletes all the data(ie Segments) from the dataset.
-f: Uses force truncate. Truncate accessible segments and leave the inaccesible ones.
-x: Uses current system config file rather than the default one stored in the dataset.
-n N: Leaves the first N segments in each partition and truncates the remaining.
7. HELP: $orchadmin -help OR $orchadmin <command> -help
Help manual about the usage of orchadmin or orchadmin commands.
Virtual Memory :
The ps (process status) command is used to provide information about the currently running processes, including their process identification numbers (PIDs). A process, also referred to as a task, is an executing (i.e., running) instance of a program. Every process is assigned a unique PID by the system. The basic syntax of ps is
-a Displays all processes on a terminal, with the exception of group leaders. -c Displays scheduler data. -d Displays all processes with the exception of session leaders. -e Displays all processes. -f Displays a full listing. -glist Displays data for the list of group leader IDs. -j Displays the process group ID and session ID. -l Displays a long listing -plist Displays data for the list of process IDs. -slist Displays data for the list of session leader IDs. -tlist Displays data for the list of terminals. -ulist Displays data for the list of usernames.
The Default Output
linux@atul:/home/atul $ ps PID TTY TIME CMD 3567696 pts/2 0:00 ps 4391144 pts/2 0:00 -ksh
The Process list output for user smaadmp7
linux@atul:/home/atul $ ps -u smaadmp7 UID PID TTY TIME CMD 1930 299258 - 0:01 dsapi_server 1930 671930 - 0:01 dsapi_slave 1930 696452 - 0:17 dsapi_slave 1930 790608 - 0:00 dsapi_server 1930 1200174 - 0:01 dsapi_server 1930 1634556 - 0:15 dsapi_slave 1930 1687662 - 0:00 dsapi_server 1930 1757284 - 0:00 dsapi_slave 1930 1790152 - 0:00 dsapi_server 1930 2081022 - 0:00 dsapi_server 1930 2158782 - 0:47 dsapi_slave 1930 2289812 - 0:00 dsapi_server
The -a option tells ps to list the processes of all users on the system rather than just those of the current user
linux@atul:/home/atul $ ps -a PID TTY TIME CMD 1294566 pts/8 0:00 sleep 1884294 pts/5 0:00 ksh 2240748 pts/3 0:19 topas_nmon 3813422 0:00
Own output format If you are bored by the regular output, you could simply change the format. To do so use the formatting characters which are supported by the ps command. If you execute the ps command with the 'o' parameter you can tell the ps command what you want to see:
linux@atul:/home/atul $ ps -o "%u : %U : %p : %a" RUSER USER PID COMMAND atul : atul : 2256934 : ps -o %u : %U : %p : %a atul : atul : 4391144 : -ksh
The -l option generates a long listing The additional columns of most interest are NI and SZ. The former shows the nice value of the process, which determines the priority of the process. The higher the value, the lower the priority. The default nice value is 0 on NIX systems. The latter displays the size of the process in memory. The value of the field is the number of pages the process is occupying. On Linux systems a page is 4,096 bytes.
linux@atul:/home/atul $ ps -l F S UID PID PPID C PRI NI ADDR SZ WCHAN TTY TIME CMD 200001 A 2291 3305488 4391144 3 61 20 432309400 1788 pts/2 0:00 ps 240001 A 2291 4391144 5161086 0 60 20 3430d7400 792 pts/2 0:00 ksh
The -e option generates a list of information about every process currently running. The -f option generates a listing that contains fewer items of information for each process than the -l option.
linux@atul:/home/atul > ps -ef | more UID PID PPID C STIME TTY TIME CMD root 1 0 0 Apr 28 - 6:21 /etc/init root 102518 1 0 Apr 28 - 23:31 /usr/sbin/syncd 60 root 106530 1 0 Apr 28 - 0:00 /usr/sbin/uprintfd root 127116 1 0 Apr 28 - 0:10 /usr/ccs/bin/shlap64 root 135190 204998 0 Apr 28 - 4:39 /opt/IBM/ITM/aix526/ux/bin/stat_daemon 12 root 147644 323618 0 Apr 28 - 0:02 /usr/sbin/portmap root 163990 1 0 Apr 28 - 0:00 /usr/lib/errdemon root 192710 323618 0 Apr 28 - 0:00 haemd HACMP 1 CCMP0 SECNOSUPPORT root 204998 1 0 Apr 28 - 2352:55 /opt/IBM/ITM/aix526/ux/bin/kuxagent root 209066 135190 0 Apr 28 - 0:06 /opt/IBM/ITM/aix526/ux/bin/ifstat 30 7 root 217206 286754 0 08:18:21 - 0:00 sshd: mahendra [priv] root 229520 323618 0 Apr 28 - 0:00 /usr/sbin/rsct/bin/IBM.ServiceRMd root 233604 323618 0 Apr 28 - 5:59 /usr/sbin/snmpd -c /etc/snmpd.conf root 241798 135190 0 Apr 28 - 0:59 /opt/IBM/ITM/aix526/ux/bin/nfs_stat AIX 30 9 root 249928 1 0 Apr 28 - 0:11 /tivoli_ep_B/opt/Tivoli/lcf/bin/aix4-r1/mrt/lcfd root 253990 1 0 Apr 28 - 3:53 /opt/IBM/ITM/aix526/ul/bin/kulagent root 258098 135190 0 Apr 28 - 2:00 /opt/IBM/ITM/aix526/ux/bin/kux_vmstat 30 6
njoy the simplicity.......
linux@atul $ basename /home/atul/script/WORKING_FINE/dfs.sh
The basename utility also allows the extension or suffix to be stripped from a file basename. The extension to be stripped is added after the file path. In the following example, .sh is added after the filename. The return from basename is the single word file:
linux@atul $ basename /home/atul/script/WORKING_FINE/dfs.sh .sh
linux@atul $ dirname /home/atul/script/WORKING_FINE/dfs.sh
dirname has no options for the command and simply returns the directory portion of a file path. It is not used as often as basename.victimizeit.wordpress.com
The chsh command changes a user's login shell attribute. The shell attribute defines the initial program that runs after a user logs in to the system. This attribute is specified in the /etc/passwd file. By default, the chsh command changes the login shell for the user who gives the command.
Shell used by me
[root@home ~]# echo $SHELL /bin/bash
To get the chsh help
[root@home ~]# chsh --help Usage: chsh [ -s shell ] [ --list-shells ] [ --help ] [ --version ][ username ]
To list the available shells in system
[root@home ~]# chsh -l /bin/sh /bin/bash /bin/ksh /usr/bin/ksh /bin/tcsh /bin/csh
Step to change Linux login shell. The example below show the use of chsh command to change shell for current user.
[atul@home ~]$ chsh Changing shell for atul. Password: New shell [/bin/bash]: /bin/csh Shell changed.
The chsh command issue with no option and –s option with the full pathname of the desired shell, is used to change shell for the user and it will prompt user for their password (note: the password only prompt for non-root user). In above example we change the shell to /bin/csh (C SHell) and to /bin/bash (Bourne-Again Shell). NOTE: the changes will take effect after you logout and login again.
Step to change shell for other user.
[root@home ~]# chsh -s /bin/csh atul --> chsh [ -s shell ][ username ] Changing shell for atul. Shell changed.