ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 庫備份及設置

庫備份及設置

原创 Linux操作系统 作者:janeting 时间:2009-03-17 13:10:20 0 删除 编辑

Rman修改的參數(版本10gR2):

CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '/u09/rman/controlfile/%F';
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT   '/u09/rman/rmanfile/%d_%T_%s_%p.dbfbk' MAXPIECESIZE
4096 M;
CONFIGURE MAXSETSIZE TO UNLIMITED;

Rman備份:

#Rman backup level 0

backup incremental level 0 database;

backup archivelog from time 'sysdate-1'; #until time 'sysdate';

exit;

#Rman backup level 1

backup incremental level 1 database;

backup archivelog from time 'sysdate-1'; #until time 'sysdate';

exit;

 

expdp備份:

export ORACLE_SID=qhdb01

export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1

export PATH=.:$ORACLE_HOME/bin:$PATH:.

action_time=`date +%Y_%m_%d`

echo action time:$action_time

filename=expdp_qhdb01_$action_time.dmp

logname=expdp_qhdb01_$action_time.log

expdp system/sysoak content=all full=y directory=dump dumpfile=$filename logfile=$logname parallel=4

cd /u09/dump/dumpfile/

tar -czvf expdp_qhdb01_$action_time.tar.gz $filename $logname

rm $filename

rm $logname

設置數據庫開機自動啟動:

vi /etc/rc.local

su - oracle -c "/bin/sh ~/.dbstart.sh"

#!bin/sh

vi  ~/.dbstart.sh

export ORACLE_SID=qhdb01

export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1

export PATH=$ORACLE_HOME/bin:$PATH

lsnrctl start

sqlplus / as sysdba << EOF

startup

exit

EOF

在sqlplus中顯示如下前綴:username@database:SQL>

vi /u01/app/oracle/product/10.1.0/db_1/sqlplus/admin/glogin.sql 并添加如下行:
set linesize 123
set pagesize 60
set sqlprompt "_user'@'_connect_identifier:SQL> "

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/13023909/viewspace-569151/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-09-12

  • 博文量
    22
  • 访问量
    49102