Aix 5.3ÏÂ×Ô¶¯±¸·ÝOracle¶à¸öʵÀý£¬²¢ÉÏ´«ÖÁFTP·þÎñÆ÷
Ò»¡¢Ð½¨databack.shÎļþ£¬´æ·ÅĿ¼/opt/databack/
#Êý¾Ý¿âÓû§×ÊÁÏ
USERNAME=Êý¾Ý¿âÓû§Ãû(ÐÅÏ¢Òþ²Ø)
PASSWORD=Êý¾Ý¿âÃÜÂë(ÐÅÏ¢Òþ²Ø)
#FTP·þÎñÆ÷ÐÅÏ¢
FTP_SERV=FTP·þÎñÆ÷(ÐÅÏ¢Òþ²Ø)
FTP_USER=FTPÓû§Ãû(ÐÅÏ¢Òþ²Ø)
FTP_PASS=FTPÃÜÂë(ÐÅÏ¢Òþ²Ø)
FTP_DIR=FTPĿ¼(ÐÅÏ¢Òþ²Ø)
#±¸·ÝĿ¼
BACKUP_DIR=/opt/databack
#¸ñʽ»¯ÈÕÆÚ
DATE=`date +%Y%m%d`
#¶¨ÒåÈý¸öʵÀý
EXP1=µÚÒ»¸öORACLEʵÀýÃû³Æ(ÐÅÏ¢Òþ²Ø)
EXP2=µÚ¶þ¸öORACLEʵÀýÃû³Æ(ÐÅÏ¢Òþ²Ø)
EXP3=µÚÈý¸öORACLEʵÀýÃû³Æ(ÐÅÏ¢Òþ²Ø)
#¿ªÊ¼±¸·ÝµÚÒ»¸öʵÀý
export ORACLE_SID=${EXP1}
if [ -f ${BACKUP_DIR}/${EXP1}/${EXP1}_${DATE}.dmp ]; then
echo exp ${EXP1} `date +%Y-%m-%d` backup file already exists.
else
exp ${USERNAME}/${PASSWORD} file=${BACKUP_DIR}/${EXP1}/${EXP1}_${DATE}.dmp
fi
#×¢ÊÍ£ºÈç¹û±¸·ÝĿ¼Ï´æÔÚµ±Èյı¸·ÝÎļþ£¬ÔòÊä³ö“ÎļþÒÑ´æÔÚ”µÄÌáʾÐÅÏ¢£¬Èç¹ûûÓУ¬Ôò±¸·ÝÎļþ¡£
#¿ªÊ¼±¸·ÝµÚ¶þ¸öʵÀý
export ORACLE_SID=${EXP2}
if [ -f ${BACKUP_DIR}/${EXP2}/${EXP2}_${DATE}.dmp ]; then
echo exp ${EXP2} `date +%Y-%m-%d` backup file already exists.
else
exp ${USERNAME}/${PASSWORD} file=${BACKUP_DIR}/${EXP2}/${EXP2}_${DATE}.dmp
fi
#¿ªÊ¼±¸·ÝµÚÈý¸öʵÀý
export ORACLE_SID=${EXP3}
if [ -f ${BACKUP_DIR}/${EXP3}/${EXP3}_${DATE}.dmp ]; then
echo exp ${EXP3} `date +%Y-%m-%d` backup file already exists.
else
exp ${USERNAME}/${PASSWORD} file=${BACKUP_DIR}/${EXP3}/${EXP3}_${DATE}.dmp
fi
#¿ªÊ¼ÉÏ´«±¸·ÝÎļþ
ftp -n $FTP_SERV <<AUTO_FTP
user $FTP_USER $FTP_PASS
passive
binary
cd $FTP_DIR
cd ${EXP1}
put ${BACKUP_DIR}/${EXP1}/${EXP1}_${DATE}.dmp ${EXP1}_${DATE}.dmp
cd ../${EXP2}
put ${BACKUP_DIR}/${EXP2}/${EXP2}_${DATE}.dmp ${EXP2}_${DATE}.dmp
cd ../${EXP3}
put ${BACKUP_DIR}/${EXP3}/${EXP3}_${DATE}.dmp ${EXP3}_${DATE}.dmp
AUTO_FTP
¶þ¡¢½«databack.sh¼ÓÈëµ½¼Æ»®ÈÎÎñÖÐ
$crontab -e [»Ø³µ]
* 18 * * * /opt/databack/databack.sh
#×¢ÊÍ£ºÃ¿ÌìÍí18µãÔËÐд˱¸·Ý³ÌÐò¡£
PS£º´Ë×Ô¶¯±¸·Ý½Å±¾ÔÚAIX 5.3ºÍCentOS
Ïà¹ØÎĵµ£º
NULLÖ¸µÄÊÇ¿ÕÖµ£¬»òÕß·Ç·¨Öµ¡£
NVL (expr1, expr2)->expr1ΪNULL£¬·µ»Øexpr2£»²»ÎªNULL£¬·µ»Øexpr1¡£×¢ÒâÁ½ÕßµÄÀàÐÍÒªÒ»ÖÂ
NVL2 (expr1, expr2, expr3) ->expr1²»ÎªNULL£¬·µ»Øexpr2£»ÎªNULL£¬·µ»Øexpr3¡£expr2ºÍexpr3ÀàÐͲ»Í¬µÄ»°£¬expr3»áת»»Îªexpr2µÄÀàÐÍ
NULLIF (expr1, expr2) ->ÏàµÈ·µ»ØNULL£¬²»µÈ·µ»Øex ......
select * from (select t.*,rownum rn from (select * from emp) t where rownum<=10) where rn>=6;
´´½¨·ÖÒ³½á¹û¼¯µÄÓαê
create or replace package fenyepackage as
type testcursor is ref cursor;
end fenyepackage;
´´½¨·ÖÒ³´æ´¢¹ý³Ì
create or replace procedure fenye3(
tableName varchar2, --±íÃû
......
Oracle ´¥·¢Æ÷ÓÐÓï¾ä¼¶´¥·¢Æ÷ºÍÐм¶´¥·¢Æ÷
Óï¾ä¼¶´¥·¢Æ÷ µ±É¾³ý²¿ÃűíÖеIJ¿ÃźÅʱ£¬Í¬Ê±É¾³ýµôÔ±¹¤±íÖв¿ÃźÅΪ£ºold.deptnoµÄ¼Ç¼
create or replace trigger del_dept_id
after delete on dept
for each row
begin
delete from emp where deptno=:old.deptno;
end;
µ±Íù²¿Ãűí²åÈëʱ£¬Í¬Ê±ÔÚÔ±¹¤±íÖ ......
תÌû´¦£ºhttp://dong-java.javaeye.com/blog/375150
1¡£ÍƼöʹÓÃOralce±È½ÏеÄ10.2.0.3 JDBC Drivers¡£Õâ¸ö°æ±¾¶Ô±È9.2µÄ×î´óµÄºÃ´¦ÊÇDriverManager.setLoginTimeoutº¯ÊýÊÇÆð×÷Óõġ£ÉèÖÃÁËÕâ¸ö²ÎÊý£¬ÔÚ¶ñÁÓµÄÍøÂç»·¾³ÖоͲ»»áÓÐÁ¬½ÓÊý¾Ý¿âµÄº¯Êý³¤Ê±¼ä²»·µ»ØµÄÇé¿ö¡£
2¡£JDBC Developer!ˉs Guide and Refer ......
oracle ÖУ¬¶ÔÓÚÒ»¸öÌá½»µÄsqlÓï¾ä,´æÔÚÁ½ÖÖ¿ÉÑ¡µÄ½âÎö¹ý³Ì, Ò»ÖÖ½Ð×öÓ²½âÎö,Ò»ÖÖ½Ð×öÈí½âÎö.
Ò»¸öÓ²½âÎöÐèÒª¾½âÎö,Öƶ¨Ö´Ðз¾¶,ÓÅ»¯·ÃÎʼƻ®µÈÐí¶àµÄ²½Öè.Ó²½âÊͲ»½ö½öºÄ·Ñ´óÁ¿µÄcpu£¬¸üÖØÒªµÄÊÇ»áÕ¼¾ÝÖØÒªµÄÃÇãÅ£¨latch£©×ÊÔ´£¬ÑÏÖصÄÓ°ÏìϵͳµÄ¹æÄ£µÄÀ©´ó£¨¼´ÏÞÖÆÁËϵͳµÄ²¢·¢ÐУ©£¬ ¶øÇÒÒýÆðµÄÎÊÌâ ......