Running Oracle 9.2.0.4/9.2.0.7 on NetBSD/i386

http://www.telefonica.net/web2/joseyluis/[@more@]Running Oracle 9.2.0.4/9.2.0.7 on NetBSD/i386


For any question send a email to: joseyluis at gmail dot com
Page by Jose Luis Rodriguez Garcia


At the moment it is possible to create and use Oracle databases and these tools/servers:

Database Configuration Assistant (dbca)
Net Configuration Assistant (netca)
Oracle Enterprise Manager (OEM) Console in standalone mode (oemapp console)
Oracle Performance Manager
Oracle Listener (lsnrctl)

These are the tools servers that don't work at the moment:

Intelligent Agent (lsnrctl)

Version 1.2 27/11/2005

Guide for installing Oracle 9.0.4 on NetBSD/i386.
Installation of the 9.2.0.7 patch
Database creation
Graphical database creation
Manual database creation
Network configuration (OracleNet)
Graphical administration
Known issues
Screenshots
Logs : kdumps, etc..
Changes to the document

Guide for installing Oracle 9.0.4 on NetBSD/i386.

First, you need a NetBSD kernel with the last changes on the ipc stuff for Linux compatibility:
Current: After of 10 November of 2005. This version has all the required patches applied.

Othere releases: 3.x after 5 November of 2005, and current after 3 November 2005, you need to apply only this kernel patch: diff.linux-shm.6.
Other releases: 2.x, 3.x and current you need to apply these kernel patches: diff.linux-shm.6 and diff.semopm.

Using NetBSD 1.6.x is not possible, because the Linux Java doesn't work with this version: The installer and the graphical tools use java.

I have installed the next Suse packages:
pc-jose# pkg_info|grep -i suse
suse_base-9.1nb7 Linux compatibility package
suse_expat-9.1nb1 Linux compatibility package for expat binaries
suse_fontconfig-9.1 Linux compatibility package for fontconfig binaries
suse_freetype2-9.1 Linux compatibility package for FreeType2 library
suse_libjpeg-9.1nb1 Linux compatibility package for the JPEG library
suse_libpng-9.1nb1 Linux compatibility package for the PNG library
suse_libtiff-9.1nb1 Linux compatibility package for the TIFF library
suse_x11-9.1nb2 Linux compatibility package for X11 binaries
suse_gtk2-9.1nb3 Linux compatibility package for GTK2 binaries
suse_locale-9.1 Locale files for the Linux compatibility package
suse_glx-9.1 Linux compatibility package for the GL library
suse_compat-9.1 Linux compatibility package with old shared libraries
pc-jose#

Java 1.3 must be installed for use the Oracle Installer:
pc-jose# pkg_info|grep -i sun-jre13
sun-jre13-1.0.15nb2 Sun's Java(tm) Runtime Environment 1.3.1
pc-jose#


Download and uncompress the following rpms:
binutils-2.15.90.0.1.1-31.i586.rpm
coreutils-5.2.1-23.8.i586.rpm
cpp-3.3.3-41.i586.rpm
gcc-c++-3.3.3-41.i586.rpm
gcc_old-2.95.3-175.2.i586.rpm
glibc-devel-2.3.3-98.i586.rpm
grep-2.5.1-416.i586.rpm
libstdc++-devel-3.3.3-41.i586.rpm
make-3.80-184.i586.rpm
orarun-1.8-109.15.i586.rpm

For uncompress the rpms, I executed:
cd /emul/linux
rpm2pkg /path-to-rpm-file

Set default compiler for Linux gcc/c++ 2.95
bash$ cd /emul/linux/usr/bin
mv c++ c++.old
mv g++ g++.old
ln -s ../../opt/gcc295/bin/gcc gcc
ln -s ../../opt/gcc295/bin/c++ c++
ln -s ../../opt/gcc295/bin/gcc gcc

Create symbolic links for awk and sed:
cd /emul/linux/bin
ln -s /usr/bin/awk awk
ln -s /usr/bin/sed sed

Create the arch script
cd /emul/linux/bin
#!/emul/linux/bin/bash
cat > arch
echo i686
^D
chmod a+x arch

Download the software
Download the 3 CDs from:
http://www.oracle.com/technology/software/products/oracle9i/index.html
Choose Oracle 9i Database Release 2 Enterprise/Standard Edition for Linux. For download these CDs you have to register. It is free and easy to do.

Uncompress the 3 CDs:
gzcat ship_9204_linux_disk1.cpio | cpio -idmv
gzcat ship_9204_linux_disk2.cpio | cpio -idmv
gzcat ship_9204_linux_disk3.cpio | cpio -idmv

Mount procfs with the following options in the /etc/fstab file:
Add this line to vfstab:
/emul/linux/proc procfs rw,linux

Mount the procfs filesystem:
$ mount procfs

Create /proc/stat and /proc/swaps
I don't know that Oracle searchs for these files. May be that installation works without these files.
Copy these files to /proc: stat and swaps.

Create the Oracle account and groups:

It is needed a oracle user. I have chosen the linux bash as shell.

Two groups are needed: oinstall: owns the files for any installation of Oracle on the machine. By example: if there is a Oracle9i and Oracle 10g, and if it is created two users: oracle8 and oracle9 both users must have oinstall as primary group) and dba. The oinstall group must be the primary group (the one that appears as gid in /etc/passwd/etc.masterpasswd.
A optional third group: oper. It has restricted privileges and is useful for operators.
You can choose any name for the user and group accounts. I have chosen the default accounts: oracle, oinstall, dba and oper. These are the resulting /etc/passwd and /etc/group:

/etc/passwd:
oracle:*:101:100:Oracle administrator:/usr/oracle:/emul/linux/bin/bash

/etc/group:
oinstall:*:1000:oracle
dba:*:1001:oracle
oper:*:1002:oracle


Kernel options
I have used the following kernel options:
options SYSVMSG # System V-like message queues
options SYSVSEM # System V-like semaphores
options SEMMNI=128 # number of semaphore identifiers
options SEMMNS=256 # number of semaphores in system
#options SEMUME=10 # max number of undo entries per process
#options SEMMNU=30 # number of undo structures in system
options SYSVSHM # System V-like memory sharing
options SHMMAXPGS=409600 # 2048 pages is the default
options P1003_1B_SEMAPHORE # p1003.1b semaphore support

The linux emulation must be activated (this is activated by default on GENERIC kernels):
options COMPAT_LINUX # binary compatibility with Linux

Optionally you can use these options for debug problems with the ipc calls under NetBSD. They generate a lot of debug information on /var/log/messages
options SEM_DEBUG
options SHMDEBUG

Recompile the kernel and reboot.

Setting environment variables:
The Oracle binaries are installed under ORACLE_HOME. ORACLE_HOME tree is under the ORACLE_BASE directory:
ORACLE_BASE
|___
ORACLE_HOME.

An example is ORACLE_HOME=/u01/app, and ORACLE_HOME=/u01/app/oracle/product/9.2.0

Two different Oracle products, can't share the same ORACLE_HOME, but they can share the same ORACLE_BASE. Under ORACLE_BASE are installed the binaries (ORACLE_HOME) and it is the default location for log files, creation scripts of the database, when the dbca (the graphical tool for create databases) is used.


Important: ORACLE_BASE must be set. There is a bug in Oracle 9.2.0.4 for Linux, failing the installation in the second/third Window, if the variable ORACLE_BASE hasn't been set. For the installation, ORACLE_HOME is not a requirement, but it is necessary for the execution of the Oracle programs.

This is .profile file that I have used:


export ORACLE_BASE=/usr/oracle/oracle

export ORACLE_HOME=/usr/oracle/oracle/9.2

export PATH=$ORACLE_HOME/bin:/bin:/usr/bin:/usr/pkg/bin:/usr/local/bin

export LD_LIBRARY_PATH=/emul/linux/lib:$ORACLE_HOME/lib

export ORACLE_SID=PRUEBA

export THREADS_FLAG=native

#export LD_PRELOAD=/emul/linux/usr/lib/libInternalSymbols.so


The order of the directories /bin and /usr/bin is important, if /usr/bin is before than the /bin directory, some Oracle scripts will fail because (they found the NetBSD binary instead of the Linux binary).
The line with export THREADS_FLAG=native it is necessary for dbca (Database Configuration Asistant)

Installation:
As an oracle user:
export JRE_LOCATION=/usr/pkg/java/sun-1.3.1
cd Disk1
./runInstaller

When it asks for Installation type, select Custom.
In the next screen deselect The subcomponent Enterprise Manager Web Site (it is one of the components of "Oracle Enterprise Manager Products").
When it asks for Oracle Management Server Repository I have chosen: The Management Server will use an existing repository.
When it asks for Create Database: Select No

The installation will request run several scripts (root.sh) as root. You must edit this files and replace the strings #!/bin/sh or #!/bin/bash with the string #!/pkg/emul/bin/bash.

The installation will fail at the linkage phase, after of copying all files. At this point you must modify all scripts on the Oracle Database. You must replace the strings "#!/bin/sh", and "#!/bin/bash" with the string "#!/usr/pkg/emul/bin/bash". The script fix_scripts searchs all shell scripts and does a automated searching and replacing:

$ cd $ORACLE_BASE
$ fix_scritps

Be carefull with fix_scripts: it will modify all scripts that founds under the directory from where it is executed.




Relinking database
Execute this command at the end of the installation for ensure that all binaries are properly linked:

$ relink all

There must be only on error: A message saying that it doesn't find cob (cobol compiler). This isn't important.

When it finish execute these commands:

$ cd ${ORACLE_HOME}/lib
$ mv libvppdc.so libvppdc.so.old
$ gcc -O1 -Wl,-h,libvppdc.so -o libvppdc.so -shared ${ORACLE_HOME}/network/lib/libvppdc.a -L${ORACLE_HOME}/lib -lirc `cat ${ORACLE_HOME}/network/lib/libvppdc.def| grep -E "[a-zA-Z]+[;]" | sed 's/^/-u/' | sed 's/;//'`

This is last step is for resolve a problem with the graphical performance manager with some linux version and Oracle 9.2.0.4 (usually unsupported Linux versions).


Postinstallation steps
Add the following lines to the file $ORACLE_BASE/jre/1.1.8/bin/jre:

PRG=$ORACLE_BASE/jre/1.1.8/bin/.java_wrapper
export LD_PRELOAD=/emul/linux/usr/lib/libInternalSymbols.so

These lines must be added under the line that begins: "# If PRG is a symlink, trace it to the real ...."


Installation of the 9.2.0.7 patch
You will need to download this file: p4163445_92070_LINUX.zip
You can find this patch in Metalink->Patches->Quick Links to the Latest Patchets...->Oracle Database->Linux x86->9.2.0.7.
You will need Oracle support for login to metalink (http://metalink.oracle.com)

As root user:
#cd /emul/linux/usr/lib
#ln -s ../../lib/libpthread.so.0 libpthread.so.0
This links resolves a error about the __sF symbol not found.


As oracle user do:
$ulimit -d 656020
mkdir patch-dir
cd patch-dir
unzip /path-to-file/ p4163445_92070_LINUX.zip
cd Disk1/install

edit the oraparam.ini file, and add "-native" to the line that begins with: JRE_OSDPARAM=
The resulting line will be:
JRE_OSDPARAM="-native"

cd ..
./runInstaller


During the installation you will obtain a error message similar to this:
Error in invoking target 'install' or makefile
'/usr/oracle/oracle/9.2/rdmbs/lib/ins_rdbms.mk' See
'/usr/oracle/oracle/oraInventory/logs/installActions2005-12-02_10-54-37PM.log' for details
Execute the fix_scripts as oracle user in the $ORACLE_BASE directory and press Retry. If this fails other time change to the directory, and do a make -f file.mk.

$cd $ORACLE_BASE
path-to-fix-scripts/fix-scripts

When the setup program requests the execution of the root.sh, as root check that it begins with #!/emul/linux/bin/sh.

For execute the script as root do a su - root -c /emul/linux/bin/bash

At the end of the installation of the patch, it is better to ensure that all libraries are linked. Execute this as oracle:

$ relink all


Follow the instructions contained in the patch if you have to upgrade databases.

Database creation
Graphical database creation
This is the recomended way for create the database: use the graphical tool dbca. You can found two bugs in the database creation:

"ORA-29807: specified operator does not exist" during the database creation, you must ignore this message and run the script prvtxml.plb located in $ORACLE_HOME/rdbms/admin at the end of the installation. After of this run the script utlrp.sql for ensure that there aren't invalid objects in the database. This is the Oracle bug 2925665.
"ORA-10430: column being added already exists in table". Ignore this error, this is a known Oracle bug 3955522.

For run scripts do the next:
export ORACLE_SID=database;
sqlplus /nolog
sqlplus>connect / as sysdba
sqlplus>@?/rdbms/admin/script
sqlplus>quit


Manual database creation
If you want to create the database manually follow these steps:

The script used for create the database is in this file: create.sql

It is need file for the parameters configuration of the database. This file is called is init$ORACLE_SID.ora where ORACLE_SID is the name of the database. This file must be stored in $ORACLE_HOME/dbs.

I have called to my database PRUEBA (this is TEST in Spanish language): initPRUEBA.ora

For create the database do:
export ORACLE_SID=PRUEBA
$ sqlplus /nolog
sqlplus> connect / as sysdba
sqlplus> startup nomount
sqlplus>@path/create.sql
sqlplus>quit

You need to create the structure of directories where the datafiles are stored before of the database creation.

If you want to access from the graphical console you will have to create a password file. For this you need the command orapwd:
shutdonw the database:
sqlplus /nolog
sql> connect / as sysdba
sql> shutdown immediate
sql> quit
cd $ORACLE_HOME/dbs
orapwd file=orapw$SID password=mypassword

start the database
and execute this command:
sqlplus /nolog
sql>connect / as sysdba
sql>startup
sql>alter user sys identified by "mypassword";
sql>quit


Network configuration (OracleNet)


These are the files that I used for configure OracleNet:
tnsames.ora
listener.ora


The must be stored under $ORACLE_HOME/network/admin.


For start the listener:

$ lsnrctl start
It talkes a long time to start, but it works ok.



Graphical administration
For start the graphical console use this command:

$oemapp console


Known issues

The NetBSD linux emulation doesn't implement /proc/loadavg. It produces a warning in the log of server, and generates a trace file (.trc extension) at the startup of database.

The #! symbol indicates to the kernel the shell to use for run a script, it doesn't use the virtual root file system (/emul/linux). #!/bin/sh,#!/bin/bash, must be replaced by: #!/emul/linux/bin/bash in all linux scripts. ¿ Can it be a namei issue?
The graphical Performance Manager doesn't work by default. It is a Linux issue with some Linux versions and Oracle 9.2.0.4. You can try to resolve this with these commands:


$ cd ${ORACLE_HOME}/lib
$ mv libvppdc.so libvppdc.so.old
$ gcc -O1 -Wl,-h,libvppdc.so -o libvppdc.so -shared ${ORACLE_HOME}/network/lib/libvppdc.a -L${ORACLE_HOME}/lib -lirc `cat ${ORACLE_HOME}/network/lib/libvppdc.def| grep -E "[a-zA-Z]+[;]" | sed 's/^/-u/' | sed 's/;//'`

$ ls -l libvppdc.so
-rwxr-xr-x 1 oracle oinstall 555621 Jun 15 17:12 libvppdc.so*



The Enterprise Manager Web Site can't be used. Its installation fails.
The Intelligent agent doesn't work. It fails when it is started:

-bash-2.05b$ agentctl start agent

DBSNMP for Linux: Version 9.2.0.4.0 - Production on 13-NOV-2005 23:08:11

Copyright (c) 2003 Oracle Corporation. All rights reserved.

Starting Oracle Intelligent Agent.../usr/oracle/oracle/9.2/bin/dbsnmpwd: line 156: 6010 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1
/usr/oracle/oracle/9.2/bin/dbsnmpwd: line 156: 3854 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1
/usr/oracle/oracle/9.2/bin/dbsnmpwd: line 156: 1259 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1
/usr/oracle/oracle/9.2/bin/dbsnmpwd: line 156: 20406 Segmentation fault nohup $ORACLE_HOME/bin/dbsnmp $* >>$DBSNMP_WDLOGFILE 2>&1


Screenshots
Oracle Enterprise Manager (OEM) Console
Oracle Performance Manager


Logs : kdumps, etc..

They are for NetBSD developers interested in resolve pending issues.
Log1 Log of these commands:

sqlplus /nolog
sqlplus>connect / as /sysdba
sqlplus>startup nomount
sqlplus>quit
In this log is visible the /proc/loadavg fail.

Changes to the document
Version 1.2 2/12/2005
Instructions for update Oracle to 9.2.0.7 version
Updated fix_scripts: solves problem with permisions and other minor fix.
Instructions for create by hand the password file.


Version 1.1 20/11/2005
Resolved the problem with dbca: Add this line to the file .profile: export THREADS_FLAG=native
Added arch script
Added /proc/stat and /proc/swaps

Version 1.0 15/11/2005
First version of the document

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/83980/viewspace-836715/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/83980/viewspace-836715/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值