Solaris8上迁移oracle8i---下

Solaris8上迁移oracle8i---下

1、使用dbms_backup_restore包恢复控制文件:

bash-2.03$ sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Tue May 29 16:44:07 2012

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

SQL> conn / as sysdba
Connected.
SQL>declare
devtype varchar2(256);
done boolean;
begin
devtype:=sys.dbms_backup_restore.deviceallocate(type=>'',ident=>'t1');
sys.dbms_backup_restore.restoresetdatafile;
sys.dbms_backup_restore.restoreControlfileTo(cfname=>'/u2/ora8i/oradata/prod/cntrl01.dbf');
sys.dbms_backup_restore.restorebackuppiece(done=>done,handle=>'/u2/ora8i/rman/cntrl_PROD_128_1',params=>null);
sys.dbms_backup_restore.devicedeallocate;
end;
/

PL/SQL procedure successfully completed.

SQL>
SQL> shutdown immediate
ORA-01507: database not mounted


ORACLE instance shut down.
SQL> exit

 

2、恢复了一个控制文件,但是参数文件里写的是三个,所以关闭数据库复制一下:
(用上面的命令直接恢复三个也是可以的)
bash-2.03$ cd /u2/ora8i/oradata/prod/
bash-2.03$ cp cntrl01.dbf cntrl02.dbf
bash-2.03$ cp cntrl01.dbf cntrl03.dbf
bash-2.03$
bash-2.03$

3、将数据库启动到mount状态:
bash-2.03$ sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Tue May 29 16:44:07 2012

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

SQL> conn / as sysdba
SQL> startup mount
ORACLE instance started.

Total System Global Area 1546064032 bytes
Fixed Size                    73888 bytes
Variable Size             716288000 bytes
Database Buffers          819200000 bytes
Redo Buffers               10502144 bytes
Database mounted.
SQL> exit

 

4、使用rman工具restore数据文件:
bash-2.03$
bash-2.03$ rman target / nocatalog

Recovery Manager: Release 8.1.7.4.0 - Production

RMAN-06005: connected to target database: PROD (DBID=4167122059)
RMAN-06009: using target database controlfile instead of recovery catalog

RMAN>
RMAN>report schema;

RMAN-03022: compiling command: report
RMAN-06139: warning - controlfile is not current for REPORT SCHEMA
Report of database schema
File K-bytes    Tablespace           RB segs Name
---- ---------- -------------------- ------- -------------------
1             0 SYSTEM               ***     /u5/testdata/system01.dbf
2             0 SYSTEM               ***     /u5/testdata/system02.dbf
3             0 SYSTEM               ***     /u5/testdata/system03.dbf
4             0 SYSTEM               ***     /u5/testdata/system04.dbf
5             0 SYSTEM               ***     /u5/testdata/system05.dbf
........................省略线..........................
410           0 APPLSYSD             ***     /u5/testdata/applsysd06.dbf
411           0 DXTD                 ***     /u5/testdata/dxtd_db04.dbf
412           0 INVX                 ***     /u5/testdata/invx06.dbf
413           0 INVD                 ***     /u5/testdata/invd07.dbf
414           0 DXTX                 ***     /u5/testdata/dxtx_db5.dbf

RMAN> 

 

需要把数据文件恢复到/u2/ora8i/oradata/目录下,使用set newname 命令:
RMAN>run
{
allocate channel d1 type disk;
set newname for   datafile 1 to '/u2/ora8i/oradata/system01.dbf';
set newname for   datafile 2 to '/u2/ora8i/oradata/system02.dbf';
set newname for   datafile 3 to '/u2/ora8i/oradata/system03.dbf';
set newname for   datafile 4 to '/u2/ora8i/oradata/system04.dbf';
set newname for   datafile 5 to '/u2/ora8i/oradata/system05.dbf';
........................省略线..........................
set newname for   datafile 410 to '/u2/ora8i/oradata/applsysd06.dbf';
set newname for   datafile 411 to '/u2/ora8i/oradata/dxtd_db04.dbf';
set newname for   datafile 412 to '/u2/ora8i/oradata/invx06.dbf';
set newname for   datafile 413 to '/u2/ora8i/oradata/invd07.dbf';
set newname for   datafile 414 to '/u2/ora8i/oradata/dxtx_db5.dbf';
restore database;
switch datafile all;
}

RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: d1
RMAN-08500: channel d1: sid=15 devtype=DISK

RMAN-03022: compiling command: set

RMAN-03022: compiling command: set

RMAN-03022: compiling command: set

.................省略线...............

RMAN-03022: compiling command: set

RMAN-03022: compiling command: set

RMAN-03022: compiling command: set

RMAN-03022: compiling command: set

RMAN-03022: compiling command: restore

 

 


RMAN> exit


Recovery Manager complete.


bash-2.03$
bash-2.03$
bash-2.03$
bash-2.03$
bash-2.03$


restore数据文件的时候,alert文件里显示的内容:

Full restore complete of datafile 16 to datafile copy /u2/ora8i/oradata/rgd01.dbf
  checkpoint is 68724235581
Full restore complete of datafile 31 to datafile copy /u2/ora8i/oradata/azd01.dbf
  checkpoint is 68724235581
Full restore complete of datafile 48 to datafile copy /u2/ora8i/oradata/frmx01.dbf
  checkpoint is 68724235581
Full restore complete of datafile 71 to datafile copy /u2/ora8i/oradata/wpsd01.dbf
  checkpoint is 68724235581
Tue May 29 18:05:33 2012
.................省略线...............
Switch of datafile 410 complete to datafile copy /u2/ora8i/oradata/applsysd06.dbf
  checkpoint is 68724365118
Switch of datafile 411 complete to datafile copy /u2/ora8i/oradata/dxtd_db04.dbf
  checkpoint is 68724365117
Switch of datafile 412 complete to datafile copy /u2/ora8i/oradata/invx06.dbf
  checkpoint is 68724996565
Switch of datafile 413 complete to datafile copy /u2/ora8i/oradata/invd07.dbf
  checkpoint is 68724235581
Switch of datafile 414 complete to datafile copy /u2/ora8i/oradata/dxtx_db5.dbf
  checkpoint is 68724235678



5、使用rman工具restore归档日志文件:

RMAN>

RMAN>run
2>{
3> allocate channel d1 type disk;
4>restore archivelog from logseq 2316 until logseq 2554;
5>release channel d1;
6> }

RMAN-03022: compiling command: allocate
RMAN-03023: executing command: allocate
RMAN-08030: allocated channel: d1
RMAN-08500: channel d1: sid=16 devtype=DISK

RMAN-03022: compiling command: restore

RMAN-03022: compiling command: IRESTORE
RMAN-03023: executing command: IRESTORE
RMAN-08017: channel d1: starting archivelog restore to default destination
RMAN-08022: channel d1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2316
RMAN-08022: channel d1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2317
.................省略线...............

RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/u2/oracle/rman/al_PROD_125_1 tag=null params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08017: channel d1: starting archivelog restore to default destination
RMAN-08022: channel d1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2436
.................省略线...............
RMAN-08022: channel d1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2495
RMAN-08023: channel d1: restored backup piece 1
RMAN-08511: piece handle=/u2/oracle/rman/al_PROD_126_1 tag=null params=NULL
RMAN-08024: channel d1: restore complete
RMAN-08017: channel d1: starting archivelog restore to default destination
RMAN-08022: channel d1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2496
RMAN-08022: channel d1: restoring archivelog
.................省略线...............
RMAN-08022: channel d1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2553
RMAN-08022: channel d1: restoring archivelog
RMAN-08510: archivelog thread=1 sequence=2554


RMAN> recover database ;

RMAN>alter database open resetlogs;
这个时候报错,说找不到redolog文件:/u5/testdata/log01a.dbf
进入SQLPLUS:
bash-2.03$sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Tue May 29 16:44:07 2012

(c) Copyright 2000 Oracle Corporation.  All rights reserved.

SQL> conn / as sysdba
SQL> alter database rename file '/u5/testdata/log01a.dbf' to '/u2/ora8i/oradata/log01a.dbf';
SQL>alter database rename file '/u5/testdata/log01b.dbf' to '/u2/ora8i/oradata/log01b.dbf';
SQL> alter database rename file '/u5/testdata/log02a.dbf' to '/u2/ora8i/oradata/log02a.dbf';
SQL> alter database rename file '/u5/testdata/log02b.dbf' to '/u2/ora8i/oradata/log02b.dbf';
SQL> alter database rename file '/u5/testdata/log03a.dbf' to '/u2/ora8i/oradata/log03a.dbf';
SQL>alter database rename file '/u5/testdata/log03b.dbf' to '/u2/ora8i/oradata/log03b.dbf';
SQL>alter database open resetlogs;
打开。

6、检查临时表空间等。

此次恢复的数据文件:
bash-2.03$du -k oradata/
153319558       oradata

bash-2.03$du -k arch/
24262334        arch




更多参考:

Solaris8上迁移oracle8i---上



更多参考:


the specified nodes are not clusterable

根据rowid删除表中重复的行

Agent process exited abnormally during initialization

一次字符乱码的解决过程

rman实验(一)

rman实验(二)

ORA-00600: internal error code, arguments: [keltnf

ORA-00600: ORA-12012 ORA-08102解决

linux下完全删除oracle

INFO: /usr/bin/ld: crt1.o: No such file: No such file or directory

centos4.8_64上安装oracle10201建库报ORA-12547

EM乱码解决

ORA-31613 Master process DM00 failed during startup

ORA-00600: internal error code, arguments: [4194], [29], [27], [], [], [], [], []

ORA-24324 ORA-01041 ORA-03113

centos5.3升级oracle

pdksh-5.2.14-36.el5.i386.rpm

使用rman进行数据库迁移

oracle10.2.0.1升级到10.2.0.4报错

Upgrade Oracle 10g from 10.2.0.1 to 10.2.0.4 (Single Instance)

改oracle的name和dbid

修改oracle实例名

Solaris8上迁移oracle8i---上

Solaris8上迁移oracle8i---下

未备份归档日志导致数据丢失的实验

使用NBU进行数据库迁移

catalog备份数据库

RMAN FORMAT字符串格式化

Error: can not register my instance state - -1

not all alterations performed

The ASM instance configured on the local node is a single-instance ASM

/u01/crs102/bin/crsctl.bin: error while loading shared libraries: libstdc++.so.5: cannot open shared

Initializing the Oracle ASMLib driver: [FAILED]

ORA-00245: control file backup operation failed

WARNING: failed to read mirror side 1 of virtual extent 229 logical extent

模拟恢复参数文件

Interface eth0 checked failed

import server uses ZHS16GBK character set (possible charset conversion)





评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值