This is a simple script to notify about password expiration to users.
#!/bin/bash# Set the environment variablesexport ORACLE_HOME=/opt/oracle/product/102/DBexport ORALCE_SID=oradbexport PATH=$PATH:$ORACLE_HOME/bin# Declar the vaiableNOTIFY_LIST=user_name@abc.comDIFF_FILE=/tmp/pass_exp.log# Get expiry dateEXP_DATE=`chage -l oracle grep “Password Expires” awk ‘{print $4″-”$3″-”$5}’sed ’s/,//’`
# Calculte in how many days password will expiresqlplus usr/pass@$ORACLE_SID<–CREATE TABLE pwd_expire (expire_date date);INSERT INTO pwd_expire values (TO_DATE(‘$EXP_DATE’,’DD-MON-YYYY’));COMMIT;SET ECHO OFF FEEDBACK OFFSPOOL [...]
Archive for the ‘Linux/Solaris’ Category
Password Expiration Notification
Posted in Linux/Solaris on July 5, 2008 | Leave a Comment »
AXEL: Download accelerator for Linux
Posted in Linux/Solaris on July 5, 2008 | Leave a Comment »
AXEL is a download accelerator for Linux. This utility also can be used to transfer files from one machine to another.Download:axel -n 16 -a http://download.com/download_file.gz
File Transfer:axel -n 16 -a ftp://username/password@remote_host//temp/expdp_naikh_01.dmp
axel -n 16 -a ftp://username/password@remote_host//temp/expdp_naikh*
awk: Find & Replace
Posted in Linux/Solaris on January 26, 2008 | Leave a Comment »
1. Single file – Replaces Oracle with Naikhawk ‘{gsub(“Oracle”,”Naikh”,$0); print > FILENAME }’ *.txt
2. Multiple Files – Replaces Oracle with Naikhawk ‘{gsub(“Oracle”,”Naikh”,$0); print > FILENAME }’ *.txt
3. All the file which contains a patternawk ‘{gsub(“Oracle”,”Naikh”,$0); print > FILENAME }’ `find . exec grep -l “Oracle” {} \;
Note: Below command will not workfind . exec grep [...]