Oracle数据库数据恢复、性能优化

找回密码
注册
搜索
热搜: 活动 交友 discuz
发新帖

0

积分

0

好友

6

主题
1#
发表于 2013-1-14 14:38:38 | 查看: 4359| 回复: 2
今日小弟升级一个10.2.0.4到11.2.0.1,操作系统的RHEL 4 x86,内存8GB。
步骤如下:
10g环境
create pfile from spfile;

lsnrctl stop
shutdown immediate

cd /home/oracle
tar -zcf oraInventory.tgz oraInventory/

修改11g环境变量,安装11g软件
vi .bash_profile
export ORACLE_HOME=$ORACLE_BASE/product/11.2

cd /database/ora_install/database
./runInstaller -silent -responseFile '/database/ora_install/database/response/db_install.rsp' -noconfig

复制10g参数文件到11g
cp initorcl.ora orapworcl /home/oracle/product/11.2/dbs/

用10g pfile创建11g spfile
create spfile from pfile;

cat /etc/oratab

10g环境
@11g $ORACLE_HOME/rdbms/admin/utlu112i.sql

11g环境
startup upgrade
@?/rdbms/admin/catupgrd.sql

-----------------------------------------------------------------------------------------------------------------------------------

跑完这一步以后,应当是启动11g,进行其他操作。可是sqlplus执行操作时,报错。

SQL>
SQL>
SQL> /*****************************************************************************/
SQL> /* Step 10 - SHUTDOWN THE DATABASE..!!!!!
SQL> */
SQL> /*****************************************************************************/
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL>
SQL> DOC
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC>   The above sql script is the final step of the upgrade. Please
DOC>   review any errors in the spool log file. If there are any errors in
DOC>   the spool file, consult the Oracle Database Upgrade Guide for
DOC>   troubleshooting recommendations.
DOC>
DOC>   Next restart for normal operation, and then run utlrp.sql to
DOC>   recompile any invalid application objects.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
SQL>
SQL> Rem Set errorlogging off
SQL> SET ERRORLOGGING OFF;
SQL>
SQL> Rem *********************************************************************
SQL> Rem END catupgrd.sql
SQL> Rem *********************************************************************
SQL> startup
SP2-1540: Oracle Database cannot startup in an Edition session.
SQL>

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

下一步应该怎么做?
2#
发表于 2013-1-14 16:05:42
本帖最后由 Stone 于 2013-1-14 16:08 编辑

这个错误确实可搜索的相关文档很少,为了防止更多的童靴碰到这样的问题,顺便更贴简单总结一下。

Tim有篇文章详细介绍Oracle Edition相关的使用,非常不错。
http://www.oracle-base.com/articles/11g/edition-based-redefinition-11gr2.php

另外Oracle文档也提到关于Edition的简单介绍:
ORA_EDITION
       
Environment variable to specify the database edition to use. If you specify the edition with the CONNECT or SQLPLUS command option, edition=value, it is used instead of ORA_EDITION. If no edition is specified in either the CONNECT or SQLPLUS command option, or in ORA_EDITION, SQL*Plus connects to the default edition.


Oracle Comminity 上还有一个相同的问题,介绍的解决比较详细:

3. January 12, 2011 5:27 PM in response to: Suntrupth - Oracle
Re: Create Oracle 11gR2 Database witch Batch          

Hello StephanW,

This error most likely related to the New feature for 11.2 which are the editions for the applications.

For more information about editions refer to
Step 4: Submit the SQL*Plus CONNECT Statement
Which repents that you set a session edition when connecting from sqlplus .

so we need to verify if there was any editions specified during connection .

This could easily reproduce as per the testcase .

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jul 21 16:28:45 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> create edition e1 ;

Edition created.

SQL> <create database command>

SQL> startup nomount ---> should result in SP2-1540

Please refer Oracle® Database Administrator's Guide 11g Release 2 (11.2)
Managing Editions
for more information about editions

Thanks,
Suntrupth-Moderator

12. January 14, 2011 8:03 AM in response to: Shailesh sashi - Oracle
Re: Create Oracle 11gR2 Database witch Batch          


There was something funny.
The commands executed manually in cmd and sqlplus work, but not in my batch.

But I found the error:

I set about installing the Oracle 10g software on a variable.
This variable was the edition of the software installation as SE, EE, ...

set ORA_EDITION = SE

This variable is now used by Oracle 11gR2 but himself.

Many thanks for your help.

回复 只看该作者 道具 举报

3#
发表于 2013-1-24 12:15:25
shutdown and startup database again。

回复 只看该作者 道具 举报

您需要登录后才可以回帖 登录 | 注册

QQ|手机版|Archiver|Oracle数据库数据恢复、性能优化

GMT+8, 2024-11-16 06:48 , Processed in 0.045284 second(s), 20 queries .

Powered by Discuz! X2.5

© 2001-2012 Comsenz Inc.

回顶部
TEL/電話+86 13764045638
Email service@parnassusdata.com
QQ 47079569