地市分站
用户名
密  码
您现在的位置是:树人网首页 / 计算机等级考试 / oracle认证 / 文章浏览
一个完整的Oraclerman备份恢复参考示例
文章来源:来源网络 发表时间:2008-06-05 点击次数
 完整的Oracle rman备份恢复参考示例:

  1、建rman库作为repository

  $more createrman_db1.sh

  set echo on

  spool makedb1.log

  create database rman

  datafile '/export/home/oracle/oradata/rman_data/system.dbf' size 50m autoextend

  on next 640K

  logfile '/export/home/oracle/oradata/rman_data/redo0101.log' SIZE 10M,

  '/export/home/oracle/oradata/rman_data/redo0201.log' SIZE 10M

  maxdatafiles 30

  maxinstances 8

  maxlogfiles 64

  character set US7ASCII

  national character set US7ASCII

  ;

  disconnect

  spool off

  exit

  @/export/home/oracle/8.1.6/rdbms/admin/catalog.sql;

  REM ********** ALTER SYSTEM TABLESPACE *********

  ALTER TABLESPACE SYSTEM

  DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCR

  EASE 50);

  ALTER TABLESPACE SYSTEM

  MINIMUM EXTENT 64K;

  REM ********** TABLESPACE FOR ROLLBACK **********

  CREATE TABLESPACE RBS DATAFILE '/export/home/oracle/oradata/rman_data/rbs.dbf' s

  ize 50m

  AUTOEXTEND ON NEXT 512K

  MINIMUM EXTENT 512K

  DEFAULT STORAGE ( INITIAL 512K NEXT 512K MINEXTENTS 10 MAXEXTENTS UNLIMITED PC

  TINCREASE 0 );

  REM ********** TABLESPACE FOR TEMPORARY **********

  CREATE TABLESPACE TEMP DATAFILE '/export/home/oracle/oradata/rman_data/temp.dbf'

  size 50m

  AUTOEXTEND ON NEXT 64K

  MINIMUM EXTENT 64K

  DEFAULT STORAGE ( INITIAL 64K NEXT 64K MINEXTENTS 1 MAXEXTENTS UNLIMITED PCTINCR

  EASE 0) TEMPORARY;

  REM **** Creating four rollback segments ****************

  CREATE PUBLIC ROLLBACK SEGMENT RBS_0 TABLESPACE RBS

  STORAGE ( OPTIMAL 64000K );

  ALTER ROLLBACK SEGMENT "RBS_0" ONLINE;

  REM **** SYS and SYSTEM users ****************

  alter user sys temporary tablespace TEMP;

  alter user system temporary tablespace TEMP;

  disconnect

  spool off

  exit

  $more createrman_db3.sh

  spool crdb3.log

  @/export/home/oracle/8.1.6/rdbms/admin/catproc.sql

  @/export/home/oracle/8.1.6/rdbms/admin/caths.sql

  @/export/home/oracle/8.1.6/rdbms/admin/otrcsvr.sql

  connect system/manager

  @/export/home/oracle/8.1.6/sqlplus/admin/pupbld.sql

  disconnect

  spool off

  exit

  2、建repository存放的表空间和rman用户

  $more createrman_db4.sh

  connect internal

  create tablespace rman_ts

  datafile '/export/home/oracle/oradata/rman_data/rman_ts.dbf'

  size 20M default storage (initial 100K next 100K pctincrease 0);

  create user rman_hainan identified by rman_hainan

  temporary tablespace TEMP

  default tablespace rman_ts quota unlimited on

  rman_ts;

  grant recovery_catalog_owner to rman_hainan;

  grant connect ,resource to rman_hainan;



第 页

责任编辑:qwer19871212

相关文章
公告栏

“蓝焰杯”第二届河南教育十大新闻人物火热评选中!!

点击参加评选,为你心目中的新闻人物投上一票>>>>
频道内容精选
[计算机考试]程序员必考的知识点
论坛/博客精选