📄 disable_logging.sh.txt
字号:
#!/usr/bin/ksh################################################################################# Module: disable_logging.sh# Author: Peter R. Schmidt# Description: Disable transaction logging## Change Log## Date Name Description.................# 01/27/01 Peter R. Schmidt Start Program ################################################################################echo "Disable transaction logging"echoecho "Enter DATABASE name"read DATABASEechoecho "It is normally desirable to set TAPEDEV to /dev/null before disabling transaction logging."echoecho "The current value of TAPEDEV is:"onstat -c | egrep "^TAPEDEV"echoecho "Press <Enter> to disable transaction logging now."read answerontape -s -L 0 -N $DATABASEif [ $? = 0 ]then echo echo "Completed" echo echo "Don't forget to set TAPEDEV back to it's original setting" echo "and re-enable transaction logging when you are done with" echo "whatever you are going to do."else echo echo "Error: failed to disable transaction logging!" exit 1fi###############################################################################OUTPUT=dblist.outTMPFILE=dblist.tmpXDATE=`date +%D-%T`MACHINE=`uname -n`if [ -f $OUTPUT ]then rm -f $OUTPUTfiif [ -f $TMPFILE ]then rm -f $TMPFILEfiechoecho "Display current logging status of the databases"echoecho "Collecting database info from the sysmaster database..." dbaccess <<-EOFdatabase sysmaster;unload to '$TMPFILE' delimiter "|"select dbinfo("DBSPACE",partnum) dbspace, name, owner, created, is_logging, is_buff_log, is_ansi, is_nls, flagsfrom sysdatabasesorder by name, dbspace;EOFecho "Completed - creating report..."awk ' \BEGIN { FS="|" cnt_db=0}{ if (NR == 1) { split (xdate,b,"-") udate=b[1] utime=b[2] printf "%s %s Informix Database Report for %s@%s\n\n", udate, utime, server, machine print "Database Dbspace Date Logging Buffered Other" print "Name Name Owner Created Enabled Logging Info" print "" } dbspace = $1 dbsname = $2 owner = $3 created = $4 is_logging = $5 is_buff_log = $6 is_ansi = $7 in_nls = $8 flags = $9 cnt_db++ if (is_logging = 1) { flag_logging = "Y" } else { flag_logging = "N" } if (is_buff_log = 1) { flag_buff_log = "Y" } else { flag_buff_log = "N" } if (flags = 0) { flag_desc = "No Logging" } if (flags = 1) { flag_desc = "Unbuffered Logging" } if (flags = 2) { flag_desc = "Buffered Logging" } if (flags = 4) { flag_desc = "ANSI-compliant database" } if (flags = 8) { flag_desc = "Read-Only Database" } if (flags = 16) { flag_desc = "NLS database" } printf "%-15s %-10s %-10s %-10s %1s %1s %1s\n",dbsname, dbspace, owner, created, flag_logging, flag_buff_log, flag_desc}END { printf "\nTotal of %d databases\n", cnt_db}' xdate=$XDATE machine=$MACHINE server=$INFORMIXSERVER $TMPFILE > $OUTPUTcat $OUTPUTrm -f $TMPFILErm -f $OUTPUT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -