upgrade 10.2.0.5 to 11.2.0.4 on linux

orastar發表於2018-03-19
1、在source庫上執行utlu112i.sql指令碼


將11g $ORACLE_HOME/rdbms/admin下的utlu112i.sql指令碼複製到10g的/home/oracle/執行
spool upgrade_info.log
@?/rdbms/admin/utlu112i.sql


原庫資料檔案保留足夠的空餘空間
ALTER TABLESPACE system ADD DATAFILE '+DATA01'  SIZE  1G AUTOEXTEND OFF;
ALTER TABLESPACE SYSAUX ADD DATAFILE '+DATA01'  SIZE  1G AUTOEXTEND OFF;
ALTER TABLESPACE USERS ADD DATAFILE '+DATA01'  SIZE  1G AUTOEXTEND OFF;
ALTER TABLESPACE UNDOTBS1 ADD DATAFILE '+DATA01'  SIZE  1G AUTOEXTEND OFF;
ALTER TABLESPACE TEMP ADD tempfile '+DATA01'  SIZE  1G AUTOEXTEND OFF;


檢查source庫資料檔案及日誌檔案
set line 130
col file_name for a60
col MEMBER for a60
select member from v$logfile;
select file_name,STATUS from dba_temp_files;
select file_id,file_name,STATUS,ONLINE_STATUS from dba_data_files;

2、原備全備


rman target /
backup database format '/home/oracle/full_%U.bak' plus archivelog;
複製備份集到target庫。


3、target恢復


3.1 start instance
startup nomount pfile='/home/oracle/pfile.ora';  --注:sga_target>2G以上,根據主機配置設定足夠sga
set DBID=2071660054;  --設定source庫DBID
restore controlfile from '/home/oracle/full_02spdlip_1_1.bak';
alter database mount;


3.2 restore database
run{
set newname for datafile 1 to '+DATA01/';
set newname for datafile 2 to '+DATA01/';
set newname for datafile 3 to '+DATA01/';
set newname for datafile 4 to '+DATA01/';
restore database;
switch datafile all;
}


3.3 recover database
select CHECKPOINT_CHANGE# from v$database;
select CHECKPOINT_CHANGE# from v$datafile;
select CHECKPOINT_CHANGE# from v$datafile_header;


recover database until scn 397878;


alter database rename file '/oradata/onlinelog/o1_mf_3_f6fy0tvm_.log' to '+DATA01';
alter database rename file '/oradata/onlinelog/o1_mf_2_f6fy0sqf_.log' to '+DATA01';
alter database rename file '/oradata/onlinelog/o1_mf_1_f6fy0rho_.log' to '+DATA01';
alter database rename file '/oradata/datafile/o1_mf_temp_f6fy0xqt_.tmp' to '+DATA01';


3.4 update database
alter database open resetlogs upgrade;


set line 200
col name for a60
select * from v$sgainfo; --檢查shared_pool_size,測試時100M升級報錯,建議500M以上。


@?/rdbms/admin/catupgrd.sql
@?/rdbms/admin/utlu112s.sql
@?/rdbms/admin/catuppst.sql


3.5 檢查無效物件及升級元件
編譯無效物件
set lines 1200 pages 1200
col owner for a15
col object_name for a40
col status for a15
col OBJECT_TYPE for a20
select owner,object_name,OBJECT_TYPE,status from dba_objects where status !='VALID'; 
@?/rdbms/admin/utlrp.sql


檢查升級元件
set lines 1200
col comp_name for a30
col status for a12
col version for a20
select comp_name,status,version from dba_server_registry;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31442014/viewspace-2152007/,如需轉載,請註明出處,否則將追究法律責任。

相關文章