Nếu khi nào account oracle không đổi password trong vòng 3 tháng thì nó sẽ bị lock password (dbaviet01)
- Để kiểm tra thì dùng lệnh này (nếu số lần failure > 0 là bị lock):
# dcli -g /root/dbs -l root "pam_tally2 -u oracle"
# dcli -g /root/dbs -l root "pam_tally2 -u grid"
- Trước tiên clear khi bị lock
$ dcli -g /root/dbs -l root "pam_tally2 -r -u oracle"
- Sau đó đổi mật khẩu oracle, root
#cd /root
./pass_change.sh
[root@dbaviet01 pam.d]# grep tally2 *
login:auth required pam_tally2.so deny=5 onerr=fail lock_time=600
sshd:auth required pam_tally2.so deny=5 onerr=fail lock_time=600
[root@dbaviet01 pam.d]# pwd
/etc/pam.d
******
-- Đổi mật khẩu
[root@golddb01 ~]# more pass_change.sh
#!/bin/sh
######################################
# File :"pass_change.sh" Version:1.0
# Purpose :To change the password of OS users and oracle database users in
# exadata server
# Author :Siva.R.Samy@oracle.com Date :27/Jul/2009
# Desc : 1. This script uses the /home/oracle/dbs, all_group, cell_group for dcli commands
# 2. The output of the commands for password change is under /tmp directory
# 3. This script must be used only in exadata severs and that too for
# oracle db/asm sys password you can run in database machine only
# 4.
#####################################
rm_mailfile()
{
# Email text/message
EMAILMESSAGE="/tmp/emailmessage.txt"
rm -f ${EMAILMESSAGE}
}
get_country(){
HT=`hostname | cut -c1,2`
case $HT in
sg)
COUNTRY=Singapore;;
kr)
COUNTRY=Korea;;
in)
COUNTRY=India;;
au)
COUNTRY=Australia;;
*)
COUNTRY=$HT;;
esac
echo -n "You are about to change password of the $COUNTRY Exadata servers. Do you want to proceed. (y/n) : "
read COUNTRY_PROCEED
if ! [ "${COUNTRY_PROCEED}" = "Y" -o "${COUNTRY_PROCEED}" = "y" -o "${COUNTRY_PROCEED}" = "yes" ];then
echo Quiting...
exit 0;
fi
}
db_asm_sys_passwd_routine()
{
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_HOME PATH ORACLE_SID
cp $ORACLE_HOME/dbs/orapw${ORACLE_SID} $ORACLE_HOME/dbs/orapw${ORACLE_SID}.old1
orapwd file=$ORACLE_HOME/dbs/orapw${ORACLE_SID} password=${pass400} force=y
HOSTLIST=`cat /home/oracle/dbs | grep -v \`hostname -s \` `
for hostmac in ${HOSTLIST}
do
SID_NUMBER=`echo ${hostmac} | wc -c`
SID_NUMBER=`echo ${hostmac} | cut -c \`expr $SID_NUMBER - 1\` `
scp $ORACLE_HOME/dbs/orapw${ORACLE_SID} ${hostmac}:$ORACLE_HOME/dbs/orapw${db_name}${SID_NUMBER}
done
}
postit()
{
# email subject
SUBJECT="${COUNTRY} Exadata password reset information"
# Email To ?
EMAIL="subhash.guddad@oracle.com"
CCTO="siva.r.samy@oracle.com"
# send an email using /bin/mail
/bin/mail -s "$SUBJECT" "$EMAIL" -c ${CCTO} < $EMAILMESSAGE
}
get_country
rm_mailfile
echo -n "Changing password ????
Which User ????
1. root
2. oracle
3. grid
4. celladmin
5. DB SYS
6. ASM SYS
7. root DB machine only
8. root cell node only
Please enter the option : "
read USER_CHOOSED
case ${USER_CHOOSED} in
1)
echo -n "
Please enter the password : "
stty -echo; read pass100; stty echo; echo "";
dcli -g /home/oracle/all_group -l root "echo \"${pass100}\" | passwd --stdin root" > /tmp/pass_root_all.txt 2>&1
cat /tmp/pass_root_all.txt
echo "root password changed for all the db and cell nodes."
echo "root password changed for all the db and cell nodes." >> ${EMAILMESSAGE}
echo "root password is $pass100" >> ${EMAILMESSAGE}
;;
2)
echo -n "
Please enter the password : "
stty -echo; read pass200; stty echo; echo "";
dcli -g /home/oracle/dbs -l root "echo \"${pass200}\" | passwd --stdin oracle" > /tmp/pass_oracle_result.txt 2>&1
cat /tmp/pass_oracle_result.txt
echo "oracle password changed for all the db nodes."
echo "oracle password changed for all the db nodes." >> ${EMAILMESSAGE}
echo "oracle password is ${pass200}" >> ${EMAILMESSAGE}
;;
3)
echo -n "
Please enter the password : "
stty -echo; read pass200; stty echo; echo "";
dcli -g /home/oracle/dbs -l root "echo \"${pass200}\" | passwd --stdin grid" > /tmp/pass_grid_result.txt 2>&1
cat /tmp/pass_grid_result.txt
echo "grid password changed for all the db nodes."
echo "grid password changed for all the db nodes." >> ${EMAILMESSAGE}
echo "grid password is ${pass200}" >> ${EMAILMESSAGE}
;;
4)
echo -n "
Please enter the password : "
stty -echo; read pass300; stty echo; echo "";
dcli -g /home/oracle/cell_group -l root "echo \"${pass300}\" | passwd --stdin celladmin" > /tmp/pass_celladmin.txt 2>&1
cat /tmp/pass_celladmin.txt
echo "celladmin password changed for all the cell nodes."
echo "celladmin password changed for all the cell nodes." >> ${EMAILMESSAGE}
echo "celladmin password is ${pass300}" >> ${EMAILMESSAGE}
;;
5)
echo -n "
enter the db_name : "
read db_name
echo -n "
enter the oracle_home (default=/u01/app/oracle/product/11.1.0/db_1) : "
read ORACLE_HOME
ORACLE_HOME=${ORACLE_HOME:-"/u01/app/oracle/product/11.1.0/db_1"}
echo -n "
Please enter the password : "
stty -echo; read pass400; stty echo; echo "";
LOCAL_SID_NUMBER=`hostname -s | wc -c`
LOCAL_SID_NUMBER=`hostname -s | cut -c \`expr $LOCAL_SID_NUMBER - 1\` `
ORACLE_SID=${db_name}${LOCAL_SID_NUMBER}
db_asm_sys_passwd_routine
echo "SYS password changed for database <${db_name}>"
echo "SYS password changed for database <${db_name}>" >> ${EMAILMESSAGE}
echo "SYS password for database ${db_name} is $pass400" >> ${EMAILMESSAGE}
;;
6)
LOCAL_SID_NUMBER=`hostname -s | wc -c`
LOCAL_SID_NUMBER=`hostname -s | cut -c \`expr $LOCAL_SID_NUMBER - 1\` `
ORACLE_SID=+ASM${LOCAL_SID_NUMBER}
echo -n "
enter the oracle_home (default=/u01/app/oracle/product/11.1.0/asm) : "
read ORACLE_HOME
ORACLE_HOME=${ORACLE_HOME:-"/u01/app/oracle/product/11.1.0/asm"}
echo -n "
Please enter the password : "
stty -echo; read pass500; stty echo; echo "";
db_asm_sys_passwd_routine
echo "SYS password changed for ASM"
echo "SYS password changed for ASM " >> ${EMAILMESSAGE}
echo "SYS password for ASM is $pass500 " >> ${EMAILMESSAGE}
;;
7)
echo -n "
Please enter the password : "
stty -echo; read pass600; stty echo; echo "";
dcli -g /home/oracle/dbs -l root "echo \"${pass600}\" | passwd --stdin root" > /tmp/pass_root_db.txt 2>&1
cat /tmp/pass_root_db.txt
echo "root password changed for all the db nodes."
echo "root password changed for all the db nodes." >> ${EMAILMESSAGE}
echo "root password for dbnodes is $pass600" >> ${EMAILMESSAGE}
;;
8)
echo -n "
Please enter the password : "
stty -echo; read pass700; stty echo; echo "";
dcli -g /home/oracle/cell_group -l root "echo \"${pass700}\" | passwd --stdin root" > /tmp/pass_root_cell.txt 2>&1
cat /tmp/pass_root_cell.txt
echo "root password changed for all the cell nodes."
echo "root password changed for all the cell nodes." >> ${EMAILMESSAGE}
echo "root password changed for cell nodes is $pass700 " >> ${EMAILMESSAGE}
;;
*)
;;
esac
postit
rm_mailfile
* KHOÁ HỌC ORACLE DATABASE A-Z ENTERPRISE trực tiếp từ tôi giúp bạn bước đầu trở thành những chuyên gia DBA, đủ kinh nghiệm đi thi chứng chỉ OA/OCP, đặc biệt là rất nhiều kinh nghiệm, bí kíp thực chiến trên các hệ thống Core tại VN chỉ sau 1 khoá học.
* CÁCH ĐĂNG KÝ: Gõ (.) hoặc để lại số điện thoại hoặc inbox https://m.me/tranvanbinh.vn hoặc Hotline/Zalo 090.29.12.888
* Chi tiết tham khảo:
https://bit.ly/oaz_w
=============================
KẾT NỐI VỚI CHUYÊN GIA TRẦN VĂN BÌNH:
📧 Mail: binhoracle@gmail.com
☎️ Mobile: 0902912888
⚡️ Skype: tranbinh48ca
👨 Facebook: https://www.facebook.com/BinhOracleMaster
👨 Inbox Messenger: https://m.me/101036604657441 (profile)
👨 Fanpage: https://www.facebook.com/tranvanbinh.vn
👨 Inbox Fanpage: https://m.me/tranvanbinh.vn
👨👩 Group FB: https://www.facebook.com/groups/DBAVietNam
👨 Website: https://www.tranvanbinh.vn
👨 Blogger: https://tranvanbinhmaster.blogspot.com
🎬 Youtube: http://bit.ly/ytb_binhoraclemaster
👨 Tiktok: https://www.tiktok.com/@binhoraclemaster?lang=vi
👨 Linkin: https://www.linkedin.com/in/binhoracle
👨 Twitter: https://twitter.com/binhoracle
👨 Địa chỉ: Tòa nhà Sun Square - 21 Lê Đức Thọ - Phường Mỹ Đình 1 - Quận Nam Từ Liêm - TP.Hà Nội
=============================
học oracle database, Tự học Oracle, Tài liệu Oracle 12c tiếng Việt, Hướng dẫn sử dụng Oracle Database, Oracle SQL cơ bản, Oracle SQL là gì, Khóa học Oracle Hà Nội, Học chứng chỉ Oracle ở đầu, Khóa học Oracle online,khóa học pl/sql, học dba, học dba ở việt nam, khóa học dba, khóa học dba sql, tài liệu học dba oracle, Khóa học Oracle online, học oracle sql, học oracle ở đâu tphcm, học oracle bắt đầu từ đâu, học oracle ở hà nội, oracle database tutorial, oracle database 12c, oracle database là gì, oracle database 11g, oracle download, oracle database 19c, oracle dba tutorial, oracle tunning, sql tunning , oracle 12c, oracle multitenant, Container Databases (CDB), Pluggable Databases (PDB), oracle cloud, oracle security, oracle fga, audit_trail, oracle dataguard, oracle goldengate, mview, oracle exadata, oracle weblogic, middleware, hoc solaris, hoc linux, hoc aix, unix, oracle oca, oracle ocp, oracle ocm