分类: 服务器与存储
2008-06-14 13:34:11
uncompress /oracle/oradata/xxx/xxx.ARC.Z ... begin begin sys.dbms_logmnr.start_logmnr(Options => sys.dbms_logmnr.DICT_FROM_ONLINE_CATALOG); end; create table xsb_logminer_1 as BEGIN sys.dbms_logmnr.end_logmnr();END; |
◆然后在生产库上创建pfile:
create pfile='...' from spfile; |
需要从带库上恢复rman备份集至生产机上,将此备份集FTP至测试机上,连同pfile文件.
在测试机上创建与生产机上相同目录,admin ...
在测试机上创建新实例:
orapwd file=... password=xxx |
◆启动新实例
export ORACLE_SID=xxx sqlplus / as sysdba startup nomount pfile='/home/oracle/init_xxx.ora'; create spfile from pfile='/home/oracle/init_xxx.ora'; exit RMAN target sys/xxx run to '/oracle/oradata/xxx/pay_ts01.dbf'; |
然后修改controlfile文件内容,去掉不用的文件名
◆不完全恢复数据库:
sqlplus / as sysdba startup nomount; |
CREATE CONTROLFILE REUSE DATABASE "XXX" RESETLOGS ARCHIVELOG MAXLOGFILES 40 MAXLOGMEMBERS 3 MAXDATAFILES 400 MAXINSTANCES 2 MAXLOGHISTORY 454 LOGFILE GROUP 1 ( '/oracle/oradata/xxx/rdb_redo01a' ) SIZE 10M, GROUP 2 ( '/oracle/oradata/xxx/rdb_redo02a' ) SIZE 10M DATAFILE '/oracle/oradata/xxx/system01.dbf', '/oracle/oradata/xxx/undo01.dbf', '/oracle/oradata/xxx/sysaux01.dbf', '/oracle/oradata/xxx/pay_ts01.dbf' CHARACTER SET ZHS16GBK ; recover database until cancel using backup controlfile; alter database open resetlogs; |
create table xxx as select xxx from xxx where xxx; exp,ftp .dmp,imp |
restore database; recover database using backup controlfile until cancel; alter database open resetlogs; ... END!!! |