Oracle数据库迁移升级项目102030(HP-UX)->102056(SunOS)

netslife迁移升级项目
10.2.0.3.0(HP-UX IA (64-bit)
10.2.0.5.6 Solaris[tm] OE (64-bit)

G2BH8060, odsz10g sid: hd02ntlf
g4as8031, od1ntlf   ,sid:d1ntlf

1.源端做convert database
shut immediate
startup mount
alter database open read only;

set serveroutput on
declare
db_ready boolean;
begin
db_ready := dbms_tdb.check_db('Solaris[tm] OE (64-bit)',dbms_tdb.skip_readonly);
end;
/

set serveroutput on
declare
external boolean;
begin
external := dbms_tdb.check_external;
end;
/
  
  
rman target / << EOF >/paic/hd02ntlf/datatmp/fwy/fwy.log 2>&1
CONVERT DATABASE NEW DATABASE 'newdb'
to platform 'Solaris[tm] OE (64-bit)'
db_file_name_convert '/paic/g2bh8060/dev/xqd/oradata/hd02ntlf/' '/paic/hd02ntlf/datatmp/fwy/'
;
EOF

中途报错,是因为undo表空间有坏块。
convert database报错因为有坏块.mht
这里得出的结论是,做rman convert前可以先全部dbv检查一下。
--dbv.sh--
select 'dbv file='''||file_name||''' feedback=1000000 ' from dba_data_files;
nohup sh dbv.sh>dbv.out 2>&1 &



2.目标端克隆软件102056

$ORACLE_HOME/oui/bin/runInstaller -detachHome -invPtrLoc /paic/d1ntlf/rdbms/oracle/product/10.2.0/oraInst.loc ORACLE_HOME=/paic/d1ntlf/rdbms/oracle/product/10.2.0  

vi install.sh
$ORACLE_HOME/oui/bin/runInstaller  -invPtrLoc /paic/d1ntlf/rdbms/oracle/product/10.2.0/oraInst.loc \
-silent -clone ORACLE_HOME="/paic/d1ntlf/rdbms/oracle/product/10.2.0" \
ORACLE_HOME_NAME="home102041"



select 'alter database rename file '||chr(39)||file_name||chr(39)||' to '||chr(39)||substr(file_name,instr(file_name,'/',-1,1))||chr(39) from dba_data_files;

将数据文件都传到目标端,控制文件传一个就可以。临时文件不用传,redo log可以传可以不传,传就方便点,不传的话,后期要创建新的redo log 文件。

--因为数据库是nomount状态,不能configure channel来配置并行,所以要在转换的临时分配channel
既然convert database因不明原因失败,我就将dbf文件都传到临时卷上。
再将临时卷挂到目标端,然后convert datafile。此时要用root修改属主与权限。
--因为数据库是nomount状态,不能configure channel来配置并行,所以要在转换的临时分配channel

数据库启动到nomount状态

--1.sh--
rman target / <<EOF >1.log 2>&1
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
convert datafile 
'/paic/hd02ntlf/datatmp/fwy/arcdata.dbf',
'/paic/hd02ntlf/datatmp/fwy/cchdata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/ccodata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/dbadata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/dmkbakdata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/fwy01.dbf',
'/paic/hd02ntlf/datatmp/fwy/iflyteksadata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/INSTMRdata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/netsmisdata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/rbsdata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/rbsdata02.dbf',
'/paic/hd02ntlf/datatmp/fwy/rbsdata03.dbf',
'/paic/hd02ntlf/datatmp/fwy/sysaux01.dbf',
'/paic/hd02ntlf/datatmp/fwy/system01.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifeadmdata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifeadmdata02.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifeadmidx01.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata01.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata02.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata03.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata04.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata05.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata06.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata07.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata08.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata09.dbf'
to PLATFORM="Solaris[tm] OE (64-bit)"
FROM PLATFORM="HP-UX IA (64-bit)"
DB_FILE_NAME_CONVERT=
'/paic/hd02ntlf/datatmp/fwy','/paic/d1ntlf/data01/oradata';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}
EOF

nohup sh 1.sh &

--vi 2.sh--
rman target / <<EOF >2.log 2>&1
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
convert datafile
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata10.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata11.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata12.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata13.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata14.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata15.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata16.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata17.dbf'
to PLATFORM="Solaris[tm] OE (64-bit)"
FROM PLATFORM="HP-UX IA (64-bit)"
DB_FILE_NAME_CONVERT=
'/paic/hd02ntlf/datatmp/fwy','/paic/d1ntlf/data02/oradata';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}
EOF
nohup sh 2.sh &
对于SUN平台,后台跑起就exit这个主机,然后重启登陆,此时ctrl+c才不会影响此次任务。不然ctrl+c就会将当前会话发起的任务都退出掉。

--3.sh--
rman target / <<EOF >3.log 2>&1
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
convert datafile 
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata18.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata19.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata20.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata21.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata22.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata23.dbf'
to PLATFORM="Solaris[tm] OE (64-bit)"
FROM PLATFORM="HP-UX IA (64-bit)"
DB_FILE_NAME_CONVERT=
'/paic/hd02ntlf/datatmp/fwy','/paic/d1ntlf/data03/oradata';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}
EOF

nohup sh 3.sh &

--4.sh--
rman target / <<EOF >4.log 2>&1
run
{
allocate channel c1 type disk;
allocate channel c2 type disk;
allocate channel c3 type disk;
allocate channel c4 type disk;
allocate channel c5 type disk;
allocate channel c6 type disk;
allocate channel c7 type disk;
allocate channel c8 type disk;
convert datafile 
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata24.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata25.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata26.dbf',
'/paic/hd02ntlf/datatmp/fwy/tmrlifedata27.dbf',
'/paic/hd02ntlf/datatmp/fwy/undotbs2_01.dbf',
'/paic/hd02ntlf/datatmp/fwy/users01.dbf',
'/paic/hd02ntlf/datatmp/fwy/workarea01.dbf'
to PLATFORM="Solaris[tm] OE (64-bit)"
FROM PLATFORM="HP-UX IA (64-bit)"
DB_FILE_NAME_CONVERT=
'/paic/hd02ntlf/datatmp/fwy','/paic/d1ntlf/data04/oradata';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}
EOF

nohup sh 4.sh &

将参数文件编辑好
startup nomount;
将控制文件复制到指定的路径下。
alter database mount;

第一个卷rename file.txt
第二个卷rename file.txt
新建文本文档.txt
新建文本文档.txt
shut immediate;
startup nomount;
mv旧控制文件。
重建控制文件。(将建temp脚本取出)
alter database open resetlogs upgrade;
将控制文件加上temp文件。
检查升级前提条件是否满足@/rdbms/admin/utlu102i.sql
升级 @?/rdbms/admin/catupgrd.sql
shut immediate
startup
@?/rdbms/admin/utlrp.sql编译失效对象

之前修改控制文件忘记改db_name了,后面要记得重建控制文件改过来。
g4as8031, od1ntlf   ,sid:d1ntlf


我发现升级完以后,无论怎么查版本号,都是102050.
原来是需要打PSU @catbundle.sql psu apply ,才能把版本号弄到102056.


apply日志.txt
后来驻场何工帮我看了日志,发现是temp表空间不够,加了表空间再apply就成功了。
这件事情说明,对于日志的输出,就算很长,也得仔细看,从头看到尾,这样才算是尽力了。
当然也说明了,多点问身边的人,充分调动资源,也是很重要的解决问题的方法。






  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值