网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
本月文章推荐
.Oracle9i在AIX上的安装.
.oracle中SGA的设置.
.Oracle数据库系统的安全性.
.Oracle10g 数据的导入导出 给数据.
.如何查到oracle dml lock和如何解.
.在Oracle中实现各种日期处理完全.
.关于Oracle日期转换的一点小经验.
.我用的是Redhat Linux,但是我的.
.Oracle数据库中临时表的深入研究.
.(转)Oracle RMAN快速入门指南.
.快速检测Oracle数据库可用性和表.
.在Oracle使用正规表达式编写更好.
.顺利开发数据仓库的七个步骤.
.安装Oracle后使用的修改表空间的.
.Linux 7.1 上的 oracle8.1.7安装.
.oracle怎样在查询记录时给记录加.
.转载:Statspack的安装使用说明.
.Oracle诊断案例3-Spfile案例.
.ORACLE9I中外部表的使用.
.ORACLE常用傻瓜问题1000问(之一).

对Oracle10g ASM生产数据库备份和恢复

发表日期:2008-2-9



  新的10g ASM生产数据库即将上线,以下是上线前做的简单的备份恢复测试:
  
  1.首先执行备份
  
  $ rman target / @full_bak.sql
  
  Recovery Manager: Release 10.1.0.3.0 - 64bit ProdUCtion
  
  Copyright (c) 1995, 2004, Oracle. All rights reserved.
  
  connected to target database: MMSDB (DBID=799462343)
  
  RMAN> run {
  2> backup database plus archivelog delete all input;
  3> delete obsolete;
  4> }
  5>
  
  Starting backup at 13-APR-05
  current log archived
  using target database controlfile instead of recovery catalog
  allocated channel: ORA_DISK_1
  channel ORA_DISK_1: sid=162 devtype=DISK
  channel ORA_DISK_1: starting archive log backupset
  channel ORA_DISK_1: specifying archive log(s) in backup set
  input archive log thread=1 sequence=28 recid=2 stamp=555502358
  channel ORA_DISK_1: starting piece 1 at 13-APR-05
  channel ORA_DISK_1: finished piece 1 at 13-APR-05
  piece handle=/msflsh/MMSDB/backupset/2005_04_13/o1_mf_annnn_TAG20050413T101239_15s00ry0_.bkp
   comment=NONE
  channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
  channel ORA_DISK_1: deleting archive log(s)
  archive log filename=/msflsh/MMSDB/archivelog/2005_04_13/o1_mf_1_28_15s00pg2_.arc recid=2
   stamp=555502358
  Finished backup at 13-APR-05
  
  Starting backup at 13-APR-05
  using channel ORA_DISK_1
  channel ORA_DISK_1: starting full datafile backupset
  channel ORA_DISK_1: specifying datafile(s) in backupset
  input datafile fno=00001 name=+DATADG/mmsdb/datafile/system.259.3
  input datafile fno=00003 name=+DATADG/mmsdb/datafile/sysaux.257.3
  input datafile fno=00002 name=+DATADG/mmsdb/datafile/undotbs1.258.3
  input datafile fno=00004 name=+DATADG/mmsdb/datafile/users.256.3
  channel ORA_DISK_1: starting piece 1 at 13-APR-05
  channel ORA_DISK_1: finished piece 1 at 13-APR-05
  piece handle=/msflsh/MMSDB/backupset/2005_04_13/o1_mf_nnndf_TAG20050413T101242_15s00thq_.bkp
   comment=NONE
  channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15
  Finished backup at 13-APR-05
  
  Starting backup at 13-APR-05
  current log archived
  using channel ORA_DISK_1
  channel ORA_DISK_1: starting archive log backupset
  channel ORA_DISK_1: specifying archive log(s) in backup set
  input archive log thread=1 sequence=29 recid=3 stamp=555502377
  channel ORA_DISK_1: starting piece 1 at 13-APR-05
  channel ORA_DISK_1: finished piece 1 at 13-APR-05
  piece handle=/msflsh/MMSDB/backupset/2005_04_13/o1_mf_annnn_TAG20050413T101257_15s01bwm_.bkp
  comment=NONE
  channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
  channel ORA_DISK_1: deleting archive log(s)
  archive log filename=/msflsh/MMSDB/archivelog/2005_04_13/o1_mf_1_29_15s019mj_.arc recid=3
  stamp=555502377
  Finished backup at 13-APR-05
  
  Starting Control File and SPFILE Autobackup at 13-APR-05
  piece handle=/msflsh/MMSDB/autobackup/2005_04_13/o1_mf_s_555502380_15s01df2_.bkp
  comment=NONE
  Finished Control File and SPFILE Autobackup at 13-APR-05
  
  RMAN retention policy will be applied to the command
  RMAN retention policy is set to redundancy 2
  using channel ORA_DISK_1
  no obsolete backups found
  
  Recovery Manager complete.
  
  2.冻结HA,停止数据库进行恢复
  
  $ id
  uid=101(oracle) gid=101(dba)
  $ exit
  # id
  uid=0(root) gid=1(other)
  # hagrp -freeze MMSDB -persistent
  # su - oracle
  Sun Microsystems Inc.  SunOS 5.8    Generic Patch  October 2001
  You have new mail.
  $ id
  uid=101(oracle) gid=101(dba)
  $ sqlplus "/ as sysdba"
  
  SQL*Plus: Release 10.1.0.3.0 - Production on Wed Apr 13 10:19:28 2005
  
  Copyright (c) 1982, 2004, Oracle. All rights reserved.
  
  Connected to:
  Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
  With the Partitioning and Data Mining options
  
  SQL> shutdown immediate;

  Database closed.
  Database dismounted.
  ORACLE instance shut down.
  SQL> exit
  Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
  With the Partitioning and Data Mining options
  
  3.执行恢复
  
  $ rman target /
  
  Recovery Manager: Release 10.1.0.3.0 - 64bit Production
  
  Copyright (c) 1995, 2004, Oracle. All rights reserved.
  
  connected to target database (not started)
  
  RMAN> startup mount;
  
  Oracle instance started
  database mounted
  
  Total System Global Area  3204448256 bytes
  
  Fixed Size           1304912 bytes
  Variable Size        651957936 bytes
  Database Buffers      2550136832 bytes
  Redo Buffers          1048576 bytes
  
  RMAN> restore database;
  Starting restore at 13-APR-05
  using target database controlfile instead of recovery catalog
  allocated channel: ORA_DISK_1
  channel ORA_DISK_1: sid=160 devtype=DISK
  
  channel ORA_DISK_1: starting datafile backupset restore
  channel ORA_DISK_1: specifying datafile(s) to restore from backup set
  restoring datafile 00001 to +DATADG/mmsdb/datafile/system.259.3
  restoring datafile 00002 to +DATADG/mmsdb/datafile/undotbs1.258.3
  restoring datafile 00003 to +DATADG/mmsdb/datafile/sysaux.257.3
  restoring datafile 00004 to +DATADG/mmsdb/datafile/users.256.3
  channel ORA_DISK_1: restored backup piece 1
  piece handle=/msflsh/MMSDB/backupset/2005_04_13/o1_mf_nnndf_TAG20050413T101242_15s00thq_.bkp
  tag=TAG20050413T101242
  channel ORA_DISK_1: restore complete
  Finished restore at 13-APR-05
  
  RMAN> recover database;
  Starting recover at 13-APR-05
  using channel ORA_DISK_1
  
  starting media recovery
  media recovery complete
  
  Finished recover at 13-APR-05
  
  RMAN> alter database open;
  database opened
  
  RMAN>
  
  4.最后不要忘记解冻HA
  
  $ exit
  # id
  uid=0(root) gid=1(other)
  # hagrp -unfreeze MMSDB -persistent
  
  测试过程,仅供参考.
上一篇:观察目前谁在使用RBS 人气:549
下一篇:找出哪些table没有primary key 人气:731
浏览全部Oracle教程的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐