视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
Oracle使用RMAN将DB从10g直接Restore到11g示例
2020-11-09 11:37:21 责编:小采
文档


Oracle 使用RMAN 将 DB 从10g 直接 Restore 到11g 示例

随着Oracle 版本的升级,RMAN 也得到增强,在Oracle11g中的RMAN 支持不同操作系统和不同DB 之前的使用,关于RMAN 的兼容性,参考:

Oracle RMAN 兼容性 及 不同版本和不同平台之间使用 常见问题说明

这篇文章演示一个linux 下10g 恢复到11g中的示例。

Target 端:

OS: Oracle Linux 6.1 位

DB: 11.2.0.3

Source 端:

OS:Oracle Linux 6.1 位

DB: 10.2.0.5

注意:

Oracle 10.2.0.1 不能直接升级到11gR2,至少需要先升级到10.2.0.2 以后才可以升级到11gR2,关于Oracle 升级路线图参考我的Blog:Oracle9i/10g/11g 数据库 升级路线图(upgrade roadmap)

简单的来说就是2个步骤:

1. 将10g 数据库 还原11g上

2. 升级还原的10g数据库到11g。

具体操作步骤如下。

一.在Source 库用RMAN 备份数据库

1.1 在Source 库上执行utlu112i.sql脚本

在Source 备份之前,,需要执行一下utlu112i.sql 脚本,如果不执行,那么在升级时执行 @?/rdbms/admin/catupgrd.sql 脚本时会报如下错误:

DOC> The following error is generated if the pre-upgrade tool has not been

DOC> run in the old ORACLE_HOME home prior to upgrading a pre-11.2 database:

DOC>

DOC> SELECT TO_NUMBER('MUST_HAVE_RUN_PRE-UPGRADE_TOOL_FOR_TIMEZONE')

DOC> *

DOC> ERROR at line 1:

DOC> ORA-01722: invalid number

DOC>

DOC> o Action:

DOC> Shutdown database ("alter systemcheckpoint" and then "shutdown abort").

DOC> Revert to the original oracle home andstart the database.

DOC> Run pre-upgrade tool against thedatabase.

DOC> Review and take appropriate actionsbased on the pre-upgrade

DOC> output before opening the datatabase inthe new software version.

DOC>

将11g $ORACLE_HOME/rdbms/admin 下的utlu112i.sql脚本copy到10g的$ORACLE_HOME/rdbms/admin 下,并在10g上执行,这个脚本可以检查升级前的一些信息。如果不满足条件,会列出。

SQL> spool upgrade_info.log

SQL> @?/rdbms/admin/utlu112i.sql

Oracle Database 11.2 Pre-UpgradeInformation Tool 03-01-2012 19:53:57

Script Version: 11.2.0.3.0 Build: 001

.

**********************************************************************

Database:

**********************************************************************

--> name: ANQING

--> version: 10.2.0.5.0

--> compatible: 10.2.0.5.0

--> blocksize: 8192

--> platform: Linux x86 -bit

--> timezone file: V4

.

**********************************************************************

Tablespaces: [make adjustments in thecurrent environment]

**********************************************************************

--> SYSTEM tablespace is adequate forthe upgrade.

.... minimum required size: 682 MB

--> UNDOTBS1 tablespace is adequate forthe upgrade.

.... minimum required size: 400 MB

--> SYSAUX tablespace is adequate forthe upgrade.

.... minimum required size: 454 MB

--> TEMP tablespace is adequate for theupgrade.

.... minimum required size: 60 MB

.

**********************************************************************

Flashback: OFF

**********************************************************************

**********************************************************************

Update Parameters: [Update Oracle Database11.2 init.ora or spfile]

Note: Pre-upgrade tool was run on a lowerversion -bit database.

**********************************************************************

--> If Target Oracle is 32-Bit, referhere for Update Parameters:

-- No update parameter changes are required.

.

--> If Target Oracle is -Bit, referhere for Update Parameters:

WARNING: --> "sga_target"needs to be increased to at least 596 MB

.

**********************************************************************

Renamed Parameters: [Update Oracle Database11.2 init.ora or spfile]

**********************************************************************

-- No renamed parameters found. No changesare required.

.

**********************************************************************

Obsolete/Deprecated Parameters: [UpdateOracle Database 11.2 init.ora or spfile]

**********************************************************************

--> background_dump_dest 11.1 DEPRECATED replaced by "diagnostic_dest"

--> user_dump_dest 11.1 DEPRECATED replaced by "diagnostic_dest"

.

**********************************************************************

Components: [The following databasecomponents will be upgraded or installed]

**********************************************************************

--> Oracle Catalog Views [upgrade] VALID

--> Oracle Packages and Types [upgrade] VALID

--> JServer JAVA Virtual Machine[upgrade] VALID

--> Oracle XDK for Java [upgrade] VALID

--> Oracle Workspace Manager [upgrade] VALID

--> OLAP Analytic Workspace [upgrade] VALID

--> OLAP Catalog [upgrade] VALID

--> EM Repository [upgrade] VALID

--> Oracle Text [upgrade] VALID

--> Oracle XML Database [upgrade] VALID

--> Oracle Java Packages [upgrade] VALID

--> Oracle interMedia [upgrade] VALID

--> Spatial [upgrade] VALID

--> Data Mining [upgrade] VALID

--> Expression Filter [upgrade] VALID

--> Rule Manager [upgrade] VALID

--> Oracle OLAP API [upgrade] VALID

.

**********************************************************************

Miscellaneous Warnings

**********************************************************************

WARNING: --> Database is using atimezone file older than version 14.

.... After the release migration, it isrecommended that DBMS_DST package

.... be used to upgrade the 10.2.0.5.0database timezone version

.... to the latest version which comes withthe new release.

WARNING: --> EM Database ControlRepository exists in the database.

.... Direct downgrade of EM DatabaseControl is not supported. Refer to the

.... Upgrade Guide for instructions to savethe EM data prior to upgrade.

WARNING: --> Your recycle bin is turnedon and currently contains no objects.

.... Because it is REQUIRED that therecycle bin be empty prior to upgrading

.... and your recycle bin is turned on, youmay need to execute the command:

PURGE DBA_RECYCLEBIN

.... prior to executing your upgrade toconfirm the recycle bin is empty.

.

**********************************************************************

Recommendations

**********************************************************************

Oracle recommends gathering dictionarystatistics prior to

upgrading the database.

To gather dictionary statistics execute thefollowing command

while connected as SYSDBA:

EXECUTE dbms_stats.gather_dictionary_stats;

**********************************************************************

Oracle recommends reviewing any definedevents prior to upgrading.

To view existing non-default events executethe following commands

while connected AS SYSDBA:

Events:

SELECT (translate(value,chr(13)||chr(10),' ')) FROM sys.v$parameter2

WHERE UPPER(name) ='EVENT'AND isdefault='FALSE'

Trace Events:

SELECT (translate(value,chr(13)||chr(10),' ')) from sys.v$parameter2

WHERE UPPER(name) = '_TRACE_EVENTS' AND isdefault='FALSE'

Changes will need to be made in theinit.ora or spfile.

**********************************************************************

SQL>

如果直接在11g上执行这个脚本,那么会报如下错误:

SQL> @?/rdbms/admin/utlu112i.sql

ERROR:

ORA-04023: Object SYS.STANDARD could not bevalidated or authorized

MOS 对这个问题的说明:

ORA-04023 On SYS.STANDARD When RunningUTLU111I.SQL or UTLU112I.SQL [ID 984511.1]

在网上搜到这么一段:

WARNING: –> Database is using an oldtimezone file version.
…. Patch the 10.2.0.1.0 database to timezone file version 4
…. BEFORE upgrading the database. Re-run utlu111i.sql after
…. patching the database to record the new timezone file version.

To find time zone file version on sourcedatabase (10g) run
SQL> select * from v$timezone_file;
If time zone file version is lessthan 4 then apply time zone patch 56322 manually for 10.2.0.1database。

--之前我们说10.2.0.1 不能直接升级到11gR2,通过这段文字,这个不能升级的原因可能就是与Time zone 相关。10.2.0.5的Time zone 值是4,满足条件。对于timezone 值小于4的,要打Patch 56322。

手头没有10.2.0.1的库,暂时不能查询,之前也遇到过一个time zone的问题。

Oracle TTSORA-39322: Cannot use transportable tablespace with different timezone version 说明

1.2 备份Source库

备份脚本参考:

Linux平台下RMAN 全备 和 增量备份shell 脚本

Nocatalog下的RMAN 增量备份shell脚本

下载本文
显示全文
专题