动态网站制作指南 [  QQ表情  ]
[ 投票调查 ]
[ 企业邮箱 ]
[ 网站空间 ]
网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
ASP源码 | .Net源码 | PHP源码 | JSP源码 | JAVA源码 | CGI源码 | VB源码 | C++源码 | Delphi源码 | PB源码 | VF源码 | 汇编 | 服务器
电脑书籍下载:程序设计书籍 | 数据库教程书籍 | 平面与多媒体书籍 | 网络通讯书籍 | 系统管理书籍 | 网络安全书籍 | 认证考试书籍
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教程,数据库安全,数据库文摘
文章搜索服务
邮件订阅
输入你的邮件地址,
你将不会错过任何关于:
[ Oracle教程 ]的信息



本月文章推荐
.前高管曝甲骨文内幕:走马换将渠.
.Oracle 8i概述.
.实例讲解批处理程序突然变慢的解.
.逻辑数据模型到物理数据模型的转.
.standby利用并行恢复提高归档恢复.
.Oracle 数据库缓冲区溢出漏洞.
.如何避免Oracle数据库中密码出现.
.oracle中Decode()函数使用技巧的.
.Oracle9i初始化参数中文说明(13).
.Delphi中BDE直连方式访问Oracle的.
.在ORalce 中,怎么判断两个时间段.
.[HOWTO]ORACLE中如何实现ASC字符.
.使用参照完整性来加强基本商业规.
.Oracle常見問題集(三).
.一条有用的sql文(ORACLE).
..
.如何在Oracle的报警日志添加自定.
.Oracle 9i新特性之细粒度访问原则.
.JDBC+Hibernate将Blob数据写入Or.
.用Oracle数据表绑定DataGrid.

oracle9i中Rman的备份使用点滴

发表日期:2008-2-9 |



  rman的简单使用: catalog的建立,全备份,保留备份策略,删除过期备份。
  
  1. 查看当前数据库的数据文件
  
  SQL> select name from V$datafile;
  
  NAME
  --------------------------------------------------------------------------------
  /Oracle/oracle9i/oradata/testmysiteok/system01.dbf
  /oracle/oracle9i/oradata/testmysiteok/undotbs01.dbf
  /oracle/oracle9i/oradata/testmysiteok/cwmlite01.dbf
  /oracle/oracle9i/oradata/testmysiteok/drsys01.dbf
  /oracle/oracle9i/oradata/testmysiteok/example01.dbf
  /oracle/oracle9i/oradata/testmysiteok/indx01.dbf
  /oracle/oracle9i/oradata/testmysiteok/odm01.dbf
  /oracle/oracle9i/oradata/testmysiteok/tools01.dbf
  /oracle/oracle9i/oradata/testmysiteok/users01.dbf
  /oracle/oracle9i/oradata/testmysiteok/xdb01.dbf
  /oracle/oradata/webdb_file1.dbf
  
  NAME
  --------------------------------------------------------------------------------
  /oracle/oradata/webdb_file2.dbf
  /oracle/oradata/webdb_file3.dbf
  /oracle/oradata/webdb_file4.dbf
  
  14 rows selected.
  
  2. 建立catalog表空间为back_up
  
  SQL> create tablespace back_up datafile '/oracle/oradata/catalog.dbf' size 50m;
  
  Tablespace created.
  
  3. 建立rman用户密码为rman,rman默认的表空间为back_up,使用临时表空间temp
  
  SQL> create user rman identified by rman default tablespace back_up temmporary tablespace temp;
  create user rman identified by rman default tablespace back_up temmporary tablespace temp
                                  *
  ERROR at line 1:
  ORA-00922: missing or invalid option
  
  SQL> create user rman identified by rman default tablespace back_up temporary tablespace temp;
  
  User created.
  
  4. 给rman用户授权
  
  SQL> grant connect,resource,recovery_catalog_owner to rman;
  
  Grant sUCceeded.
  
  SQL> quit
  Disconnected from Oracle9i Enterprise Edition Release 9.2.0.1.0 - 64bit Production
  With the Partitioning, OLAP and Oracle Data Mining options
  JServer Release 9.2.0.1.0 - Production
  
  5. 连接或者创建catalog到表空间 back_up
  
  bash-2.05$ rman
  
  Recovery Manager: Release 9.2.0.1.0 - 64bit Production
  
  Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
  
  RMAN> connect catalog rman/rman;
  
  connected to recovery catalog database
  recovery catalog is not installed
  
  RMAN> create catalog tablespace backup;
  
  RMAN-00571: ===========================================================
  RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  RMAN-00571: ===========================================================
  RMAN-00558: error encountered while parsing input commands
  RMAN-01005: syntax error: found "backup": eXPecting one of: "double-quoted-string, identifier, single-quoted-string"
  RMAN-01007: at line 1 column 27 file: standard input
  
  RMAN-00571: ===========================================================
  RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
  RMAN-00571: ===========================================================
  RMAN-00558: error encountered while parsing input commands
  RMAN-01005: syntax error: found ";": expecting one of: "allocate, alter, backup, beginline, blockrecover, catalog, change, connect, copy, create, crosscheck, configure, duplicate, debug, delete, drop, exit, endinline, host, {, library, list, mount, open, print, quit, recover, register, release, replace, report, renormalize, reset, restore, resync, rman, run, rpctest, set, setlimit, sql, spool, startup, shutdown, send, show, test, upgrade, validate"
  RMAN-01007: at line 1 column 33 file: standard input
  
  RMAN> create catalog tablespace back_up;
  
  recovery catalog created
  
  RMAN> quit
  
  Recovery Manager complete.
  
  6. 连接到sid 为testmysiteok的 catalog上 ,并注册testmysiteok数据库
  
  bash-2.05$ rman target 'testmysiteok' catalog rman/rman
  
  Recovery Manager: Release 9.2.0.1.0 - 64bit Production
  
  Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
  
  target database PassWord:
  connected to target database: testmysiteOK (DBID=3999769622)
  connected to recovery catalog database
  
  RMAN> register database;
  
  database registered in recovery catalog
  starting full resync of recovery catalog
  full resync complete
  
  7. 全备份testmysiteok数据库
  
  RMAN> backup full tag 'testmysiteok' format '/data/ora_backup/testmysiteok_%u_%s_%p' database;
  
  Starting backup at 07-AUG-05
  allocated channel: ORA_DISK_1
  channel ORA_DISK_1: sid=31 devtype=DISK
  channel ORA_DISK_1: starting full datafile backupset
  channel ORA_DISK_1: specifying datafile(s) in backupset
  including current SPFILE in backupset
  including current controlfile in backupset
  input datafile fno=00001 name=/oracle/oracle9i/oradata/testmysiteok/system01.dbf
  input datafile fno=00002 name=/oracle/oracle9i/oradata/testmysiteok/undotbs01.dbf
  input datafile fno=00005 name=/oracle/oracle9i/oradata/testmysiteok/example01.dbf
  input datafile fno=00011 name=/oracle/oradata/webdb_file1.dbf
  input datafile fno=00012 name=/oracle/oradata/webdb_file2.dbf
  input datafile fno=00013 name=/oracle/oradata/webdb_file3.dbf
  input datafile fno=00014 name=/oracle/oradata/webdb_file4.dbf
  input datafile fno=00015 name=/oracle/oradata/catalog.dbf
  input datafile fno=00010 name=/oracle/oracle9i/oradata/testmysiteok/xdb01.dbf
  input datafile fno=00006 name=/oracle/oracle9i/oradata/testmysiteok/indx01.dbf
  input datafile fno=00009 name=/oracle/oracle9i/oradata/testmysiteok/users01.dbf
  input datafile fno=00003 name=/oracle/oracle9i/oradata/testmysiteok/cwmlite01.dbf
  input datafile fno=00004 name=/oracle/oracle9i/oradata/testmysiteok/drsys01.dbf
  input datafile fno=00007 name=/oracle/oracle9i/oradata/testmysiteok/odm01.dbf
  input datafile fno=00008 name=/oracle/oracle9i/oradata/testmysiteok/tools01.dbf
  channel ORA_DISK_1: starting piece 1 at 07-AUG-05
  channel ORA_DISK_1: finished piece 1 at 07-AUG-05
  piece handle=/data/ora_backup/testmysiteok_04grgroc_4_1 comment=NONE
  channel ORA_DISK_1: backup set complete, elapsed time: 00:00:36
  Finished backup at 07-AUG-05
  
  8. 设置保留最近的3次备份
  
  RMAN> configure retention policy to redundancy 3;
  
  old RMAN configuration parameters:
  CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
  new RMAN configuration parameters:
  CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
  new RMAN configuration parameters are successfully stored
  starting full resync of recovery catalog
  full resync complete
  
  9. 查看过期的备份
  
  RMAN> report obsolete;
  
  RMAN retention policy will be applied to the command
  RMAN retention policy is set to redundancy 2
  Report of obsolete backups and copies
  Type         Key  Completion Time  Filename/Handle
  -------------------- ------ ------------------ --------------------
  Backup Set      590  16-OCT-05
   Backup Piece    591  16-OCT-05     /oracle/testmysiteok20051016.dbf
  Archive Log     424  29-SEP-05     /oracle/OraHome/dbs/arch1_56.dbf
  
  10. 查看所有备份
  
  RMAN> list backup;
  
  11. 删除过期备份
  
  RMAN> delete obsolete;
  
  RMAN retention policy will be applied to the command
  RMAN retention policy is set to redundancy 2
  using channel ORA_DISK_1
  Deleting the following obsolete backups and copies:
  Type         Key  Completion Time  Filename/Handle
  -------------------- ------ ------------------ --------------------
  Backup Set      590  16-OCT-05
   Backup Piece    591  16-OCT-05     /oracle/testmysiteok20051016.dbf
  Archive Log     424  29-SEP-05     /oracle/OraHome/dbs/arch1_56.dbf
  
  Do you really want to delete the above objects (enter YES or NO)?
y
  deleted backup piece
  backup piece handle=/oracle/testmysiteok20051016.dbf recid=15 stamp=571867105
  Deleted 1 objects
上一篇:一个关于DATEBASE TRIGGER的问题解析 人气:406
下一篇:Oracle的实体化视图管理 人气:527
浏览全部Oracle教程的内容 Dreamweaver插件下载 常用网页广告代码全集
  最新网站源码 最新软件下载
2008-7-24 Sablog-X v2.0 预览版
2008-7-24 帝国备份王EmpireBak 2008 正式版
2008-7-24 网趣网上购物系统时尚版 v8.2
2008-7-24 纵横B2B电子商务系统XYECS!B2B v
2008-7-24 e路小说小偷 v1.2.0723
2008-7-24 凌风美女图片站程序 v2.2
2008-7-24 TOM15电影收索程序
2008-7-24 清风信息自动采集生成系统 v1.0
2008-7-24 QQ邮箱编辑器 v1.0 (小小菜刀ASP
2008-7-19 UltraEdit 简体中文增强版 14.10
2008-7-19 CentOS 5.2 i386 LiveCD
2008-7-19 Snapture多功能相机 v1.4
2008-7-19 iAcces中文输入法 v1.0Build016
2008-7-19 Cookbook烹饪秘籍 v2.5
2008-7-19 苹果专用DVD转换工具 v1.1.59汉化
2008-7-19 Modem修复软件ZiPhone修改版04.0
2008-7-19 AgileMessenger即时通讯工具美化
2008-7-19 Sketches画图软件 v0.7b6破解版


  发表评论
姓 名: 验证码:
内 容:
[ 汉字翻译拼音 ] [ 广告代码 ] [ 符号对照表 ] [ 进制转换 ] [ 经典小工具 ] [ 个税计算 ] [ 汉字简繁转换 ] [ 普通单位换算 ] [ 公制单位换算 ]
[ 生辰老黄历 ] [ 国内电话区号 ] [ 国家代码与域名缩写 ] [ 文字加密解密 ] [ 健康查询 ] [ 万年历 ] [ 手机号码查询 ] [ ip搜索 ] [ Google PR查询 ]
业务联系 | 广告刊登 | 频道合作 | 投稿荐稿 | 联系方式 | 加入收藏 | RSS订阅
Copyright © 2000-2008 www.knowsky.com All rights reserved | 网络实名:动态网站制作指南 | 沪ICP备05001343号
ホームページ制作 不動産検索システム 求人情報
防水工事·改修工事 フットサル大会 探偵