常用命令,解决方案

问:公司里的oracle数据库有20G之大(那是三个方案的大小.原本那么些方案有30G,笔者早已把能删的数额都删了卡塔尔国,怎么备份?感觉备份贰回好慢啊.行家有怎么着指引一下的呢?(另:20G的数据库是或不是备份也要20G如此?卡塔尔(قطر‎小编希望能周周备份贰次,最佳每一日叁遍.

备份数据库:

答:方法风姿罗曼蒂克:首要推荐供给在UNIX下开创三个管道(只开创二回就可以卡塔尔:

显示RMAN配置 

$mknod ./exp_pipe p $ ls -l exp_pipe prw-rw-r– 1 report group 0 Mar
17 05:20 exp_pipe

RMAN>show all;

接下来经过管道,将EXP导出的多寡直接压缩,注意:上面二行要写在同三个shell脚本中。

 RMAN configuration parameters are:
 CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
 CONFIGURE BACKUP OPTIMIZATION OFF; # default
 CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
 CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
 CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F’;
# default
 CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; #
default
 CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
 CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; #
default
 CONFIGURE CHANNEL DEVICE TYPE DISK FORMAT
  ‘/u01/app/oracle/rmanbak/df_%d_%U’;
 CONFIGURE MAXSETSIZE TO UNLIMITED; # default
 CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
 CONFIGURE ENCRYPTION ALGORITHM ‘AES128’; # default
 CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO
‘/u01/app/oracle/10g/dbs/snapcf_orcl.f’; # default

compress ./exp_pipe ./tmp_now.dmp.Z

RMAN> backup database format
‘/u01/app/oracle/oradata/rman/%s_%d_%U’; –备份整个数据库

exp user/passwd@数据库连接串 file=./exp_pipe direct=y compress=no
log=./exp.log

RMAN> backup as compressed
backupset database format
‘/u01/app/oracle/oradata/rman/%s_%d_%U’; –备份整个数据库并压缩备份集

20G的DMP文件,压缩后的大小在4G左右。

RMAN> run{ 
2> allocate channel ch1 type
disk maxpiecesize=2g;–内定二个通道 并设置最大切丝大小为2g
永利皇宫登录网址 ,3> backup as compressed
backupset format ‘/u01/app/oracle/oradata/rman/%U_%d_%s’ filesperset=3
database;–备份数据库并减削到内定文件夹,备份聚集允许容纳2个文件
4> release channel
ch1;–释放通道
5> }

网站地图xml地图