Install the oracle9i under Linux

Source: Internet
Author: User
Tags exit dba log connect prepare range sqlplus linux
Oracle
There are several places to note before installation:
Your swap partition is best to have a G or so big, the second your hard disk partition best also have large enough space.

The following my translation of the Chinese version:

1. Create users and Groups:
[Roko@miniroko] Su-

[root@miniroko]# Groupadd Oinstall
[root@miniroko]# Groupadd DBA
[root@miniroko]# useradd-g oinstall-g dba Oracle
[root@miniroko]# passwd Oracle


2, prepare the file directory:

[root@miniroko]# mkdir-p/opt/ora9/product/9.2
[root@miniroko]# mkdir/var/opt/oracle
[root@miniroko]# chown Oracle.dba/var/opt/oracle
[root@miniroko]# chown-r Oracle.dba/opt/ora9

3, adjust the system kernel parameters and installation support package:
3.1, first use the command Rpm-qa|grep compat to see if the system has the following packages:

compat-gcc-7.3-2.96.118.i386.rpm
compat-libgcj-7.3-2.96.118.i386.rpm
compat-libgcj-devel-7.3-2.96.118.i386.rpm
nss_db-compat-2.2-20.i386.rpm

If not, please take out your installation disk and install the above package. Do not use the original to the apt Dongdong, not familiar with the problem of the lack of resolution of the dependency, it is particularly annoying.

3.2, set the kernel parameters, adjust the semaphore and shared memory:
[root@miniroko]# echo 32000 128 >/proc/sys/kernel/sem
[root@miniroko]# echo 536870912 >/proc/sys/kernel/shmmax
[root@miniroko]# echo 4096 >/proc/sys/kernel/shmmni
[root@miniroko]# echo 2097152 >/proc/sys/kernel/shmall
[root@miniroko]# echo 65536 >/proc/sys/fs/file-max
[root@miniroko]# echo 1024 65000 >/proc/sys/net/ipv4/ip_local_port_range

Of course, for a boot system can automatically help you set these parameters, you can also change/etc/sysctl.conf this file, add the following statement:
Kernel.shmmax = 536870912
Kernel.shmmni = 4096
Kernel.shmall = 2097152
Kernel.sem = 250 32000 100 128
Fs.file-max = 65536
Net.ipv4.ip_local_port_range = 1024 65000

After saving, you can. Suggestions about Net.ipv4.ip_local_port_range do not change, you can use Cat/proc/sys/net/ipv4/ip_local_port_range to see the red cap on this defined range has been met, and the port range is smaller than this.

3.3, set Oracle to file requirements:
Edit file:/etc/security/limits.conf Add the following statement:
Oracle Soft Nofile 65536
Oracle Hard Nofile 65536
Oracle Soft Nproc 16384
Oracle Hard Nproc 16384

This needs to be restarted before it takes effect. But it doesn't matter when it's installed.

4. Set Oracle's system environment:
Log on as an Oracle User:
Su Oracle

CD ~

Edit its. bashrc file to add to the Dongdong:
#oracle 9i
Export ORACLE_BASE=/OPT/ORA9
Export oracle_home=/opt/ora9/product/9.2
Export path= $ORACLE _home/bin: $ORACLE _home/apache/apache/bin: $PATH
Export Oracle_owner=oracle
Export oracle_sid=ora9i
Export oracle_term=vt100
Export ld_assume_kernel=2.4.1
Export Threads_flag=native
Export Ld_library_path=/opt/ora9/product/9.2/lib: $LD _library_path
Export Path=/opt/ora9/product/9.2/bin: $PATH
#
# change this NLS settings to suit your country:
# example:
# GERMAN_GERMANY.WE8ISO8859P15, AMERICAN_AMERICA.WE8ISO8859P2 etc.
#
#export nls_lang= ' croatian_croatia.ee8iso8859p2 ' (note that this stuff is commented out because we use the Chinese system.) However, in order to be able to display Chinese, add the following line:
Export Lc=en_us

Exit and prepare the three ISO files you downloaded.
5, unzip the file you downloaded:
5.1. Create a new directory: Mkdir/mnt/oracle
5.2, copy three files into the new directory: CP ln_*/mnt/oracle
5.3, extract three files: cd/mnt/oracle
Gunzip Gunzip lnx_920_disk1.cpio.gz
Gunzip lnx_920_disk2.cpio.gz
Gunzip lnx_920_disk3.cpio.gz
CPIO-IDMV < Lnx_920_disk1.cpio
CPIO-IDMV < Lnx_920_disk2.cpio
CPIO-IDMV < Lnx_920_disk3.cpio
5.4, this will generate three folders: DISK1, DISK2, DISK3
6. Start Installation:
Enter as a user of Oracle:
Su Oracle
CD ~
/mnt/oracle/dsik1/runinstall.sh

Several errors are encountered during installation:
The first error hint about this file ins_oemagent.mk, do not care about it, choose to ignore, we will fix it in the following steps.
Second error Note: Error in invoking target install of makefile $ORACLE _home/ctx/lib/ins_ctx.mk
This time you should not choose to ignore, this time you have to open a terminal: As an Oracle user login in, run the following command:
[Oracle@miniroko oracle]$ CD $ORACLE _home/install
[Oracle@miniroko install]$ Tail Make.log

You can see this, and then there's an error message under it:
Gcc-o ctxhx-l/opt/ora9/product/9.2/ctx/lib/-l/opt/ora9/product/9.2/lib/
-l/opt/ora9/product/9.2/lib/stubs//OPT/ORA9/PRODUCT/9.2/CTX/LIB/CTXHX.O
-l/opt/ora9/product/9.2/ctx/lib/-lm-lsc_ca-lsc_fa-lsc_ex-lsc_da-lsc_ut
-lsc_ch-lsc_fi-lctxhx-lc-wl,-rpath,/opt/ora9/product/9.2/ctx/lib-lnls9
-lcore9-lnls9-lcore9-lnls9-lxml9-lcore9-lunls9-lnls9
We run the following command to modify it:
[oracle@miniroko]$ CD $ORACLE _home/bin
[Oracle@miniroko bin]$ Gcc-o ctxhx-l/opt/ora9/product/9.2/ctx/lib/
-l/opt/ora9/product/9.2/lib/-l/opt/ora9/product/9.2/lib/stubs/
/opt/ora9/product/9.2/ctx/lib/ctxhx.o-l/opt/ora9/product/9.2/ctx/lib/
-lm-lsc_ca-lsc_fa-lsc_ex-lsc_da-lsc_ut-lsc_ch-lsc_fi-lctxhx-lc
-wl,-rpath,/opt/ora9/product/9.2/ctx/lib-lnls9-lcore9-lnls9-lcore9
-lnls9-lxml9-lcore9-lunls9-lnls9-ldl
It's time to get back to the place where it went wrong. Then go back to the installation interface and choose Ignore for the error dialog. Continue to install the line.

The third error occurs when you start and configure the helper program, leave it alone, and choose to ignore it. We will fix the first error and the third error in the following steps.

7, modify the system:
Log in as an Oracle user, and execute the following command:
[Oracle@miniroko oracle]$ CD $ORACLE _home/network/lib
[Oracle@miniroko lib]$ make-f ins_net_client.mk Install

Then edit this file:
Oracle@miniroko Lib] $vi $ORACLE _home/ctx/lib/ins_ctx.mk found line 13th, line 14th by Ctxhx: $ (ctxhxobj)
$ (LINK) $ (ctxhxobj) $ (inso_link)

To
CTXHX: $ (ctxhxobj)
$ (LINK)-LDL $ (ctxhxobj) $ (inso_link)
Save to exit and execute the following command:
[Oracle@miniroko lib]$ make-f $ORACLE _home/ctx/lib/ins_ctx.mk Install

You can now restart the agents.
[Oracle@miniroko lib]$/opt/ora9/product/9.2/bin/agentctl start

8, in order to facilitate management, you can write a startup script:
Enter as root and write the following script:
#!/bin/bash
#
# (c) denis.klaric@in2.hr
#
# Name:/etc/rc.d/init.d/ora9
# Description:starts and stops Oracle 9i database, TNS Listener
# HTTP server, and fixes kernel parameters for Oracle


#oracle Environment
Export oracle_home=/opt/ora9/product/9.2
Export path= $ORACLE _home/bin: $ORACLE _home/apache/apache/bin: $PATH
Export nls_lang= ' CROATIAN_CROATIA.EE8ISO8859P2 '
Export Oracle_sid=tis

Export display=:0
Oracle_user=oracle

# How we ' re called

Case is in
Start
# Fix Kernel parameters
echo 32000 128 >/proc/sys/kernel/sem
echo 536870912 >/proc/sys/kernel/shmmax
echo 4096 >/proc/sys/kernel/shmmni
echo 2097152 >/proc/sys/kernel/shmall
echo 65536 >/proc/sys/kernel/fs/file-max
echo 1024 65000 >/proc/sys/net/ipv4/ip_local_port_range

# Start Listener, Apache and database
Su-"$oracle _user" <<eoo
Lsnrctl start
Apachectl start
Sqlplus/nolog<<eos
Connect/as SYSDBA
Startup
Eos
Eoo
;;

Stop
# Stop Listener, Apache and database
Su-"$oracle _user" <<eoo
Lsnrctl stop
Apachectl stop
Sqlplus/nolog<<eos
Connect/as SYSDBA
Shutdown immediate
Eos
Eoo
;;

*)
echo "Usage:ora9 [Start|stop]"
;;

Esac

After saving as ora9 and then using chmod a+x ora9, you can then run the/etc/rc.d/init.d/ora9 start |stop as ROOT to manage Oracle's startup and stop. If you want to add this script to the system so that it can be powered on, run the following command:
Chkconfig--level 3 (or 5)--add ora9
Can.




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.