Ubuntu14.04LTS64-bit installation of Oracle11g and oracle11g
Oracle does not officially state that it supports ubuntu installation. Therefore, the environment must be adjusted and prepared before installation can be successful. Ps, I tried multiple times but 12c was not installed successfully, so 11g was installed.
Environment preparation
- Ubuntu14.04 desktop 64-bit
My desktop is gnome, Chinese version.
- Jdk preparation (My jdk is 1.7.60)
- Configure system environment variables:
(This command is used to ensure that some scripts are executed normally during installation and are executed by users with sudo permissions)
$ Sudo ln-s/usr/bin/awk $ sudo ln-s/usr/bin/rpm $ sudo ln-s/usr/bin/ basename/bin/basename # directly link to this directory, it is not recommended to use reference article 1 to link multiple files $ sudo ln-s/usr/lib/x86_64-linux-gnu/usr/lib64 $ cd/lib64 $ sudo ln-s/lib /x86_64-linux-gnu/libgcc_s.so.1.
- Install necessary packages
Refer to the installation packages listed in Articles 1 and 2 below. You can skip this step and install the installation package as needed.
- Create an oracle user group and installation directory
I still use reference article 2 to install oracle using an independent oracle user.
$ Sudo groupadd oinstall $ sudo groupadd dba $ sudo mkdir-p/opt/oracle # change the directory to the actual directory of your machine $ sudo useradd-g oinstall-G dba-s/bin/ bash oracle $ sudo passwd oracle $ sudo chown-R oracle: oinstall/opt/oracle
- Set System Parameters
For more information, see the following article 1. Configure sysctl and limit.
- Set User Environment Variables
According to oracle, it is not recommended to configure. profile or. bashrc before installation. You can configure. profile or. bashrc after the installation is successful to enable oracle.We recommend that you only configure the following variables:
$ Su-oracle $ vi. profile # Oracle SettingsTMP =/tmp; export TMPTMPDIR = $ TMP; export TMPDIR # takes effect directly $ source. profile
Download oracle11gR2
Download the oracle64-bit version of oracle11g from oracle
There are two compressed packages:
- Linux.x64_11gR2_database_1of2.zip
- Linux.x64_11gr2_databasesilicate f2.zip
Decompress the package to a directory such as/data/downloads/database and grant the permission.
$cd /data/downloads/database/install$chmod +x *.sh .oui unzip$sudo chown -R oracle:oinstall /data/downloads/database
Install
In reference article 1, I specified the jre method (the installer is a java-written interface). Otherwise, the installation interface is garbled and can be called up in English even if the export LANG = C is used, but the interface is still unfriendly.There are two ways to open the installation interface, one is to directly switch to the oracle user and log on to the desktop, the other is not to switch the current interface, execute the following command:
$xhost +$su - oracle$export DISPLAY=:0
Then run the following command to open the installation interface and start installation.
$ Cd/data/downloads/database $ chmodx + x runInstaller # change to the jre path of your system $. /runInstaller-jreloc/usr/lib/jvm/java-7-oracle/jre/
Next, we can proceed. We recommend that you use the default installation options and change the installation directory to the directory on your machine.
Handle errors during installation
The installation process will not be smooth sailing, and errors will usually pop up. In my experience, there is an error in the installation process. Don't worry, or click confirm to cancel or skip (Do not close the pop-up box), Carefully check the error prompt, find the specific error according to the corresponding log file prompted, and then handle it.
The errors I encountered have been solved in Reference 2. We recommend that you refer to article 2 for errors.Below is a simple list.
- Question 1:Memcpy@GLIBC_2.14 not found (libstdc ++ 5)
The solution is to download the new libstdc ++ 5 Library.
Download from here, open the extract directly, and extract to overwrite the old file under/usr/lib/x86_64-linux-gnu (using an account with sudo permissions ).
Article 2 also introduces a download link. Download the 64-bit version below. Switch to the account with sudo permission to execute the installation:
$sudo dpkg -i libstdc++5_3.3.6-27.2ubuntu1_amd64.deb
- Question 2:If you encounter an error when running 'link binaries '(some makefiles)
The solution is to open a console and execute the following script. You can view the error pairs in. mk file to execute the corresponding script, and then try again. You can also execute it together when an error occurs for the first time, and then try again.
$export ORACLE_HOME=/opt/oracle/product/11.2.0/dbhome_1$sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.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$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
- For other errors, see article 2. After processing, you can complete the installation.
Installation Complete
After the installation is complete, you have to execute two scripts (or a script, which will be prompted at the end of the installation Interface), as long as sudo is taken out for execution.
# Run 1st scripts. If there is a prompt on the installation interface, run sudo. # Run 2nd scripts, follow the path $ sudo/opt/oracle/product/11.2.0/dbhome_1/root provided on the installation page. sh
- Finally, the installer will execute a listener (1521), create a sample library, and start em. Please be patient. The interface may be garbled and you don't have to worry about it, click the bottom button at the end of the page.
Improve user environment variables
Complete the configuration of oracle environment variables and run the following command in the oracle main directory:
$ Vi. profileexport ORACLE_HOSTNAME = localhost; export ORACLE_BASE =/opt/oracle; export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_SID = orcl; export PATH = $ PATH: $ ORACLE_HOME/binexport LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ ORACLE_HOME/libexport NLS_LANG = "Simplified chinese_china.al32utf8" # The configuration takes effect directly. $ source. profile
Start oracle
After the installation is complete, oracle Data is enabled successfully. However, after the server is restarted, the database is not automatically restarted and loaded (which can be configured by the reader). The following describes manual operations.
# Log on to the oracle user $ su-oracle # start # You can use netstat-lntp to check whether the 1521 product is enabled $ lsnrctl start # stop $ lsnrctl stop # You can also use $ dbstart $ ORACLE_HOME $ dbshut $ ORACLE_HOME # use the following command to configure the listener, note that you must enter the host name in the graphic interface $ export LANG = C # hostname. Do not use an IP address, or use an IP address to change the port $ netmgr
$ Sqlplus/as sysdba # start SQL> startup; # Stop SQL> shutdown immediate;
Start/Close em
EM can be used to manage database servers on the web, which is easy to use and can be enabled as needed.
# The premise is that ORACLE_HOSTNAME must be set correctly (a prompt is also displayed in the Command) $ emctl stop dbconsole
Access address:
Https: // localhost: 1158/em
References
Reference Article 1
Reference Article 2