Обновление XE до 11g EE

Alexanderpeshkov
Дата: 14.03.2011 12:17:46
Всем привет!

не разу не сталкивался с миграцией бд на оракле и поэтому решил заранее подстраховаться чтобы если поставят задачу переезда на платную БД знал что делать.

скачал с офиц сайта 11g 11.2.0.0.0
развернул на виртуалке под виндой 2003
сделал холодный бекап с оракла XE, пуск->oracle XE->backup, развернул его под 11g правда он не дал мне запустить базу обычным способом и сказал что надо запускать startup с опцией upgrade.
я так и сделал теперь у меня бд в состоянии open migrate.
я нашел пару док по этому делу в инете и там было сказано что можно делать миграцию либо с помощью Database Upgrade Assistant или вручну запустив скрипт
@C:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\catupgrd.sql
я пробовал оба способа первый сразу мне сказал (в приложенном файле)
а в ручную у меня получилось вот это
SQL> @C:\app\Administrator\product\11.2.0\dbhome_1\RDBMS\ADMIN\catupgrd.sql
DOC>#######################################################################
DOC>#######################################################################
DOC>
DOC>   The first time this script is run, there should be no error messages
DOC>   generated; all normal upgrade error messages are suppressed.
DOC>
DOC>   If this script is being re-run after correcting some problem, then
DOC>   expect the following error which is not automatically suppressed:
DOC>
DOC>   ORA-00001: unique constraint (<constraint_name>) violated
DOC>		  possibly in conjunction with
DOC>   ORA-06512: at "<procedure/function name>", line NN
DOC>
DOC>   These errors will automatically be suppressed by the Database Upgrade
DOC>   Assistant (DBUA) when it re-runs an upgrade.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
DOC>######################################################################
DOC>######################################################################
DOC>	The following statement will cause an "ORA-01722: invalid number"
DOC>	error if the user running this script is not SYS.  Disconnect
DOC>	and reconnect with AS SYSDBA.
DOC>######################################################################
DOC>######################################################################
DOC>#

строки не выбраны

DOC>######################################################################
DOC>######################################################################
DOC>	The following statement will cause an "ORA-01722: invalid number"
DOC>	error if the database server version is not correct for this script.
DOC>	Shutdown ABORT and use a different script or a different server.
DOC>######################################################################
DOC>######################################################################
DOC>#

строки не выбраны

DOC>#######################################################################
DOC>#######################################################################
DOC>   The following statement will cause an "ORA-01722: invalid number"
DOC>   error if the database has not been opened for UPGRADE.
DOC>
DOC>   Perform a "SHUTDOWN ABORT"  and
DOC>   restart using UPGRADE.
DOC>#######################################################################
DOC>#######################################################################
DOC>#

строки не выбраны

DOC>#######################################################################
DOC>#######################################################################
DOC>	 The following statement will cause an "ORA-01722: invalid number"
DOC>	 error if the Oracle Database Vault option is TRUE.  Upgrades cannot
DOC>	 be run with the Oracle Database Vault option set to TRUE since
DOC>	 AS SYSDBA connections are restricted.
DOC>
DOC>	 Perform a "SHUTDOWN ABORT", relink the server without the Database
DOC>	 Vault option (but with the OLS option), and restart the server using
DOC>	 UPGRADE.
DOC>
DOC>	 Restriction is for:
DOC>	 1) When source database has no DV installed.
DOC>	 OR
DOC>	 2) When source database has DV installed and DV version is prior to 11.2.
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#

строки не выбраны

DOC>#######################################################################
DOC>#######################################################################
DOC>   The following statement will cause an "ORA-01722: invalid number"
DOC>   error if Database Vault is installed in the database but the Oracle
DOC>   Label Security option is FALSE.	To successfully upgrade Oracle
DOC>   Database Vault, the Oracle Label Security option must be TRUE.
DOC>
DOC>   Perform a "SHUTDOWN ABORT", relink the server with the OLS option
DOC>   (but without the Oracle Database Vault option) and restart the server
DOC>   using UPGRADE.
DOC>#######################################################################
DOC>#######################################################################
DOC>#

строки не выбраны

DOC>#######################################################################
DOC>#######################################################################
DOC>   The following statement will cause an "ORA-01722: invalid number"
DOC>   error if bootstrap migration is in progress and logminer clients
DOC>   require utlmmig.sql to be run next to support this redo stream.
DOC>
DOC>   Run utlmmig.sql
DOC>   then (if needed)
DOC>   restart the database using UPGRADE and
DOC>   rerun the upgrade script.
DOC>#######################################################################
DOC>#######################################################################
DOC>#

строки не выбраны

DOC>#######################################################################
DOC>#######################################################################
DOC>   The following statement will cause:
DOC>   - "ORA-00942: table or view does not exist" ; or
DOC>   - "ORA-00904: "TZ_VERSION": invalid identifier"" ; or
DOC>   - "ORA-01722: invalid number"
DOC>	 if the pre-upgrade utility (utlu112i.sql) has not been run to:
DOC>	 a) create and update registry$database table to include the current
DOC>	    database timezone file version used in the old release; or
DOC>	 b) do inserts into sys.props$.
DOC>
DOC>	 o Action:
DOC>	   Shutdown ABORT and revert to the original ORACLE_HOME.  Then run
DOC>	   utlu112i.sql to populate registry$database with the database timezone
DOC>	   file version used by the lower version database and to populate
DOC>	   sys.props$ with Day Light Saving Time (DST) properties information.
DOC>
DOC>   OR
DOC>   - An "ORA-01722: invalid number"
DOC>	 if the old release uses a timezone file version newer than 8 (shipped with
DOC>	 11.2) but the new release has not been patched yet.
DOC>
DOC>	 o Action:
DOC>	   Shutdown ABORT and patch new ORACLE_HOME to the same timezone file
DOC>	   version as used in the old ORACLE_HOME.
DOC>
DOC>
DOC>#######################################################################
DOC>#######################################################################
DOC>#
       TO_NUMBER(value$) != (SELECT tz_version from registry$database))
                                                    *
ошибка в строке 6:
ORA-00942: таблица или представление пользователя не существует 

подскажите правильно ли я вообще начал делать миграцию и что дальше делать т.к. в ручном режиме токая же ошибка
Alexander Ryndin
Дата: 14.03.2011 12:21:13
Alexanderpeshkov,

сделайте лучше с помощью дампа.
impdp/expdp
Alexanderpeshkov
Дата: 14.03.2011 15:36:28
Alexander Ryndin,
делаю как вы сказали через expdp
expdp system/password full=Y directory='C:\exp\' dumpfile=TESTDB.dmp logfile=expdpTESTDB.log 
не подскажите как побороть ошибку
C:\Documents and Settings\Администратор>expdp system/truba full=Y directory=test
_dir dumpfile=TESTDB.dmp logfile=expdpTESTDB.log

Export: Release 10.2.0.1.0 - Production on ╨Я╨╛╨╜╨╡╨┤╨╡╨╗╤М╨╜╨╕╨║, 14 ╨Ь╨░╤А╤В,
2011 13:46:28

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Productio
n
ORA-39006: internal error
ORA-39213: Metadata processing is not available

кроме экспорта импорта больше нет других инструментов перейти на 11g?
Сергей Арсеньев
Дата: 14.03.2011 15:53:26
Alexanderpeshkov
кроме экспорта импорта больше нет других инструментов перейти на 11g?

А нужны?
tru55
Дата: 14.03.2011 15:54:20
Alexanderpeshkov
кроме экспорта импорта больше нет других инструментов перейти на 11g?

кроме expdp / impdp есть и обычные exp / imp
Сергей Арсеньев
Дата: 14.03.2011 15:55:59
Alexanderpeshkov,

Кстати не помешает:
chcp 1251
set NLS_LANG=AMERICAN.AMERICA_CL8MSWIN1251

можно еще попробовать exp (без dp)
Maxim Demenko
Дата: 14.03.2011 16:32:21
Alexanderpeshkov
Alexander Ryndin,
делаю как вы сказали через expdp
expdp system/password full=Y directory='C:\exp\' dumpfile=TESTDB.dmp logfile=expdpTESTDB.log 
не подскажите как побороть ошибку
C:\Documents and Settings\Администратор>expdp system/truba full=Y directory=test
_dir dumpfile=TESTDB.dmp logfile=expdpTESTDB.log

Export: Release 10.2.0.1.0 - Production on ╨Я╨╛╨╜╨╡╨┤╨╡╨╗╤М╨╜╨╕╨║, 14 ╨Ь╨░╤А╤В,
2011 13:46:28

Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Connected to: Oracle Database 10g Express Edition Release 10.2.0.1.0 - Productio
n
ORA-39006: internal error
ORA-39213: Metadata processing is not available

кроме экспорта импорта больше нет других инструментов перейти на 11g?


Перед экспортом было бы для начала неплохо
connect system/truba
create or replace directory test_dir as 'C:\exp';

Best regards

Maxim
Alexanderpeshkov
Дата: 14.03.2011 17:03:51
exp работает но не совсем понятно.
правильно ли я понимаю что мне надо делать только экспорт своих схем, full не подойдет?
пробовал экспортить full импорт с ошибкой завершает.

попробовал сделать импорт только своей схемы получилось, но он загрузил под тем юзером под которым я зашел в импорт (sys). вопрос если полный импорт не работает при миграции и я делаю импорт только схемы, пользователя которого я импортирую самому что ли создавать или я что то не так делаю.
потому что если я зайду под своим пользователем то он не импортирует привилегии для моего юзера т.к. прав не хватит для выдать самому себе права =)
Сергей Арсеньев
Дата: 14.03.2011 17:09:36
Alexanderpeshkov,

Экспорт-импорт лучше делать не под sys а под system.

Да, если делать импорт не всей схемы, а отдельный пользователей (from_user to_user) то они должны быть созданы (автосоздание в expdp/impdp). Более того должны быть созданы те роли и пользователи, которым будут делегироваться права.

Так же не плохо создать используемые табличные пространства заранее (особенно если распологать их предполагается в другом месте и с другими параметрами).
Alexanderpeshkov
Дата: 14.03.2011 17:14:50
Сергей Арсеньев,
А всю схему в моем случае при миграции с бесплатного оракла на 11 версию можно делать? просто у меня дамп сделался а загрузить весь дам в 11 версию я не смог он поругался поругался и написал что завершен с ошибками.