How to install Oracle 11gR2 in Ubuntu 16.04
Overview
Ubuntu: ubuntu-16.04.3-desktop-amd64
Oracle: linux. x64_11gR2_database
------------------------------------------ Split line ------------------------------------------
Related File Download instructions
Click this link to follow the official website of the customer's home. After the link is followed, the number 149797 is returned. You can get the sharing password of a netizen.
If you cancel paying attention to the Public Account of the customer's house, you will not be able to provide this service even if you pay attention to it again!
Link: https://pan.baidu.com/s/1jIy5SZ8 password: Get to see the above method, the address is invalid, please leave a message below.
------------------------------------------ Split line ------------------------------------------
This installation tutorial is only a simple version, and does not set user groups such as oinstall, dba, and grid. The installation is also basically the default setting, and no manual database creation is required, it is also installed on a virtual machine. If it is only developed and used by yourself, no problem. After I have installed it, the hard disk occupies 24.2 GB. When installing it, pay attention to the size of the virtual machine's hard disk.
1. Modify the root account password
Sudo passwd
Ii. Install JDK
Sudo apt-get update
Sudo apt-get install openjdk-8-jdk
Install an Editor (this is not required)
Sudo apt-get install vim
Edit profile
Cd/etc
Sudo vim profile
Add the following content to the file:
Export JAVA_HOME =/usr/lib/jvm/java-8-openjdk-amd64
Export JRE_HOME =$ {JAVA_HOME}/jre
Export CLASSPATH =. :$ {JAVA_HOME}/lib :$ {JRE_HOME}/lib
Export PATH =$ {JAVA_HOME}/bin: $ PATH
Press "Esc" input ": wq" to save and exit
Test whether jdk is successfully installed.
Java-version
Iii. Install Dependencies
Sudo apt-get-y install lesstif2
Sudo apt-get-y install lesstif2-dev
(These two packages are 32-bit and need to be installed on the source:
Su
Cd/etc/apt/sources. list. d
Echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse"> ia32-libs-raring.list
Apt update
Apt-get-y install lesstif2 lesstif2-dev
)
Change the source
Rm-rf ia32-libs-raring.list
Apt update
Exit root Account
Exit
Continue to install the remaining dependencies
Sudo apt-get-y install automake autotools-dev binutils bzip2 elfutils expat gawk gcc-multilib g ++-multilib unzip lib32z1 ksh less lib32z1 libaio1 libaio-dev libc6-dev libc6-dev-i386 libelf-dev libltdl-dev libxm4 libodbcinstq4-1 libodbcinstq4-1: i386 libpth-dev libpthread-stubs0-dev libstdc ++ 5 make openssh-server rlwrap rpm sysstat unixodbc-dev unzip x11-utils zlibc
It takes some time to install the tool (this is a history of vomiting blood. It was originally installed one by one and you have to check the installation results. I have processed these dependencies into a single statement. These packages are okay for test)
Iv. Configure the environment
Use the following command to query system parameters
/Sbin/sysctl-a | grep sem
/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
/Sbin/sysctl-a | grep shmall
/Sbin/sysctl-a | grep shmmax
/Sbin/sysctl-a | grep shmmni
Enter the queried parameters in the following fields.
Fs. aio-max-nr = 65536
Fs. file-max = 242293
Kernel. shmall = 18446744073692774399
Kernel. shmmax = 18446744073692774399
Kernel. shmmni = 4096
Kernel. sem = 32000 1024000000 500 32000
Net. ipv4.ip _ local_port_range = 32768 60999
Net. core. rmem_default = 212992
Net. core. rmem_max = 212992
Net. core. wmem_default = 212992
Net. core. wmem_max = 212992
If the version is the same as mine, you can directly copy the above content.
Modify the sysctl. conf file
Sudo vim sysctl. conf
Add the above content to the end of sysctl. conf.
Update Kernel Parameters
Sysctl-p
Add the user's kernel limit (my username is rogear)
Cd security/
Sudo vim limits. conf
Add the following content to the end of the file
Rogear soft nproc 2047
Rogear hard nproc 16384
Rogear soft nofile 1024
Rogear hard nofile 65536
Rogear soft stack 10240
Create a folder
Mkdir/home/rogear/tools
Mkdir/home/rogear/tools/oracle11g
Configure oracle environment variables
Sudo vim/etc/profile
Add the following content to the end of the file
Export ORACLE_BASE =/home/rogear/tools/oracle11g
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export ORACLE_SID = orcl
Export ORACLE_UNQNAME = orcl
Export NLS_LANG =. AL32UTF8
Export PATH =$ {PATH }:$ {ORACLE_HOME}/bin/: $ ORACLE_HOME/lib64
Update Parameters
Source/etc/profile
Spoofing oracle installation settings
Sudo mkdir/usr/lib64
Sudo ln-s/etc/rc. d
Sudo ln-s/lib/x86_64-linux-gnu/libgcc_s.so.1/lib64/
Sudo ln-s/usr/bin/awk
Sudo ln-s/usr/bin/basename
Sudo ln-s/usr/bin/rpm
Sudo ln-s/usr/lib/x86_64-linux-gnu/libc_nonshared.a/usr/lib64/
Sudo ln-s/usr/lib/x86_64-linux-gnu/libpthread_nonshared.a/usr/lib64/
Sudo ln-s/usr/lib/x86_64-linux-gnu/libstdc ++. so.6/lib64/
Sudo ln-s/usr/lib/x86_64-linux-gnu/libstdc ++. so.6/usr/lib64/
Switch root Account
Su
Echo 'Red Hat Linux release 5'>/etc/RedHat-release
Exit
5. Formal Installation
The prerequisites are ready, and then oracle installation is officially started. Download the oracle installation package to the oracle11g folder. The package is from the official website and is not provided here.
Decompress the package
Unzip linux.x64_11gR2_database_1of2.zip
Unzip linux.x64_11gr2_database5of2.zip
Cd database/
./RunInstaller
As mentioned above, the password does not comply with the specifications.
There is something to run in this place. Open a new teminal and find it.
New teminal (ctrl + alt + t)
Cd/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/sysman/lib/
Install gedit (this is not required)
Sudo apt install gedit
Gedit ins_emagent.mk
Use the query function (ctrl + f) to find the following ($ (SYSMANBIN) emd) and change it.
Save and exit gedit
Open teminal and enter the following four commands:
Sudo sed-I's/^ \ (TNSLSNR_LINKLINE. * \ $ (TNSLSNR_OFILES) \ (\ $ (LINKTTLIBS) \)/\ 1-Wl, -- no-as-needed \ 2/G'/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/network/lib/env_network.mk
Sudo sed-I's/^ \ (ORACLE_LINKLINE. * \ $ (ORACLE_LINKER) \ (\ $ (PL_FLAGS) \)/\ 1-Wl, -- no-as-needed \ 2/G'/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/rdbms/lib/env_rdbms.mk
Sudo sed-I's/^ \ (\ $ LD \ $ LD_RUNTIME \) \ (\ $ LD_OPT \)/\ 1-Wl, -- no-as-needed \ 2/G'/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/bin/genorasdksh
Sudo sed-I's/^ \ (\ s * \) \ (\ $ (OCRLIBS_DEFAULT) \)/\ 1-Wl, -- no-as-needed \ 2/G'/home/rogear/tools/oracle11g/product/11.2.0/dbhome_1/srvm/lib/ins_srvm.mk
Now oracle is installed, and you can test it.
Vi. Test
Start oracle
Check Parameters
Echo $ ORACLE_BASE
Echo $ ORACLE_HOME
Echo $ PATH
If not, Set
Start listening
Lsnrctl start
Start the service
Sqlplus/nolog
Conn/as sysdba
Startup
Do a small test
It indicates that oracle can be used.
Disable oracle
Shutdown
(Shutdown Without parameters does not respond for a long time. I use the shutdown immediate command and can also use other parameters, as shown below: shutdown normal: it is not allowed to start a new connection, wait for the session to end, wait for the transaction to end, make a checkpoint, and close the data file. No instance recovery is required at startup. Shutdown transactional: do not allow new connections, do not wait for the session to end, wait for the transaction to end, make a checkpoint, and close the data file. No instance recovery is required at startup. Shutdown immediate: do not allow new connections, do not wait for the session to end, do not wait for the transaction to end, make a checkpoint and close the data file. Transactions that are not finished are automatically rolled back. No instance recovery is required at startup. Shutdown abort: does not allow new connections, does not wait for the session to end, does not wait for the transaction to end, does not do the checkpoint and does not close the data file. The instance is automatically restored at startup.
Quit exit
Disable listening
VII. External Database Connection
Start oracle as described above
View Virtual Machine IP addresses
Ifconfig
Run cmd on the host to test whether ping is successful.
Connect with plsql
Error:
Go to ORACLE_HOME and modify listener. ora and tnsnames. ora.
(Back up data first)
Change localhost to the IP address of the VM.
Vim listener. ora
Vim tnsnames. ora
Restart oracle services and listeners
Start listening
Start the service
Unlock scott
Go to the scott secret page.
We recommend that you use tiger as the password. Otherwise, you will be a bit silly if you forget it.
The system account was successfully logged in only after I unlocked and reset the password.
You can download the complete PDF file from the help site:
------------------------------------------ Split line ------------------------------------------
Free in http://linux.bkjia.com/
The username and password are both www.bkjia.com
The specific download directory is available at/July 15, 16.04,/July 25,/Ubuntu, And the Oracle 11gR2 installation tutorial is illustrated in the text/
For the download method, see
------------------------------------------ Split line ------------------------------------------