Caros amigos,Precisei restaurar um backup de uma base de dados 10g, porem nao achei mais a instalacao do software Oracle versao 10g e por isso tive que instalar no 11g e efetuar o Upgrade. A restauracao ocorreu normal. Preparei o ambiente (spfile, pastas, etc) e comecei a restauracao:export ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1export ORACLE_SID=OLDDBexport PATH=$PATH:/u01/app/oracle/product/11.2.0/dbhome_1/bin:.:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/u01/app/oracle/product/11.2.0/dbhome_1/OPatchRMAN> restore controlfile from '/u01/olddb/o1_mf_ncsn0_TAG20120309T190017_7onzdd6z_.bkp';RMAN> alter database mount;RMAN> catalog start with '/u01/olddb' noprompt;RMAN> run{set newname for datafile 1 to new;set newname for datafile 2 to new;set newname for datafile 3 to new;set newname for datafile 4 to new;restore database;switch datafile all;recover database;}RMAN> exit--# Pronto, agora o open resetlogs no SQLPLUS e a tentativa de execucao do script de Pre-Upgrade:SQL> alter database open resetlogs upgrade; --# (ou STARTUP UPGRADE apos um "alter database open resetlogs")Database altered.SQL> @$ORACLE_HOME/rdbms/admin/utlu112i.sqlERROR:ORA-04023: Object SYS.STANDARD could not be validated or authorizedDECLARE*ERROR at line 1:ORA-04023: Object SYS.STANDARD could not be validated or authorizedERROR:ORA-04023: Object SYS.STANDARD could not be validated or authorized--# Pelo erro nao ia dar muito certo, mas eu tentei executar o UPGRADE:SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sqlDOC>#######################################################################DOC>#######################################################################DOC>DOC> The first time this script is run, there should be no error messagesDOC> generated; all normal upgrade error messages are suppressed.DOC>.. --#(para brevidade)DOC>#######################################################################DOC>#######################################################################DOC> The following error is generated if the pre-upgrade tool has not beenDOC> 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 numberDOC>DOC> o Action:DOC> Shutdown database ("alter system checkpoint" and then "shutdown abort").DOC> Revert to the original oracle home and start the database.DOC> Run pre-upgrade tool against the database.DOC> Review and take appropriate actions based on the pre-upgradeDOC> output before opening the datatabase in the new software version.DOC>DOC>#######################################################################DOC>#######################################################################DOC>#SELECT TO_NUMBER('MUST_HAVE_RUN_PRE-UPGRADE_TOOL_FOR_TIMEZONE') *ERROR at line 1:ORA-01722: invalid numberDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing options--# Em contato com o suporte Oracle eles pediram pra eu fazer isso e rodar o Upgrade de novo, mas nao deu certo:SQL> ALTER TABLE registry$database ADD TZ_VERSION number;SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql --# mesmo erro acima...DOC>#######################################################################DOC>#######################################################################DOC>#SELECT TO_NUMBER('MUST_HAVE_RUN_PRE-UPGRADE_TOOL_FOR_TIMEZONE') *ERROR at line 1:ORA-01722: invalid number--# Ele pediu entao que eu verificasse as tabelas abaixo e comparasse o valor do TZ_VERSION da visao registry$database que deveria estar com o mesmo valor do campo VERSION na visao v$timezone_file:SQL> select * from registry$database ;PLATFORM_ID PLATFORM_NAME EDITION TZ_VERSION----------- ----------------------------------------------------------------------------------------------------- ------------------------------ ---------- 6 AIX-Based Systems (64-bit) SQL> Select version from v$timezone_file; VERSION---------- 14--# Pelo jeito nao estava, entao ele pediu pra inserir:SQL> INSERT into registry$database(platform_id, platform_name, edition, tz_version)VALUES ((select platform_id from v$database),(select platform_name from v$database),NULL,(select version from v$timezone_file));--# Ficou assim:SQL> select * from registry$database ;PLATFORM_ID PLATFORM_NAME EDITION TZ_VERSION----------- ----------------------------------------------------------------------------------------------------- ------------------------------ ---------- 6 AIX-Based Systems (64-bit) 6 AIX-Based Systems (64-bit) 14--# Aparentemente nao ia dar certo, mas executei e deu o erro confirmando o que deveria ser feito:SQL> @catupgrd.sql... --# (para brevidade)DOC> output before opening the datatabase in the new software version.DOC>DOC>#######################################################################DOC>#######################################################################DOC>#Session altered.Table created.Table altered. ((SELECT tz_version from registry$database) is null) *ERROR at line 8:ORA-01427: single-row subquery returns more than one rowSQL> delete from registry$database where tz_version is null;1 row deleted.SQL> commit;Commit complete.SQL> @catupgrd.sql --Sucesso!SQL> @utlrp.sql --Sucesso!SQL> @utlu112s.sql --Tudo VALID! (exceto para o Oracle