This semester, I took the Oracle database course. Textbooks and instructors both use 10 Gb of lectures. However, Oracle11g has been released for a long time, and its functions tend to be stable. It also provides complete online materials, so I plan to install Oracle11g for learning. My current system is Ubuntu12.04amd64, which has two users: root and wwr. The following installation steps are for the wwr user.
This semester, I took the Oracle database course. Textbooks and teachers both use 10 Gb of lectures. However, Oracle 11g has been released for a long time, and its functions tend to be stable. It also provides a complete set of related information on the Internet, therefore, we plan to install an Oracle 11 GB for learning. My current system is Ubuntu 12.04 amd64, which has two users: root and wwr. The following installation steps are for wwr users:
This semester, I took the Oracle database course. Textbooks and teachers both use 10 Gb of lectures. However, Oracle 11g has been released for a long time, and its functions tend to be stable. It also provides a complete set of related information on the Internet, therefore, we plan to install an Oracle 11 GB for learning.
My current system is Ubuntu 12.04 amd64, which has two users: root and wwr. The following installation steps are performed under the wwr user. Download the Oracle database version from the Oracle official website (linux. x64_11gR2_database, two files in total ). The following installation steps combine several posts on the Internet. Although there are many minor problems after the test, the Oracle database has been installed successfully.
1. Update the system to the latest version and execute the following code on the terminal. It takes a long time to connect to the Internet.
Sudo apt-get update
Sudo apt-get dist-upgrade
2. Install the dependency package. It also requires a long time to connect to the Internet.
Sudo apt-get install alien binutils build-essential cpp-4.4 debhelper g + +-4.4 gawk gcc-4.4 gcc-4.4-base gettext html2text ia32-libs intltool-debian ksh lesstif2 lib32bz2-dev lib32z1-dev libaio-dev ready libc6 libc6-dev libc6-dev-i386 libdb4.8 libelf -dev libelf1 libltdl-dev libltdl7 libmotif4 libodbcinstq4-1 libodbcinstq4-1: i386 libqt4-core libqt4-gui libsqlite3-0 libstdc + + 5 libstdc + 6 libstdc + + 6-4.4-dev lsb-core lsb-cxx lsb-desktop lsb-graphics lsb-qt4 make odbcinst pax po-debconf rpm-common sysstat unixodbc-dev unzip
3. Create a user or user group (optional. It can be used by the current wwr user, But I created an oracle user during installation)
Sudo groupadd oinstall
Sudo groupadd dba
Sudo mkdir-p/opt/oracle
Sudo useradd-g oinstall-G dba-d/opt/oracle-s/bin/bash oracle
Sudo passwd oracle
Sudo chown-R oracle: oinstall/opt/oracle
Sudo groupadd oinstall
Sudo groupadd dba
Sudo mkdir-p/opt/oracle
Sudo useradd-g oinstall-G dba-d/opt/oracle-s/bin/bash oracle
Sudo passwd oracle
Sudo chown-R oracle: oinstall/opt/oracle
Sudo groupadd oinstall
Sudo groupadd dba
Sudo mkdir-p/opt/oracle
Sudo useradd-g oinstall-G dba-d/opt/oracle-s/bin/bash oracle
Sudo passwd oracle
Sudo chown-R oracle: oinstall/opt/oracle
Iv. 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
Add the corresponding data in/etc/sysctl. conf according to the result.
fs.aio-max-nr = 1048576fs.file-max = 6815744kernel.shmall = 2097152kernel.shmmax = 536870912kernel.shmmni = 4096kernel.sem = 250 32000 100 128net.ipv4.ip_local_port_range = 9000 65500net.core.rmem_default = 262144net.core.rmem_max = 4194304net.core.wmem_default = 262144net.core.wmem_max = 1048586
Run the following command to update kernel parameters:
sudo sysctl -p
5. Add kernel restrictions for Oracle users in/etc/security/limits. add the following data to the conf file. oracle is the user created in step 3. Skip step 3 and write it to the current user.
oracle soft nproc 2047oracle hard nproc 16384oracle soft nofile 1024oracle hard nofile 65536oracle soft stack 10240
View/etc/pam. d/login and add the following lines (If yes, no need to add them)
Session required pam_limits.so
Check/etc/pam. d/su in the same way.
Session required pam_limits.so
6. Create a required folder (for installing oracle)
mkdir ~/Oracle/oracle11gmkdir ~/Oracle/oradata
Then, run the chown-R command to set the Oracle owner and user group in the folder to your user (oracle: oinstall). In this step, I finally installed oracle to/opt/oracle, that is, the oracle folder is not used in the main directory of the Oracle user.
7. Configure environment variables in ~ /. Add the following environment variables to bashrc ~ Replace with absolute path
# Write the created folder export ORACLE_BASE = ~ /Oracle/oracle11g # after this (seemingly), you can enter export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1 # Database sidexport ORACLE_SID = "orcl" # default Character Set export NLS_LANG =. AL32UTF8
In this step, because I installed the oracle database under the/opt/oracle directory. the contents in the bashrc file are as follows: (I don't know what the file will do. Later, I need to add the ORACLE_HOME environment variable in/etc/profile)
Export ORACLE_BASE =/opt/oracle/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_1
Export NLS_LANG =. AL32UTF8
8. Cheat oracle Installation Program
mkdir /usr/lib64ln -s /etc /etc/rc.dln -s /lib/x86_64-linux-gnu/libgcc_s.so.1 /lib64/ln -s /usr/bin/awk /bin/awkln -s /usr/bin/basename /bin/basenameln -s /usr/bin/rpm /bin/rpmln -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
In this step, some of the installation tasks fail. The last line seems to have sudo added.
9. restart the computer (optional)
10. Run the installer on the premise that it has been decompressed
Cd/xxx
./RunInstaller
The graphical installation interface is displayed, and the next step is displayed.
Because the/Oracle/oradata folder cannot be accessed during the execution of this step, after the restart of Step 9, the newly created oracle user is directly entered, therefore, the database is installed under the/opt/oracle/app/oracle directory. (For example)
The installation process may be as follows:
Click Ignore All directly, and then click Next. Then, the "link binary file error" occurs. The solution is to open another terminal and execute the following command:
sed -i 's/^\(\s*\$(MK_EMAGENT_NMECTL)\)\s*$/\1 -lnnz11/g' $ORACLE_HOME/sysman/lib/ins_emagent.mksed -i 's/^\(\$LD \$LD_RUNTIME\) \(\$LD_OPT\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/bin/genorasdkshsed -i 's/^\(\s*\)\(\$(OCRLIBS_DEFAULT)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/srvm/lib/ins_srvm.mksed -i 's/^\(TNSLSNR_LINKLINE.*\$(TNSLSNR_OFILES)\) \(\$(LINKTTLIBS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/network/lib/env_network.mksed -i 's/^\(ORACLE_LINKLINE.*\$(ORACLE_LINKER)\) \(\$(PL_FLAGS)\)/\1 -Wl,--no-as-needed \2/g' $ORACLE_HOME/rdbms/lib/env_rdbms.mk
Then retry. A similar error still occurs. If you do not know why, continue directly.
In the last step, you need to execute two files and open another terminal to execute the file. This is easy.