使用DBUA升级数据库从9i到10G

OS: HP-UX 11.23

# uname -a
HP-UX RX3600-3 B.11.23 U ia64 1955595348 unlimited-user license

 

ORACLE 9.2.0.6

ORACLE 10.2.0.1

 

注: 不会在这里贴图, 所以把图全删了, 改用文字描述.


1. 使用和9i相同的用户来安装Oracle10G,安装时选择不同的ORACLE_HOME目录,并且取消建库选择项。

 

在安装Oracle10G的时,安装程序检查出HP-UX有不符合的条件:

Checking for PHSS_33278; found Not found. Failed <<<<

Checking for PHSS_33279; found Not found. Failed <<<<

Checking for PHSS_33277; found Not found. Failed <<<<

Checking for PHSS_33279; found Not found. Failed <<<<

 

Checking for maxssiz_64bit=1073741824; found maxssiz_64bit=268435456. Failed <<<<

Checking for maxswapchunks=16384; found no entry. Failed <<<<

Checking for maxuprc=3687; found maxuprc=256. Failed <<<<

Checking for msgmap=4098; found msgmap=514. Failed <<<<

Checking for msgmni=4096; found msgmni=512. Failed <<<<

Checking for msgseg=32767; found msgseg=8192. Failed <<<<

Checking for msgtql=4096; found msgtql=1024. Failed <<<<

Checking for semmap=4098; found no entry. Failed <<<<

Checking for shmmni=512; found shmmni=400. Failed <<<<

Checking for vps_ceiling=64; found vps_ceiling=16. Failed <<<<

Check complete. The overall result of this check is: Failed <<<<

Problem: The kernel parameters do not meet the minimum requirements (see above).

Recommendation: Perform operating system specific instructions to update the kernel parameters.

 

上面提示的补丁没理,只修改了要求的系统参数(不加参数则表示参数立刻生效)

kctune -h maxssiz_64bit="1073741824"

kctune -h maxswapchunks=16384"

kctune -h maxuprc="3687"

kctune -h msgmap="4098"

kctune -h msgmni="4096"

kctune -h msgseg="32767"

kctune -h msgtql="4096"

kctune -h semmap="4098"

kctune -h shmmni="512"

kctune -h vps_ceiling="64"

 

2. 确认/etc/oratab文件里含有要升级的数据库的条目,在此文件的配置里,要使用9i的环境变量,dbua会自动更新该文件,如下:

*:/oracle/oracle/product/9.2.0:N

 

gxsi:/oracle/oracle/product/9.2.0:N

 

dbua程序执行过程中即更新该文件:

 

*:/oracle/oracle/product/9.2.0:N

 

gxsi:/oracle/oracle/product/10.2.0:N

 

 

3. 设置环境变量以准备执行dbua

 

#su – oracle

 

因为要使用10GDBUA,所以要使ORACLE_HOME变量的为10G的目录:

 

export ORACLE_BASE=/oracle/oracle

 

export ORACLE_HOME=/oracle/oracle/product/10.2.0/

 

export PATH=$ORACLE_HOME/bin:$PATH

export DISPLAY=10.154.249.5:1.0

 

可以使用xclock来测试。

 

 

4. 执行DBUA启动升级过程

 

启动DBUA,出现DBUA的安装界面,是一些关于DBUA升级的说明.

 

 

5. 点击next出现如下图,选择要升级的数据库。如果上面第2步没有做,则在下图的 Available Database选择框里无法出现内容。

注:此处画面显示的是当前Oracle里所包含的库列表.

 

 

6. 在上图中选择好要升级的数据库后,点击next下一步.

在此处出现了一个错误:

问题1

 

For input string: ""

Upgrade configuration file

/oracle/SND/102_64/cfgtoollogs/dbua/SND/upgrade2/upgrade.xml is not a valid xml file

 

在另一窗口查看该文件,发现该文件正是DBUA升级程序自身产生的,每执行一次则产生一个upgrade*目录。

在网上查找此问题,发现如下原因:

While trying to run the DBUA to upgrade an Oracle 9.2 database to 10.2 I get the error:

For input string: ""

Upgrade configuration file

/oracle/SND/102_64/cfgtoollogs/dbua/SND/upgrade2/upgrade.xml

is not a valid xml file

 

and the DBUA does not run. Please help as this is my first Oracle upgrade ever!

 

 

There have been reported issues when using the DBUA to upgrade to a 10.2 database if the SYS user's temporary tablespace in the Oracle 9.2 database is dictionary managed rather than locally managed. Check to see if this is the case by first querying the DBA_USERS view to determine which tablespace has been defined as temporary for SYS:

 

select temporary_tablespace from dba_users where username='SYS';

 

Then check to see whether this tablespace is locally or dictionary managed:

select tablespace_name, extent_management from dba_tablespaces;

 

If the temporary tablespace defined for the SYS user is a dictionary managed tablespace, try creating another locally managed tablespace and assign it to be the temporary tablespace for SYS as follows:

alter user sys temporary tablespace <new tablespace name here>;

 

Try the upgrade again using the DBUA.

 

 

 

 

 

 

 

 

根据以上描述使用如下方法解决:

根据以上说明,查询原9i数据库后,发现TEMP表空间无数据文件,要修改syssystem用户使用可本地使用的临时表空间。

SQL> select temporary_tablespace from dba_users where username='SYS';

 

TEMPORARY_TABLESPACE

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

TEMP

 

SQL> desc dba_temp_files;

Name Null? Type

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

FILE_NAME VARCHAR2(513)

FILE_ID NUMBER

TABLESPACE_NAME NOT NULL VARCHAR2(30)

……

 

SQL> select file_name from dba_temp_files;

no rows selected

 

SQL> create temporary tablespace temp2 tempfile '/oradata/gxsi/temp02.dbf' size 100M;

Tablespace created.

 

SQL> alter user sys temporary tablespace temp2;

User altered.

 

SQL> alter user system temporary tablespace temp2;

User altered.

 

 

 

 

 

 

 

7. 然后在第5步里点下一步,没有再出现错误,DBUA继续执行.

接下来的几个配置画面里有:

SYSAUX表空间的配置;

Recompile invalid objects at the end of upgrade;

may need to backup database;

configure the database with entherprise manager;

must specify passwords for the user accounts;

Database upgrade Summary;

开始执行升级,等待中...

 

在更新程序升级"Upgrading Oracle Server"序升时出现错误:

ORA-25138: HASH_JOIN_ENABLED initialization parameter has been made obsolete.

 

 

 

 

 

 

 

 

 

 

此错误是在执行”Upgrading Oracle Server”步骤时出现的,因为上不了网,没法查看此错误的原因,点Ignore继续。

查到错误原因了,因为在9i里的部分参数,在10G里已经不适用,所以系统提示此错误,在这里是“HASH_JOIN_ENABLED”参数不适用,此问题待升级完成后用SQLPLUS来修改,如问题2

下面的2个错误提示也均是因为“HASH_JOIN_ENABLED”参数所致。

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

问题1ORA-01102

 

-bash-3.2$ env | grep ORA

ORACLE_SID=gxsi

ORACLE_BASE=/oracle/oracle

 

ORACLE_HOME=/oracle/oracle/product/10.2.0/

 

-bash-3.2$ sqlplus "/as sysdba"

 

SQL*Plus: Release 10.2.0.1.0 - Production on Sun May 25 21:53:09 2008

 

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

 

Connected to an idle instance.

 

SQL> startup

ORA-32004: obsolete and/or deprecated parameter(s) specified

ORACLE instance started.

 

Total System Global Area 1010827264 bytes

Fixed Size 1998744 bytes

Variable Size 469762152 bytes

Database Buffers 536870912 bytes

Redo Buffers 2195456 bytes

ORA-01102: cannot mount database in EXCLUSIVE mode

 

 

SQL>exit

 

More $ORACLE_BASE/admin/gxsi/bdump/Alert_gxsi.log

……

Sun May 25 21:51:06 2008

sculkget: failed to lock /oracle/oracle/product/10.2.0//dbs/lkGXSI exclusive

sculkget: lock held by PID: 13995

……

 

-bash-3.2$ cd $ORACLE_HOME/dbs

-bash-3.2$ ls

hc_gxsi.dat initdw.ora lkGXSI

init.ora initgxsi.ora orapwgxsi

-bash-3.2$ fuser lk*

lkGXSI: 14023o 14001o 13997o 14013o 14005o 13995o 13989o 14019o 13999o 13991o 13993o 14007o 14003o 14009o 15844o

 

-bash-3.2$ fuser -k lk*

lkGXSI: 14023o 14001o 13997o 14013o 14005o 13995o 13989o 14019o 13999o 13991o 13993o 14007o 14003o 14009o 15844o

 

-bash-3.2$ fuser lk*

lkGXSI:

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

问题2ORA-32004

 

查看$ORACLE_HOME/admin/gxsi/alert_gxsi.log

Obsolete system parameters with specified values:

hash_join_enabled

 

End of obsolete system parameter listing

 

more $ORACLE_HOME/dbs/initgxsi.ora

 

background_dump_dest=/oracle/oracle/admin/gxsi/bdump

compatible=9.2.0.0.0

control_files=/oradata/gxsi/ora_control01, /oradata/gxsi/ora_control02, /oradata/gxsi/ora_control03

core_dump_dest=/oracle/oracle/admin/gxsi/cdump

 

db_block_size=8192

db_cache_size=536870912

db_domain=""

db_file_multiblock_read_count=16

db_name=gxsi

fast_start_mttr_target=300

#hash_join_enabled=TRUE

 

instance_name=gxsi

java_pool_size=0

large_pool_size=16777216

open_cursors=300

pga_aggregate_target=471859200

processes=200

query_rewrite_enabled=FALSE

remote_login_passwordfile=EXCLUSIVE

sga_max_size=1008159928

shared_pool_size=419430400

sort_area_size=524288

star_transformation_enabled=FALSE

timed_statistics=FALSE

undo_management=AUTO

undo_retention=10800

undo_tablespace=UNDOTBS1

user_dump_dest=/oracle/oracle/admin/gxsi/udump

job_queue_processes=1

 

因为数据库启动用的是pfile,在库里无法使用ALTER SYSTEM RESET log_archive_start SCOPE=SPFILE SID='*'; 来修改,所以直接vi编辑initgxsi.ora文件,将其中的#hash_join_enabled=TRUE参数注释掉,然后再将数据库shutdown immediatestartup后,问题解决!

 

 

 

 

问题3temp表空间无数据文件

 

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

WARNING: The following temporary tablespaces contain no files.

This condition can occur when a backup controlfile has

been restored. It may be necessary to add files to these

tablespaces. That can be done using the SQL statement:

ALTER TABLESPACE <tablespace_name> ADD TEMPFILE

Alternatively, if these temporary tablespaces are no longer

needed, then they can be dropped.

Empty temporary tablespace: TEMP

(SQL> drop tablespace temp问题解决)

 

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

Database Characterset is US7ASCII

 

 

问题4listener.oratnsnames.ora

 

升级完成后,系统没有listener.oratnsnames.ora,需要使用netca来创建,创建好后需要手动编辑listener.ora来添加gxsi监听:

-bash-3.2$ more tnsnames.ora

 

# tnsnames.ora Network Configuration File: /oracle/oracle/product/10.2.0/network/admin/tnsnames.ora

# Generated by Oracle configuration tools.

 

GXSI =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.154.249.23)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = gxsi)

)

)

 

EXTPROC_CONNECTION_DATA =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

(CONNECT_DATA =

(SID = PLSExtProc)

(PRESENTATION = RO)

)

)

 

-bash-3.2$ more listener.ora

 

# listener.ora Network Configuration File: /oracle/oracle/product/10.2.0/network/admin/listener.ora

# Generated by Oracle configuration tools.

 

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /oracle/oracle/product/10.2.0)

(PROGRAM = extproc)

)

(SID_DESC =

(SID_NAME = gxsi)

(ORACLE_HOME = /oracle/oracle/product/10.2.0)

(SID_NAME = gxsi)

)

)

 

LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 10.154.249.23)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ORA-32004: obsolete and/or deprecated parameter(s) specified

错误2: Performing Post Upgrade

ORA-32003: error occured processing parameter "hash_join_enabled"

ORA-01078: failure in processing system parameters

错误1: Performing Post Upgrade

 

 

 

 

 

 

 

 

 

 

 

你可能感兴趣的:(oracle,sql,SQL Server,bash,HP)