Showing posts with label AIX. Show all posts
Showing posts with label AIX. Show all posts

Friday, March 13, 2015

Aix get last day of current month

cal | awk '($0 != "") {F=$NF} END {print F}'
or
cal |grep .|fmt -1|tail -1

You can also find out the last day of any month by providing month and year to cal. for example:
cal 2 2012|awk '($0 != "") {F=$NF} END {print F}'
29
cal 10 2011|awk '($0 != "") {F=$NF} END {print F}'
11

Monday, May 7, 2012

TDPO for TSM setup on AIX

1. make sure oracle id has full access to tsm installation folder and files.
2. vi /usr/tivoli/tsm/client/ba/bin64/dsm.sys:
    SErvername your TSM server name, for example, TSM_ORA
    COMMmethod  TCPIP
    TCPPort     1500
    TcpServerAddress tsm server IP
    NODENAME  client_node registered on your TSM server(for example, client_ora) 
3. vi /usr/tivoli/tsm/client/ba/bin64/dsm.opt:
    SErvername  your TSM server name, for example, TSM_ORA 
4. su - oracle
5. ln -s /usr/lib/libobk64.a $ORACLE_HOME/lib/libobk.a
6. vi /usr/tivoli/tsm/client/oracle/bin64/tdpo.opt:
    DSMI_ORC_CONFIG    (location of dsm.opt, for example, /usr/tivoli/tsm/client/oracle/bin64/dsm.opt)
    DSMI_DIR           (location for dsm.sys,for example, /usr/tivoli/tsm/client/oracle/bin64)
    TDPO_FS            (Space name for backup on TSM, for example, adsmorc
    TDPO_NODE      (Nodename for client, usually the servername of client)
    TDPO_OWNER   (TDPO owner, for example, oracle)
    TDPO_PSWDPATH      (tdpoconf password file location)
    DSMI_LOG          (Log file location, for example, /home/oracle)
7. tdpoconf password -tdpo_optfile=<full path of tdpo.opt file>
    It will create a password file TDPO.nodename
    You should get the password from the TSM admin
8. ln -s /usr/tivoli/tsm/client/lang/EN_US /usr/tivoli/tsm/client/oracle/bin64/EN_US
9. make sure user oracle has full access to all files under /usr/tivoli/tsm/client/oracle/bin64
10. test: $ORACLE_HOME/bin/sbttest test
    if you see:
    The sbt function pointers are loaded from libobk.a(shr.o) library.
    -- sbtinit succeeded

    Means the tdpo for oracle are configured successfully.

Monday, April 16, 2012

Convert UNIX to DOS format using sed command

Type the following command if you are using bash shell:
$ sed 's/$'"/`echo \\\r`/" input.txt > output.txt

Convert DOS newlines (CR/LF) to Unix format using sed command
If you are using BASH shell type the following command (press Ctrl-V then Ctrl-M to get pattern or special symbol)
$ sed 's/^M$//' input.txt > output.txt

NCARGS value configuration for AIX 5.1


NCARGS value configuration (5.1.0)
In AIX 5L Version 5.1, the option has been added to allow the super user or
any user belonging to the system group to dynamically change the value of
the NCARGS parameters. In previous releases of AIX, these values were
permanently defined as 24576, which resulted in a problem similar to that
shown below when a large number of arguments are parsed to a command:
# rm FILE*
ksh: /usr/bin/rm: 0403-027 The parameter list is too long.

The value of NCARGS can be increased to overcome this problem. The value
can be tuned anywhere within the range of 24576 to 524288 in 4 KB page
size increments. To display the value, use the following command.