文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>rman总结zt日记 [2006年08月17日]

rman总结zt日记 [2006年08月17日]

时间:2006-08-17  来源:boean

  rman作为oracle备份最为方便的工具,以下就总结几条常用的命令,希望能方便大家,也希望可以申请授权:
                  1、首先使用rman前,需要建一个目录数据库
                  2、create tablespce rman datafile '/data/oradata/test/rman.dbf'
                  size 20m;
                  3、create user rman identified by rman default tablespace rman
                  temporary tablespace temp;
                  4、grant connect,resource,recovery_catalog_ower to rman;
                  以上建库和建用户基本成功,接着:
                  1、rman target sys/manager@ora8 catalog rman/rman@rman
                  2、register database (同步数据库,如果数据库做了alter database open
                  resetlogs,就需要reset database,如果有库结构变化,就需要
                  resync catalog)
                  3、create script back {
                  allocate channel n1 type disk;
                  backup database
                  format '/data/backup/ora8_%d_%s_%p';
                  release channel n1;}
                  4、如果是备份固定的文件或表空间也可以
                  create script back_file{
                  allocate channel n1 type disk;
                  copy 
                  datafile 4 to '/data/backup/users.dbf';
                  release channel n1;}
                  create script back_tablespace{
                  allocate channel m1 type disk;
                  backup tablespace users
                  format '/data/backup/users_%t_%s_%p';
                  release channel n1;}
                  使用copy就是文件镜像保存,使用backup就是用oracle专有的格式保存,支持压缩等等,此处就不细说了!
                  5、执行备份
                  run{execute script back;}
                  等等!
                  以上说了备份数据库,下面是恢复数据库
                  1、rman target sys/manager@ora8 catalog rman/rman@rman
                  2、run{
                  allcote channel n1 type disk;
                  sql "alter tablespce users offline immediate";
                  restore tablespace users;
                  recover tablespace users;
                  sql "alter tablespace user online";
                  release channel n1;}
                  3、run{
                  allocate channel n1 type disk;
                  restore database;
                  recover database;
                  sql "alter database open resetlogs";
                  release channel n1;}
                  4、run{
                  allocate channel n1 type disk;
                  restore datafile 4;
                  release channel n1;}
                  以上都是一些基本的rman操作,如有错误之处,希望被指出。
相关阅读 更多 +
排行榜 更多 +
茶叶蛋大冒险免费版

茶叶蛋大冒险免费版

休闲益智 下载
全民帮帮她

全民帮帮她

休闲益智 下载
屋顶旅行

屋顶旅行

休闲益智 下载