Daily Archives: August 7, 2006

RS232线居然有不同的类型

做UPS与电脑相连,使电脑监控UPS而做出反映。通过RS232端口连接山特UPS c10k到电脑的COM1上,改正电脑COM1的波特率为2400bps后,居然还是不工作。亮子打800咨询电话,告之看相连的RS232线是平行型的,还是交叉型。连接山特(Santak)的需要平行型的。又长新知识了,原来这线也有不同类型的,仔细看线的两个端口,公母两端果真都有数字编号,字真够小的。从某数字出来的,到那头也是该数字,被称为平行型的。我拿在手里的两根全部是交叉型的!

Oracle的自动备份

将以下内容保存为 OracleExportAutomata.bat,运行即可。可以与Windows计划任务联合使用,比如每天3:00am运行一次。

@echo off
echo ———–
echo name: Oracle data export automata utility
echo author: WANG Liangxu
echo date: 2006-8-7
echo refined by NAN Zhuotong
echo documented by NAN Zhuotong
echo Any problem please contact us via [email protected]; [email protected]

REM This program is used to export data in Oracle to external files named with current date.
REM A simple export schema is employed. Monday the data will be completely exported.
REM Tuesday through Thursday data will be exported in an incremental manner.
REM Friday, data exported include all the incremental data since the last completed export.
REM Saturday and Sunday incremental export will be employed once more.

REM This program can be used together with Windows plan and task utility. In that way,
REM the program can be enhanced with running by schedule.

echo ———–
set w=%date:~13,1%
set d=%date:~0,4%%date:~5,2%%date:~8,2%
rem echo %d%
if %w%==一 goto 1
if %w%==二 goto 2
if %w%==三 goto 3
if %w%==四 goto 4
if %w%==五 goto 5
if %w%==六 goto 6
if %w%==日 goto 7

REM exp system/systemwestdc inctype=complete file=d:/ORADB-BACKUP/20060807.dmp (complete)
REM exp system/systemwestdc inctype=incremental file=d:/ORADB-BACKUP/2006xxxx.dmp
REM exp system/systemwestdc inctype=cumulative file=d:/ORADB-BACKUP/2006xxxx.dmp
REM Mon: 完全备份(A)
REM Tue: 增量导出(B)
REM Wed: 增量导出(C)
REM Thu: 增量导出(D)
REM Fri: 累计导出(E)
REM Sat: 增量导出(F)
REM Sun: 增量导出(G)

:1
 echo Begin exporting data to file %d%-compl.dmp
 exp system/systemwestdc inctype=complete file=d:/ORADB-BACKUP/%d%-compl.dmp
 goto end
:2
 echo Begin exporting data to file %d%-incre.dmp
 exp system/systemwestdc inctype=incremental file=d:/ORADB-BACKUP/%d%-incre.dmp
 goto end
:3
 echo Begin exporting data to file %d%-incre.dmp
 exp system/systemwestdc inctype=incremental file=d:/ORADB-BACKUP/%d%-incre.dmp
 goto end
:4
 echo Begin exporting data to file %d%-incre.dmp
 exp system/systemwestdc inctype=incremental file=d:/ORADB-BACKUP/%d%-incre.dmp
 goto end
:5
 echo Begin exporting data to file %d%-cumul.dmp
 exp system/systemwestdc inctype=cumulative file=d:/ORADB-BACKUP/%d%-cumul.dmp
 goto end
:6
 echo Begin exporting data to file %d%-incre.dmp
 exp system/systemwestdc inctype=incremental file=d:/ORADB-BACKUP/%d%-incre.dmp
 goto end
:7
 echo Begin exporting data to file %d%-incre.dmp
 exp system/systemwestdc inctype=incremental file=d:/ORADB-BACKUP/%d%-incre.dmp
 goto end
:end