wantin6
高级工程师
帖子
1209
精华
7
无忧币 16024
积分 13314
阅读权限 70
|
发表于:2006-8-5 23:27
标题:在FreeBSD上安装Oracle教程
<上一帖 |
下一帖>
源地址:http://ezine.daemonnews.org/200402/oracle.html
Installing Oracle9i on FreeBSD
Brian C. Ledbetter,
DISCLAIMER
Before We Begin
Step 1: Prerequisites
Step 2: Getting Oracle9i for Linux Distribution
Step 3: Preparing The Installation Process
Create /compat/linux/etc/mtab
Symlink /bin/awk, /bin/sed, /sbin/chown
Create /compat/linux/bin/arch
Configure SYSV Shared Memory
Step 4: Creating the Appropriate User Accounts
Step 5: Running the Installer
Step 6: Oracle Universal Installer
Step 7: Starting the Database
Appendix A: Credits
Appendix B: References
Appendix C: System as Tested
Appendix D: De-Installing Oracle
Appendix E: Revision History
--------------------------------------------------------------------------------
Disclaimer
This document is here for informational purposes only. Because Oracle will not support running their products on FreeBSD, if you choose to do so, you will be operating outside of the scope of their Professional Services and Support team, and will get no help from them if something goes wrong. If you are only interested in using the Linux version of Oracle9i for educational or testing purposes, just be aware that things might not work exactly as planned, and you just might lose all of your data. In any event, I cannot be held responsible for anything which might occur as a result of these instructions, and cannot stress enough that until such time as Oracle releases a native FreeBSD version of their products, you should never use this as a production system!
Neither BRIAN C. LEDBETTER, nor ORACLE CORPORATION claim any inherent responsibility with regard to the accuracy of the data contained within. All installations based upon these instructions are considered unsupported by ORACLE CORPORATION, and any damages caused by following these instructions may not be attributed to the information contained within. By following these instructions, you implicitly agree that you are doing so at your own risk, and accept the risks contained in performing this procedure.
Before We Begin
In the process of poking and prodding Oracle, I have devised a somewhat straight-forward (or, as close as I could get) installation procedure for running Oracle on Intel-based FreeBSD systems. By following these steps, you will end up with a working Oracle database installation, which should be safe for you to use for any kind of development purposes. I tested my database by installing the Oracle Marvel product (now called HTMLDB) into the instance - everything worked fine. Many people on the freebsd-database mailing list have accomplished this task before I did. My goal here is simply to consolidate all of the excellent advice passed to me from the list into an easy-to-follow guide. Full credit will be listed below to those who helped me in my quest to bring the World's Best Database to the World's Best Operating System. It is also worth noting that my examples are for installing an Oracle 9i Database, not the entire Oracle9i Application Server suite. The instructions will be somewhat different for a 9iAS installation, due to the complexity of that product. I may provide instructions for installing 9iAS at a later date, if I can get 9iAS to work correctly.
Step 1: Prerequisites
Oracle9i requires certain features to be installed on your system before it will run. For instance, in order for the automated binary relinking tools to run, you must have Linux versions of ld and gcc installed. It is also a requirement that your system be running at least FreeBSD 5.0-RELEASE. It is advised that the following ports/packages are mandatory, and should be installed before continuing:
emulators/linux_base
java/linux-sun-jdk13
devel/linux_devtools-7
Step 2: Getting Oracle9i for Linux Distribution
Oracle has made the Linux version of their products available for download under the condition that the product not be used in a production environment unless it is purchased and licensed for production use. Because we can't guarantee that Oracle on FreeBSD will be stable enough for a production environment (even though I think it would work ok, there is no need to take unnecessary risks with your enterprise's data), this should not pose a problem. You may sign up for an Oracle Technology Network account to download the software at otn.oracle.com. Pull down the software you wish to install (for instance, Oracle 9i Database, or Oracle 9i Application Server) and unpack the files into a staging directory.
bsdbox# mkdir -p /u01/stage /u01/app/oracle /u02/oradata
bsdbox# cd /u01/stage
bsdbox# gzcat /path/to/lnx_920_disk1.cpio.gz | cpio -idmv
bsdbox# gzcat /path/to/lnx_920_disk2.cpio.gz | cpio -idmv
bsdbox# gzcat /path/to/lnx_920_disk3.cpio.gz | cpio -idmv
Step 3: Preparing the Installation Process
You will need to make adequate disk space available for Oracle to run on. In an ideal production environment, you would allocate space from a SAN or RAID disk array for the various Oracle-recommended directories (/u01, /u02, etc). Because we're not able to be a supported production environment, you probably don't need to worry too heavily about this - you just need to make enough disk space available for Oracle to run in. I recommend having at least 3 gigabytes of space available for Oracle Database to use, with another 2 gigabytes for data files.
Because of the plethora of differences between Linux and FreeBSD, there are a significant number of workarounds which must be performed in order for this procedure to succeed. Here is a list of what I have found necessary:
Create /compat/linux/etc/mtab
bsdbox# cat /etc/fstab | grep -v '^#' | grep -v cd9660 | \
grep -v proc | grep -v swap | grep -v devfs > \
/compat/linux/etc/mtab
bsdbox# cat /compat/linux/etc/mtab
/dev/ad0s2a / ufs rw 1 1
/dev/ad1s1 /u01 ufs rw 1 1
Symbolically link awk, sed, and chown into /compat/linux/bin
While this isn't as elegant as a patch, it's much easier for us to deal with. The patch method will still work, but I don't have the time or desire to hunt down all of the Linux-specific references in Oracle's scripts.
bsdbox# ln -s /usr/bin/awk /compat/linux/bin/awk
bsdbox# ln -s /usr/bin/sed /compat/linux/bin/sed
bsdbox# ln -s /usr/sbin/chown /compat/linux/sbin/chown
Create /compat/linux/bin/arch
bsdbox# cat > /compat/linux/bin/arch
#!/compat/linux/bin/bash
echo i686
^D
bsdbox# chmod +x /compat/linux/bin/arch
Configure SYSV Shared Memory and Semaphores
Oracle consumes quite a bit of memory whilst communicating amongst its many processes. Please refer to the Oracle Installation Guide for UNIX to determine the appropriate tuning values for your environment. You will need to build yourself a kernel with some additional parameters in order to make this work. Here is an example, which will build an Oracle-enabled GENERIC kernel. You would probably want to tune the kernel config file to suit your system's configuration. Please refer to Section 9 of the FreeBSD Handbook for details on configuring your kernel.
bsdbox# cd /usr/src/sys/i386/conf
bsdbox# cp GENERIC ORACLE
bsdbox# cat >> ORACLE
options SEMMAP=128
options SEMMNI=128
options SEMMNS=32000
options SEMOPM=250
options SEMMSL=250
options SHMMAXPGS=65536
options SHMMAX=1073741824
options SHMMNI=4096
options SHMSEG=4096
options MAXDSIZ="(1024*1024*1024)"
options MAXSSIZ="(1024*1024*1024)"
options DFLDSIZ="(1024*1024*1024)"
^D
bsdbox# config ORACLE
Kernel build directory is ../compile/ORACLE
Don't forget to do a ``make depend''
bsdbox# cd ../compile/ORACLE
bsdbox# make depend install
[build output]
bsdbox# reboot
[system reboots]
__________________________________ |
|