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 } &
相关文档:
原文地址:http://arvinnan.javaeye.com/blog/308638
参考
http://www.blogjava.net/wxqxs/archive/2008/10/13/237180.html?opt=admin
http://hi.baidu.com/ray315/blog/item/153c97a33cd26caacbefd0de.html
定义
External tables access data in
external s ......
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 ( ......
一、数据库的相关概念
数据库(DB)是一个按数据结构来存储和管理数据的计算机软件系统。
1、数据库管理系统与数据库应用系统
(1)数据库管理系统(Database Management System)
数据库管理系统(DBMS)是专门用于管理数据库的计算机系统软件。数据库管理系统能够为数据库提供数据的定义、建立、维护、查询和统计等操 ......