国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > Oracle > 正文

oracle9i中Rman的備份使用點(diǎn)滴

2024-08-29 13:37:13
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

  rman的簡(jiǎn)單使用: catalog的建立,全備份,保留備份策略,刪除過(guò)期備份。
  
  1. 查看當(dāng)前數(shù)據(jù)庫(kù)的數(shù)據(jù)文件
  
  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默認(rèn)的表空間為back_up,使用臨時(shí)表空間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用戶授權(quán)
  
  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. 連接或者創(chuàng)建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上 ,并注冊(cè)testmysiteok數(shù)據(jù)庫(kù)
  
  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數(shù)據(jù)庫(kù)
  
  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. 設(shè)置保留最近的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. 查看過(guò)期的備份
  
  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. 刪除過(guò)期備份
  
  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

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 屯昌县| 阿勒泰市| 丹凤县| 韩城市| 华阴市| 龙山县| 青川县| 泸溪县| 龙里县| 平泉县| 昭平县| 蒙自县| 兴仁县| 双鸭山市| 穆棱市| 延川县| 伊吾县| 金昌市| 丹巴县| 崇义县| 东台市| 柳江县| 安陆市| 万全县| 祥云县| 屏东市| 泸水县| 琼海市| 桐柏县| 邮箱| 类乌齐县| 册亨县| 淮南市| 石狮市| 德保县| 镶黄旗| 南昌市| 吉林省| 盘山县| 岳池县| 乌兰察布市|