ORACLE 数据库自动备份脚本
#! /bin/bash
if [ -f ~/.bashrc ];then
. ~/.bash_profile
fi
export script=/home/oracle/script
export bakdata_destination=/u02/rman_backup/data
export baklog_destination=/u02/rman_backup/log
export datadir=`date +'%Y_%m_%d'`
export days=`date +'%w'`
if ! test -d $script
then
mkdir -p $script
fi
if ! test -d $bakdata_destination
then
mkdir -p $bakdata_destination
fi
if ! test -d $baklog_destination
then
mkdir -p $baklog_destination
fi
if [ $days -eq 1 ];then
#create the directory for datafile
if ! test -e $baklog_destination/failedlog.txt
then
touch $baklog_destination/failedlog.txt
fi
if [ $? = 0 ];then
echo "you is the frist create the failed file"
fi
if ! test -e $baklog_destination/successful.txt
then
touch $baklog_destination/successful.txt
fi
if [ $? = 0 ] ; then
echo "you is the frist creat the successful file"
fi
if ! test -d $bakdata_destination/$datadir
then
mkdir $bakdata_destination/$datadir
fi
if [ $? -eq 1 ]; then
echo "Error :Cann't create the directory,please check the reason! ">>$baklog_destination/failedlog.txt
fi
echo run { >$script/rman_level0.rman
echo "backup incremental level 0 database filesperset = 7 format '"$bakdata_destination/$datadir/bak0_`date '+%Y_%m_%d_%H_%M_%S'`.bak"';" >>$script/rman_level0.rman
echo "sql \"ALTER SYSTEM ARCHIVE LOG CURRENT\"; ">>$script/rman_level0.rman
echo backup archivelog all delete input >>$script/rman_level0.rmanecho "format '"$bakdata_destination/$datadir/arc0_`date '+%Y_%m_%d_%H_%M_%S'`.bak"';" >>$script/rman_level0.rman
echo } &
相关文档:
安装oracle时,由于反复安装卸载,遇到服务没有卸载不能继续安装的问题,从网上找到了资料,怕丢失在此转载一下,内容如下:
如果你也和我一样,用工具创建了一个服务,想删除时却发现删除不掉。或者安装了DameWare Mini Remote 以后(包括自己安装或者机器被黑)在服务里有一个“DameWare Mini Remote Control” ......
1.首先说明一下:
原因是因为我在做这个项目时,被限制得太多,weblogic和oracle的版本不能变,要使用原来的版本。
因此呢。操作起来比较麻烦。而且不能更改原本工程里面的Jar包(它里面存在了oracle14.jar包,但比较旧)
weblogic版本为:8.14
oracle版本为:9i
2.在这里呢,使用hibernate,以流的形式读取到数据里面 ......
第一种:
select * from SOME_TABLE sample(1) where rownum <= 10;
第二种:
select * from (select * from SOME_TABLE order by dbms_random.value) where rownum<=10;
第三种:
select * from (select * from SOME_TABLE order by sys_guid()) where rownum <= 10; ......
总的来说windows下载安装oracle软件比linux下要简单的多。
一.安装oracle 服务端
1.oracle服务器的下载网址如下:
http://www.oracle.com/technology/software/products/database/index.html
然后我选择了下面这个安装包:
Oracle Database 10g Release 2 ( ......