2014/04/15

Clearcase how to change owner? (CLEARCASE)

Usage:
cleartool protect -chown v439333 -chgrp feaccusr lbtype:LABEL_NAME

v439333 => user id
feaccusr => group name

Enjoy!

Clearcase how to lock label but only specific person are allowed to use the label? (CLEARCASE)

Usage:
cleartool lock -nusers r339347,v439333 lbtype:LABEL_NAME

r339347,v439333 => userid

Enjoy!

Clearcase check any file which is not yet checked in (CLEARCASE)

Usage:
cleartool lsprivate -tag TAG_NAME -long > c:\viewspec\Private_APBAU_20110708.log

c:\viewspec\Private_APBAU_20110708.log => logpath.

Enjoy.

How to remove clearcase branch by command? (CLEARCASE)

cleartool rmbranch -force branchpath

Enjoy.

How to use BCP in & out? (BCP)

To bcp out (get data from DB), please use the below command.

Explanation
GTDMAST1..DISCREPANCY_CD_DTL -> where you want to get the data from
DISCREPANCY_CD_DTL-> the name of the file where you want it to output to
SGTSCOR_UAT510-> server name
UU649121-> username
Pabc123 -> password
-c -t'~^' -r'AAAAABBBBBCCCCC' -b500-> this is the part to separate the data 

Command (OUT):
bcp GTDMAST1..DISCREPANCY_CD_DTL out DISCREPANCY_CD_DTL -SGTSCOR_UAT510 -UU649121 -Pabc123 -c -t'~^' -r'AAAAABBBBBCCCCC' -b500



Explanation
tempdb..DISCREPANCY_CD_DTL -> where you want the data to insert into 
DISCREPANCY_CD_DTL -> the source file
SGTSCOR_DEV510 -> the db server
Usa1 -> username
Pabcd7890 -> passowrd
-c -t'~^' -r'AAAAABBBBBCCCCC' -b500 -> this is the separator and has to be the same with the output command.

Command (IN):
bcp tempdb..DISCREPANCY_CD_DTL in DISCREPANCY_CD_DTL -SGTSCOR_DEV510 -Usa1 -Pabcd7890 -c -t'~^' -r'AAAAABBBBBCCCCC' -b500

How to look up file in UNIX? (UNIX)

If you know the file name, the below command will help you to find out a file.

Please notice that the "." means look through everything in the location where you are.

find . -type f -print | grep 'actionfile_inq.xml'

Enjoy.

How to look up a file in a directory? (UNIX)

In the below example:
CCY_EMU_EXT = filename (it will look up files CCY_EMU_EXT and more CCY_EMU_EXTx, where x can be anything with unlimited number of characters)

After the ">" symbol is the path where you want the result to print it to.  CCY_EMU_EXT_1.log is the result file.

find /gtsallsrv/gts/ -name "*" | xargs grep -l CCY_EMU_EXT  > /var/tmp/v439333/CCY_EMU_EXT_1.log &