Install Oracle 11gR2 on Ubuntu 14.04 (amd64)

Source: Internet
Author: User

Install Oracle 11gR2 on Ubuntu 14.04 (amd64)

After a week of trouble, I finally got it. Although there are many online tutorials, most of them are just a few words. In addition, the individual installation situations vary, and many places still need to be solved by themselves.

Now record it and reserve your documents for reference by those who need it.

If you have not installed Ubuntu or feel that your Ubuntu system version is low and want to change it, set the swap partition (swap) to a greater value (at least 4 GB) during partitioning)

When Oracle is installed for a prerequisite check, the system prompts that the swap space is insufficient. Oracle requires that the swap be at least 3.69 GB.

* Prerequisites for installing oracle: ensure that jdk is installed on the machine.
By default, ubuntu linux has its own OpenJdk, which can be done by the super ox. Enter the terminal type:
$ Sudo apt-get install openjdk-7-jre
$ Sudo apt-get install openjdk-7-jdk
(Ps: I am not familiar with ubuntu. I installed jdk 1.7 _ u60 for linux on the official website. So there were two jdk servers on my host. Fortunately there was no conflict,)
After installing jdk, you can go to the terminal to check the version information:
Java-version
Start to go to the topic and install oracle:
1. Update the system: (I have not done this step. 14.04 is the latest version of ubuntu, and the system services are almost all newer versions. I have manually installed a bunch of deb packages)
Sudo apt-get update
Sudo apt-get dist-upgrade
* 2. Install the dependency package, which is an important step.
Take a look at your own software source, because in most cases you need to add the source address above, so gedit does not need cat
Sudo gedit/etc/apt/sources. list
In this way, you can open your existing source list. (Sources, not source)
In order to successfully install the 32-bit compatible package ia32-libs, you need to add these lines in the source (also some people say that the installation of g ++-multilib don't have to consider the ia32-libs, I did not try ):
Deb http://extras.ubuntu.com/ubuntu trusty main
The deb-src http://extras.ubuntu.com/ubuntu trusty main
Deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse
Update the source file and save it.

The following code uses the superscript to install the dependent package. All the following items must be installed. Otherwise, an error will be reported during the installation of the graphic interface at the end. Check them one by one. Enter the terminal type:
Sudo apt-get install bzip2
Sudo apt-get install elfutils
Sudo apt-get install automake
Sudo apt-get install autotools-dev
Sudo apt-get install binutils
Sudo apt-get install expat
Sudo apt-get install gawk
Sudo apt-get install gcc
Sudo apt-get install gcc-multilib
Sudo apt-get install g ++-multilib
Sudo apt-get install ia32-libs
Sudo apt-get install ksh
Sudo apt-get install less
Sudo apt-get install lesstif2
Sudo apt-get install lesstif2-dev
Sudo apt-get install lib32z1
Sudo apt-get install libaio1
Sudo apt-get install libaio-dev
Sudo apt-get install libc6-dev
Sudo apt-get install libc6-dev-i386
Sudo apt-get install libc6-i386
Sudo apt-get install libelf-dev
Sudo apt-get install libltdl-dev
Sudo apt-get install libmotif4
Sudo apt-get install libodbcinstq4-1 libodbcinstq4-1: i386
Sudo apt-get install libpth-dev
Sudo apt-get install libpthread-stubs0
Sudo apt-get install libpthread-stubs0-dev
Sudo apt-get install libstdc ++ 5
Sudo apt-get install lsb-cxx
Sudo apt-get install make
Sudo apt-get install openssh-server
Sudo apt-get install pdksh
Sudo apt-get install rlwrap
Sudo apt-get install rpm
Sudo apt-get install sysstat
Sudo apt-get install unixodbc
Sudo apt-get install unixodbc-dev
Sudo apt-get install unzip
Sudo apt-get install x11-utils
Sudo apt-get install zlibc

* 3. Check System Variables

/Sbin/sysctl-a | grep sem
/Sbin/sysctl-a | grep shm
/Sbin/sysctl-a | grep file-max
/Sbin/sysctl-a | grep aio-max
/Sbin/sysctl-a | grep ip_local_port_range
/Sbin/sysctl-a | grep rmem_default
/Sbin/sysctl-a | grep rmem_max
/Sbin/sysctl-a | grep wmem_default
/Sbin/sysctl-a | grep wmem_max

Then add the corresponding data in/etc/sysctl. conf according to the parameter value obtained in the preceding command (take a note after completing the preceding query)
Sudo gedit/etc/sysctl. conf

Fill in the following content in sysctl. conf with the checked value

Fs. aio-max-nr =?
Fs. file-max =?
Kernel. shmall =?
Kernel. shmmax =?
Kernel. shmmni =?
Kernel. sem =?
Net. ipv4.ip _ local_port_range =?
Net. core. rmem_default =?
Net. core. rmem_max =?
Net. core. wmem_default =?
Net. core. wmem_max =?
Run the following command to update the kernel parameters:
Sysctl-p
4. Add the following data in the/etc/security/limits. conf file to restrict the current user's kernel (XXX is your current user name)

XXX soft nproc 2047

XXX hard nproc 16384

XXX soft nofile 1024

XXX hard nofile 65536

XXX soft stacks 10240
5. Check/etc/pam. d/login and add the following lines (you don't need to add them if you have them ):
Session required pam_limits.so
Check/etc/pam. d/su. Add the following lines as needed:
Session required pam_limits.so
6. By default, oracle does not support ubuntu. You need to cheat the oracle Installation Program (you just need to follow the steps and I don't know ):
Mkdir/usr/lib64
Ln-s/etc/rc. d
Ln-s/lib/x86_64-linux-gnu/libgcc_s.so.1/lib64/
Ln-s/usr/bin/awk
Ln-s/usr/bin/basename
Ln-s/usr/bin/rpm
Ln-s/usr/lib/x86_64-linux-gnu/libc_nonshared.a/usr/lib64/
Ln-s/usr/lib/x86_64-linux-gnu/libpthread_nonshared.a/usr/lib64/
Ln-s/usr/lib/x86_64-linux-gnu/libstdc ++. so.6/lib64/
Ln-s/usr/lib/x86_64-linux-gnu/libstdc ++. so.6/usr/lib64/
Echo 'Red Hat Linux release 5'>/etc/RedHat-release
7. Configure oracle environment variables
Sudo gedit ~ /. Profile
Open the. profile file and add the following content to the file:
# Oracle
# Write the path you want to install
Export ORACLE_BASE =/home/xxx/app/xxx
Export ORACLE_HOME =$ {ORACLE_BASE}/product/11.2.0/dbhome_1
# Database sid
Export ORACLE_SID = orcl
Export ORACLE_UNQNAME = orcl
# Environment Variables
Export PATH = PATH: $ {ORACLE_HOME}/bin /;
8. Start the oracle Installation program to start Installation
Decompress my installer under the main directory oracle11g
So cd goes in: cd/home/XXX/oracle11g
To avoid garbled characters, the terminal first export LANG = US
Run the runInstaller in the directory:./runInstaller
You can go to the graphical installation interface and follow the prompts in the installation wizard.
A bunch of fails will be prompted for the prerequisite check. You don't need to worry about it. Directly pick ignore All and finish it directly.
If your swap space is insufficient, you will be prompted that the swap space is insufficient and you cannot continue.
Solution:
You can open another terminal and use the following command to temporarily upgrade the swap space, and then recheck the space:
Free-m
Mkdir/swapfile
Cd/swapfile
Sudo dd if =/dev/zero of = swap bs = 1024 count = 400000
Sudo mkswap-f swap
Sudo swapon swap
9. error during installation to 68%
Ins_ctx.mk error prompt, jump to contiue directly
An error is returned later:
Make file '/... emagent. mk' Error
Solution:
Open another terminal and enter the command line:
Sed-I's/^ \ (\ s * \ $ (MK_EMAGENT_NMECTL) \ s * $/\ 1-lnnz11/G' $ ORACLE_HOME/sysman/lib/ins_emagent.mk
Click retry on the installation page to continue.
The command line below will be prompted four times later.
Sed-I's/^ \ (\ $ LD \ $ LD_RUNTIME \) \ (\ $ LD_OPT \)/\ 1-Wl, -- no-as-needed \ 2/G' $ ORACLE_HOME/bin/genorasdksh
Sed-I's/^ \ (\ s * \) \ (\ $ (OCRLIBS_DEFAULT) \)/\ 1-Wl, -- no-as-needed \ 2/G' $ ORACLE_HOME/srvm/lib/ins_srvm.mk
Sed-I's/^ \ (TNSLSNR_LINKLINE. * \ $ (TNSLSNR_OFILES) \ (\ $ (LINKTTLIBS) \)/\ 1-Wl, -- no-as-needed \ 2/G' $ ORACLE_HOME/network/lib/env_network.mk
Sed-I's/^ \ (ORACLE_LINKLINE. * \ $ (ORACLE_LINKER) \ (\ $ (PL_FLAGS) \)/\ 1-Wl, -- no-as-needed \ 2/G' $ ORACLE_HOME/rdbms/lib/env_rdbms.mk
10. After the installation is complete, two sh files need to be run:
Open another terminal:
Sudo/home/xxx/app/xxx/oracle/oraInventory/orainstRoot. sh
Sudo/home/xxx/app/xxx/oracle/Oracle11gee/product/11.2.0/dbhome_1/root. sh
Installation complete!
11. Test oracle environment variables before running sqlplus
Echo $ ORACLE_BASE
Echo $ ORACLE_HOME
Echo $ PATH
Check whether the value you configured is correct. continue to the next step.
12. Test the monitoring status before running the database.
If the listener is not enabled, use lsnrctl start to enable it.
Lsnrctl status
Normally, the listener information is displayed.
If no output is provided here, it indicates that no listening is available and you need to configure it yourself.
Solution:
You can run netca to create a listener and call up the GUI to set the listener.
If no database is created, you can create a database in dbca.
By the way, run the following code to fix dbconsole
Emca-repos drop
Emca-repos create
Emca-config dbcontrol db
Emca start dbconsole
This database should be ready to run.
Start oracle Database
Sqlpus/nolog
Conn/as sysdba
Startup
The created orcl instance is loaded normally.
13. sqldeveloper cannot connect to oracle
Solution: run the netmgr command.
Open Oracle Net Configuration-> Local-> Listeners-> LISTENER-> Add Address to Add an Address,
Protocal: TCP/IP Host: IP address of oracle Port: 1521
However, the following exception may be reported during connection:
ORA-12505, TNS: listener does not currently know of SID given in connect desc.
Could not recognize the database SID
Enter the/home/xxx/app/xxx/product/10.2.0/db_1/network/admin directory.
Cd/home/xxx/app/xxx/product/10.2.0/db_1/network/admin, modify the following listener. ora:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(ORACLE_HOME =/home/xxx/app/xxx/product/11.2.0/dbhome_1)
(PROGRAM = extproc)
)
As long as the Blue section is added here
(SID_DESC =
(GLOBAL_DBNAME = ORCL)
(ORACLE_HOME =/home/xxx/app/xxx/product/11.2.0/dbhome_1)
(SID_NAME = ORCL)
)
)

Now all are finished!

Supplement: Chinese garbled characters in sqldeveloper

Root Cause: there is no Chinese font under the jre in linux.
Solution: find one in the windows fonts and use it
Console code: cd $ JAVA_HOME/jre/lib/fonts $
Sudo mkdir fallback
Cd fallback
Cp/home/user/msyh. ttf./Note
Sudo mkfontdir
Sudo mkfontscale
Restart sqldeveloper.

Related Article

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.