Install oracle 11g in linux

Source: Internet
Author: User

My linux version is centos5.5 and the kernel version is 2.6.18-194. el5. in linux, it is best to install the oracle System with 1 GB memory and 2 GB swap space. The hard disk requires at least 4 GB space.
1. Download oracle
Go to the oracle official website to download the corresponding version of oracle, which is stored in oracle for linux X86.
Http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
2. Create oracle users and manage groups in linux
Log on to linux as a root user and run the following command:
#/Usr/sbin/groupadd dba
#/Usr/sbin/groupadd Partition
#/Usr/sbin/groupadd oinstall
# Useradd oracle
#/Usr/sbin/usermod-g oinstall-G dba oracle (dba is the Management Group)
#/Usr/sbin/useradd-g oinstall-G dba oracle
# Passwd oracle
Pre-create installation directory
# Mkdir-p/opt/oracle/product
# Mkdir-p/opt/oracle/product/OraHome
# Mkdir-p/opt/oraInventory
# Mkdir-p/opt/oracle/oradata
# Mkdir-p/var/opt/oracle
Set the group and permissions of the directory owner
# Chown-R oracle. oinstall/opt/oracle
# Chown-R oracle. oinstall/opt/oracle/oradata
# Chown-R oracle. oinstall/opt/oracle/product/OraHome
# Chown-R oracle. dba/opt/oraInventory
# Chown oracle. dba/var/opt/oracle
# Chmod-R 775/opt/oracle
# Chmod-R 755/var/opt/oracle
Set oracle environment variables
# Su-oracle
$ Vim/home/oracle/. bash_profile
Add the following to the file:
 
Export ORACLE_BASE =/opt/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/OraHome
Export ORACLE_SID = orcl
Export ORACLE_OWNER = oracle
Export ORACLE_TERM = vt100
Export PATH = $ PATH: $ ORACLE_HOME/bin: $ HOME/bin
Export PATH = $ ORACLE_HOME/bin: $ ORACLE_HOME/Apache/bin: $ PATH
LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/local/lib
Export LD_LIBRARY_PATH
CLASSPATH = $ ORACLE_HOME/JRE: $ ORACLE_HOME/jlib: $ ORACLE_HOME/rdbms/jlib
CLASSPATH = $ CLASSPATH: $ ORACLE_HOME/network/jlib
Export CLASSPATH
PATH = $ PATH:/usr/sbin; export PATH
PATH = $ PATH:/usr/bin; export PATH
Note:
11g: ORA_NLS33 = $ ORACLE_HOME/nls/admin/data
10g: ORA_NLS33 = $ ORACLE_HOME/ocommon/nls/admin/data
9i: ORA_NLS33 =/oracle/app/ora92/ocommon/nls/admin/data
Save and exit
-- Execute the following command to make the configuration take effect immediately or use oracle user login to make the configuration take effect
$ Source $ HOME/. bash_profile

Iii. decompress the oracle package
I downloaded the. Zip package and run the following command:
# Unzip linux_11gR2_database_1of2.zip
# Unzip linux_11gr2_databasesilicate f2.zip
Note that the decompressed directory user oracle must have the read and write permissions and can change the directory user and group to oracle:
# Chown-R oracle database
# Chgrp-R oinstall database
4. Install oracle
Reboot and log on to oracle to enter the graphic interface
# Cd database
#./RunInstaller
Then, go to the graphical installation process, which is relatively simple. Step by step, note that we should install the oracle software first, and then configure the listener and database after installing the software. The steps and options of the installation process are as follows:
 

First install the database software!
 
 
Select single-instance installation. If you need RAC, select RAC installation!
 

Select Chinese and English!
 

 
Here is the installation directory of oracle. It should be under the/opt directory you just created. oracle is for users!
 
 
Here is the oracle Management Group, which is the dba defined above. Next step!
 

Check the system installation conditions. By default, failure items are listed, and system memory, swap, disk space, dependent packages, and kernel parameters are checked, some items can be repaired, and some items cannot be repaired. You can click the above repair and re-check. A dialog box is displayed:
 

Follow the prompts above:
Open a terminal and Log On As root
# Cd/tmp/CVU_11.2.0.1.0_oracle
#./Runfixup. sh
Then return to the window to confirm
There are also some dependency packages available for use
# Yum install [package name]
If you are prompted that the yum source of this package cannot be found, try to use wildcards. For example, if the sysstat.1.5.103 package cannot be found, you can use
# Yum install sysstat *
If some other conditions are not met and cannot be installed, you can select ignore all and then install it next.
After the installation is complete, two scripts are prompted:
Log on as a root user, enter the prompted directory like above, and execute these two scripts.
(Installation directory)/orainstRoot. sh
(Installation directory)/root. sh
Press enter directly. The default value is OK.
The database is successfully installed!
The software is installed, the database is not created, and the Listener is configured.
5. Install the listener
Execute Command
# Netca
Go to the graphical configuration page and click Next by default. You can also modify the name, protocol, and port of the listener.
After the installation is complete, run the following command:
# Ps-ef
To check whether the Listener Configuration is successful.
6. Install the database program
Run the following command:
# Dbca
Go to the graphical configuration page and continue to the next step.
 


Prompt to enter the global database name. I entered orcl.com

 
 
 
Next, select the second option and enter the password twice! This password is your database administrator password!
Go directly to the next step and check the instance template.
Next, select the character encoding AL32UTF-8 under the third option
Continue to the next step until the database is installed and complete.
At this point, your oracle installation is complete.
7. Test Database Connection
You can use the following sqlplus statement to connect to the database
Use the oracle user to log on remotely, and then
$ Sqlplus/nolog
SQL> conn/as sysdba
Connected to an idle instance.
Error
SQL> startup
[Oracle @ localhost ~] $ Sqlplus/nolog
SQL * Plus: Release 11.2.0.1.0 Production
Copyright (c) 1982,200 9, Oracle. All rights reserved.
SQL> conn/as sysdba
Connected.
SQL> create table testUser (id integer, name char (10 ));
Table created.
SQL> insert into testUser values (0, 'jack ');
1 row created.
SQL> commit;
Commit complete.
SQL> select * from testUser;
ID NAME
--------------------
0 Jack
Close Database
SQL> shutdown immediate
SQL> quit
Your oracle has been successfully installed!
 
 
Author "Evolution"

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.