Full Process (perfect) and solution for installing Oracle 10g on Ubuntu 12.04

Source: Internet
Author: User
Tags addgroup

Full Process (perfect) and solution for installing Oracle 10g on Ubuntu 12.04

PS: Ubuntu 12.04 installs Oracle 10g throughout the entire process (perfect) and the solution to the problem under normal circumstances, perfect .. If you have any problems, you can also solve them.

1. Preparations before installation

1.1 download the appropriate oracle software package from the oracle official website;

My example is: 10201_database_linux32.zip in Oracle Database 10 gRelease 2 (10.2.0.1.0) Enterprise/Standard Edition for Linux x86.

Address: http://www.oracle.com/technetwork/database/10201linuxsoft-097986.html

1.2 update ubuntu

# Apt-get update

# Apt-get upgrade

1.3 install additional javaJDK

You can search for OPENjdk in [Ubuntu Software Center]. After OpenJDK is installed, the path is automatically set.

1.4 install the missing package and downgrade the GCC version

Apt-get install gcc make binutils lesstif2 libc6 libc6-dev rpm libmotif3 libaio1 alien

Apt-get install ksh libtool libstdc ++ 5 build-essential compat-libstdc ++


Uninstall gcc-4.6, install gcc-4.4 version

Apt-get remove gcc-4.6

Apt-get install gcc-4.4


1.5 create an oracle user

Log on to the root user and perform the following operations:


1.5.1 modify shell

Ls-l/bin/sh. If it is dash, change it to bash.

Rm/bin/sh

Ln-s/bin/bash/bin/sh


1.5.2 create users and groups and the oracle installation path

Addgroup oinstall

Addgroup dba

Addgroup nobody

Usermod-g nobody


Adduser oracle

Usermod-g oinstall-G dba oracle

Id oracle

Id nobody


Mkdir-p/opt/oracle

Mkdir-p/opt/oradata

Chown-R oracle: dba/opt/ora *

Chmod-R 775/opt/ora *


1.5.3 create a spoofing version statement

Vi/etc/RedHat-release

Then add Red Hat Linux release 3.1


1.5.4 create a link

Ln-s/usr/bin/gcc-4.4/usr/bin/gcc

Ln-s/lib/i386-linux-gnu/libgcc_s.so.1/lib/libgcc. s. so.1


Ln-s/usr/bin/awk

Ln-s/usr/bin/rpm

Ln-s/usr/bin/basename


Mkdir/etc/rc. d

Ln-s/etc/rc0.d/etc/rc. d/rc0.d

Ln-s/etc/rc1.d/etc/rc. d/rc1.d

Ln-s/etc/rc2.d/etc/rc. d/rc2.d

Ln-s/etc/rc3.d/etc/rc. d/rc3.d

Ln-s/etc/rc4.d/etc/rc. d/rc4.d

Ln-s/etc/rc5.d/etc/rc. d/rc5.d

Ln-s/etc/rc6.d/etc/rc. d/rc6.d

Ln-s/etc/init. d/etc/rc. d/init. d


1.5.5 Add a user to the sudoer list

Vi/etc/sudoers

In the next line of "root ALL = (ALL: ALL) ALL", add:

Oracle ALL = (ALL: ALL) ALL


1.5.6 modify Kernel Parameters and System Variables

A. Modify the/etc/sysctl. conf file (you do not need to modify it)

Gedit/etc/sysctl. conf

Add the following content:

Kernel. shmall = 2097152

Kernel. shmmax = 2147483648

Kernel. shmmni = 4096

Kernel. sem = 25 32000 100 128

Fs. file-max = 65536

Net. ipv4.ip _ local_port_range = 1024 65000

B. Modify/etc/security/limits. conf (you do not need to modify it)

Gedit/etc/security/limits. conf

Add the following content:

* Soft nproc 2407

* Hard nproc 16384

* Soft nofile 1024

* Hard nofile 65536

Note: Do not forget "*". You can change it to oracle.


C. Modify the environment variables of oracle users in ubuntu

Modify the/home/oracle/. profile and/etc/profile files

Vi/home/oracle/. profile

Vi/etc/profile

Add the following content:

# Oracle_path start

Export ORACLE_HOME =/opt/oracle

Export ORACLE_SID = orcl

Export ORACLE_OWNER = oracle

Export PATH = $ PATH: $ ORACLE_HOME/bin

# Oracle_path end


1.5.7 make the parameter take effect

Restart the system or terminal and run the command sysctl-p.

1.5.8 download the downloaded oracle Installation File to/home/oracle and decompress it. Log out of the root user and log on to the oracle user


2. Start oracle Installation

2.1 Open the terminal, cd it to the oracle decompression file of/home/oracle/database, and execute the following command

./RunInstaller-jreLoc/usr/lib/jvm/java-6-openjdk-i386/jre.

Java-version is the installation version of java, which is used to prevent garbled characters or boxes in Image-based oracle.

Then, install the same image-based installation interface in windows.


If not, use the installation interface in English.

Export LANG = ENGLISTH

./RunInstaller


2.2 follow the steps below for image operations

Http://www.cnblogs.com/luochengor/archive/2011/08/20/2147041.html

2.3 When the configuration script is executed

Switch to root and execute the script on the terminal.

/Home/oracle/oralnventory/orainstRoot. sh

/Opt/ora10/root. sh

2.4 When oracle database 10g installation is complete, write down two URLs.


2.5 install a database

Run the following command on the terminal:

$ Dbca // If Chinese characters are garbled, run the following command:

$ Cd/opt/ora10/bin

$ Gedit dbca

Find "JRE_DIR =/opt/ora10/jdk/jre" in dbca, replace with JRE_DIR =/usr/lib/jvm/java-1.6.0-openjdk/jre, save and exit

$ Dbca // displayed normally

2.6 perform the following steps:

Http://www.cnblogs.com/luochengor/archive/2011/08/20/2147041.html

However, you must write the Database Name and SID in orcl.

Until the installation is complete.

3. Start oracle


Run as oracle on the terminal


Start the TNS Listener: $ ORACLE_HOME/bin/lsnrctl start

($ ORACLE_HOME is the installation directory of oracle:/opt/ora10. Run cd to go to the installation directory of oracle, go to the bin folder, and run $ lsnrctl start ).


Disable TNS: $ ORACLE_HOME/bin/lsnrctl stop

Start sqlplus: $ ORACLE_HOME/bin/sqlplus/nolog


Disable sqlplus: SQL> exit


4. To be able to use the up/down key flip command like in windows, you also need to install the rlwrap package:


Sudo apt-get install rlwrap


Then modify the oracle user's ~ The/. bashrc file and the/etc/profile file are added to the last two lines:

In this way, the upper and lower left keys can be used.


Finally, we solve the oracle Chinese Character Set Problem. When oracle is started, all Chinese characters are "?". Or garbled characters. This is actually caused by inconsistent server-side character sets and client-side character sets.

Solution: Access sqlplus as a DBA for query

SQL> select userenv ('language') from dual;

Copy the query result and add an export NLS_LANG = "query result" in the/etc/bash. bashrc file to solve the problem. For example, if my query result is SIMPLIFIED CHINESE_CHINA.AL32UTF8, add a new row as export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.AL32UTF8 ".

But sometimes this method does not work, you can

Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.AL32UTF8"

Export NLS_LANG = "SIMPLIFIED CHINESE_CHINA.ZHS16GBK"

Try writing them to two files respectively, but the two files must be written in the same way.


5. If any problem occurs, follow these steps:

5.1

Problem: An error occurred while calling the 'install' target of makefile '../sqlplus/lib/ins_sqlplus.mk. See '/home/oracle/oraInventory/logs/installActions2011-12-06_11-03-18AM.log' for details.


Solution: $ ORACLE_HOME/sqlplus/lib/env_sqlplus.mk Add a row: EXPDLIBS =-lclntsh, and then click "retry". OK.

In fact, the installation of gcc-4.4 after this problem.


5.2

Problem: An error occurred while calling the target 'agent nmo nmb' of makefile '../sysman/lib/ins_sysman.mk. See '../oraInventory/logs/installActions2011-12-06_11-03-18AM.log' for details.

Analysis: the subsequent errors are essentially a problem, mainly because the gcc version is higher and the oracle10g gcc version is about 3.4, however, ubuntu 4.0 and later versions have been used for development, and you cannot install a lower version of apt.

Work und: uninstall the gcc-4.6 and install the gcc-4.4 version

Apt-get remove gcc-4.6

Apt-get install gcc-4.4


5.3

An error occurred while calling makefile '../network/lib/ins_net_server.mk''s target 'install. See '../oraInventory/logs/installActions2011-12-06_11-03-18AM.log' for details.

Analysis: I found a similar document on the Internet. For more information, see (click to open the link). However, I still have problems with manual compilation, in addition, oracle10g is not the-lons parameter problem he mentioned.

Or the gcc version problem. I tried to install gcc of lower versions, but an error was reported at the beginning of the compilation, so I gave up. If someone can successfully downgrade the version environment, I believe that all errors will be solved, which is also an explanation of why ubuntu 8 can be installed successfully.

Method: currently, I have no method. According to the description in its. mk file, this item seems to be used for re-linking when the database link is broken.

Work und: uninstall the gcc-4.6 and install the gcc-4.4 version

The soft link of/usr/bin/gcc-4.4 is made under/usr/bin.

Cd/usr/bin

Ln-s/usr/bin/gcc-4.4/usr/bin/gcc


5.4

An error occurred while calling makefile '../rdbms/lib/ins_rdbms.mk''s target 'all _ no_orcl ihsoddb. See '../oraInventory/logs/installActions2011-12-06_11-07-36-AM.log' for details.

Analysis: Let's take a look at the log file

Information: Generating base orasdk library...

Information: Creating/opt/ora10/lib/liborasdkbase. so.10.2

Message: gcc: Error:/lib/libgcc_s.so.1: the file or directory does not exist.

Gcc: Error:/usr/lib/libstdc ++. so.5: the file or directory does not exist.

We can see that there are many errors at last, but it is still a gcc problem. We re-downloaded libgcc_s.so.1 and re-established the stdc ++ 5 link, but there are still more problems, because it is impossible to solve all the problems by only using soft links and downloading a dynamic library.

Solution: Install compat-libstdc ++-33_3.2.3-48.3_i386.deb and try again ..

Soft link in libgcc_s.so.1

Cd/lib

Ln-s/lib/i386-linux-gnu/libgcc_s.so.1 libgcc. s. so.1


6. boot


6.1 modify the following content as root: vi/etc/oratab

Orc1:/opt/oracle/product/10.2.0/db_1: Y

Set N to Y


6.2 modify the following in oracle:

Cd $ ORACLE_HOME/bin

Vi dbstart

Locate ORACLE_HOME_LISTNER and modify it:

ORACLE_HOME_LISTNER =/opt/oracle/product/10.2.0/db_1

Or directly modify it:

ORACLE_HOME_LISTNER = $ ORACLE_HOME


Test and run dbshut. Check whether dbstart can start the oracle service and listener service.

Ps-efw | grep ora _

Lsnrctl status

Ps-efw | grep LISTEN | grep-v grep


6.3 create a file under root:

Vi/etc/rc. d/init. d/oracle10


#! /Bin/bash

# Chkconfig: 345 99 10

# Description: Startup Script for Oracle Databases

#/Etc/init. d/oracle10

Export ORACLE_SID = ym

# Export ORACLE_HOME_LISTNER =/data/files/oracle/10g/bin

# Oracle Installation Directory

Export ORACLE_HOME =/data/files/oracle/10g

Export PATH = $ PATH: $ ORACLE_HOME/bin

Case "$1" in

Start)

Su oracle-c $ ORACLE_HOME/bin/dbstart # Start the service

Su oracle-c $ ORACLE_HOME/bin/lsnrctl start # start the listener

Touch/var/lock/oracle

Echo "OK"

;;

Stop)

Echo-n "Shutdown Oracle :"

Su oracle-c $ ORACLE_HOME/bin/dbshut # enable and disable the service

Su oracle-c $ ORACLE_HOME/bin/lsnrctl stop # disable listening

Rm-f/var/lock/oracle

Echo "OK"

;;

*)

Echo "Usage: 'basename $ 0' start | stop"

Exit 1

Esac

Exit 0


Then

Chmod 775 oracle10

Chkconfig -- add oracle10

Chkconfig -- list oracle10

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.