ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 克隆库

克隆库

原创 Linux操作系统 作者:Oraxu 时间:2011-04-30 22:30:34 0 删除 编辑

--参数文件
create pfile='/home/oracle/pfileora10g.ora' from spfile;
cp pfileora10g.ora pfiletest.ora
vi pfiletest.ora,将其中ora10g修改为test
startup nomount pfile='/home/oracle/pfiletest.ora';


--根据参数文件中dump路径,创建相应的dump目录
mkdir -p $ORALCE_BASE/admin/test/adump
mkdir -p $ORALCE_BASE/admin/test/bdump
mkdir -p $ORALCE_BASE/admin/test/cdump
mkdir -p $ORALCE_BASE/admin/test/udump

--密码文件
orapwd file=/u01/app/oracle/product/10.2.0/db_1/dbs/orapwtest password=test entries=10

export ORACLE_SID=test
SQL>startup mount pfile='/u01/app/oracle/product/10.2.0/db_1/dbs/pfiletest.ora';
SQL>@ctl.sql
--控制文件重建,ctl.sql包含
CREATE CONTROLFILE REUSE set DATABASE "test" NORESETLOGS  ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
  GROUP 1 '/u01/app/oracle/oradata/ora10g/redo01.log'  SIZE 50M,
  GROUP 2 '/u01/app/oracle/oradata/ora10g/redo02.log'  SIZE 50M,
  GROUP 3 '/u01/app/oracle/oradata/ora10g/redo03.log'  SIZE 50M
-- STANDBY LOGFILE
DATAFILE
  '/u01/app/oracle/oradata/ora10g/system01.dbf',
  '/u01/app/oracle/oradata/ora10g/undotbs01.dbf',
  '/u01/app/oracle/oradata/ora10g/sysaux01.dbf',
  '/u01/app/oracle/oradata/ora10g/users01.dbf',
  '/u01/app/oracle/oradata/ora10g/example01.dbf',
  '/u01/app/oracle/oradata/ora10g/PART1_TS',
  '/u01/app/oracle/oradata/ora10g/PART2_TS',
  '/u01/app/oracle/oradata/ora10g/PART3_TS',
  '/u01/app/oracle/oradata/ora10g/PART1_NDX_TS',
  '/u01/app/oracle/oradata/ora10g/PART2_NDX_TS',
  '/u01/app/oracle/oradata/ora10g/PART3_NDX_TS',
  '/u01/app/oracle/oradata/ora10g/tt01.dbf'
CHARACTER SET WE8ISO8859P1
;
--应用归档日志文件及联机日志文件
SQL>recover database using backup controlfile until cancel;

/u01/app/oracle/oradata/ora10g/redo03.log

SQL>alter database open resetlogs;

--在能打开数据库之后,创建克隆库的spfile文件
create spfile from pfile='/home/oracle/pfiletest.ora';

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/20948177/viewspace-694182/,如需转载,请注明出处,否则将追究法律责任。

上一篇: ORA-14405
请登录后发表评论 登录
全部评论

注册时间:2011-04-06

  • 博文量
    8
  • 访问量
    10829