Get oracle table primary key info
SELECT cols.table_name, cols.column_name, cols.position, cons.status, cons.owner
FROM all_constraints cons, all_cons_columns cols
WHERE cols.table_name = 'TABLE_NAME'
AND cons.constraint_type = 'P'
AND cons.constraint_name = cols.constraint_name
AND cons.owner = cols.owner
ORDER BY cols.table_name, cols.position;
-- What a terrible statement.
-- Reference link: http://www.techonthenet.com/oracle/questions/find_pkeys.php
setup http proxy server for ppm
SET HTTP_proxy=<proxy_server_address:port_number>
# the prefix http:// is mandatory.
# e.g., SET HTTP_proxy=http://proxy:8080
# following system variables are optional
SET HTTP_proxy_user=<your user name>
SET HTTP_proxy_pass=<your password>
Shape the sql*plus output
Command to make the output of sql*plus nicer to read.
set linesize 1500
character cast by Perl -- II
uppercase cast:
perl -p -e '$_=uc'
lowercase cast:
perl -p -e '$_=lc'
redirect stderr to stdout
The intention is to handle the error output as standard output.
e.g. To filter the permission denied errors complained by command find
find -follow -name 'your pattern' 2>&1 | grep -v 'Permission denied'