易截截图软件、单文件、免安装、纯绿色、仅160KB

Oracle备份脚本


目标:我想实现这样的功能,只要会简单的linux命令就能实现oracle exp的自动备份
 
环境:linux as3+oracle9i
具体的步骤:
 
1.邮件设置
[root@sxapp1 mail]# cd /etc/mail
[root@sxapp1 mail]# mv submit.cf submit.cfbak
[root@sxapp1 spool]# chmod a+wrx mqueue/
[root@sxapp1 mail]# echo "sdsdssd"|mail -s "sda"westlife_xu@eyou.com
2.建立备份目录
[root@sxapp1 mail]# su - oracle
[oracle@sxapp1 oracle]$ mkdir -p /home/oracle/phy_backup/data --备份文件存放目录
[oracle@sxapp1 oracle]$ mkdir -p /home/oracle/phy_backup/log  --备份的log路径
[oracle@sxapp1 oracle]$ cd /home/oracle/phy_backup
 
3.备份脚本编写,测试(脚本要根据需求微调,我已经测试通过了)
[oracle@sxapp1 phy_backup]$ vi exp.sh
#!/bin/sh
. /home/oracle/.bash_profile
#define variable......
backup_date=`date +%Y%m%d`
bak_home=/home                           --df -k里面必须能看见
backup_dest=/home/oracle/phy_backup/data --根据需要填写
backup_log=/home/oracle/phy_backup/log   --根据需要填写
RECIPT='westlife_xu@eyou.com'            --报警邮件设置
 
--检查磁盘空间
# Check local disk space..................................
USED=` df -k|grep $bak_home|awk '{print $5}'|awk -F% '{print $1}'`
if [ $USED -gt 85 ]; then
       echo "Disk space is full\243\254please check it"|mail -s "exp full backup failed"  $RECIPT
       exit 1
fi
--开始备份
#starting exp backup.....
exp system/abc123 full=y buffer=65536   file=$backup_dest/data_$backup_date.dmp  log=$backup_log/data_$backup_date.log
--删除过期的备份文件
# delete expired  backup ...
list=` find $backup_dest -mtime +7`
echo $list
rm -f $list
if [ $? -ne 0 ]; then
       cat $backup_log/data_$backup_date.log|mail -s


相关文档:

oracle 表空间操作

oracle表空间操作详解
  1
  2
  3作者:   来源:    更新日期:2006-01-04 
  5
  6 
  7建立表空间
  8
  9CREATE TABLESPACE data01
 10DATAFILE '/ora ......

oracle判断对象是否存在

declare    
    v_isexist number(3,0):=0;  
begin  
    select count(1) into v_isexist from sys.all_objects where owner = 'TEST' and object_type = 'TABLE' and object_name = 'TAB1';
    if  v_isexist>0 ......

Oracle数据库还真不好整

从在Linux上安装Oracle到投入使用才几天,碰到的问题就成百上千的。在使用客户端连接远程Oracle数据库服务器时,出现了listener refused the connection with the following error ora-12519 Listener refused the connection with the following error:ORA-12519, TNS:no appropriate service handler foundThe Connection ......

oracle 找出两表之间非重复数据

select r.rollid as rollid from zh1_rool r where r.date_p >=to_date('2009-11-26 23:59:59','yyyy-mm-dd hh24:mi:ss') and rollid not in
(select t.lot_number as rollid
from inv.mtl_onhand_quantities_detail t
left join mtl_system_items_b mi
on t.inventory_item_id = mi.inventory_ ......

ORACLE安装参数说明及注意事项!

原文地址:http://blog.csdn.net/fengyun14/archive/2007/03/25/1540433.aspx
关于Linux 下kernel.shmmax 的设置问题
下面是Oracle 文档上的解释, http://download-west.oracle.com/doc...e.htm#sthref107
SHMMAX Available physical memory Defines the maximum allowable size of one shared memory segment.
The ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号