Centos6.5 build Java Development environment configuration detailed _linux

Source: Internet
Author: User
Tags character set dba mkdir centos tomcat sqlplus

First, install the JDK

1. See if Linux is installed with its own JDK

 
 

If OPENJDK is present, it is best to uninstall the OPENJDK and install the Sun Company's JDK.

2. View JDK Information

 
 

3. Uninstall OPENJDK and do the following:

RPM-E--nodeps Tzdata-java-2012c-1.el6.noarch 

4. New Java installation directory

 
 

5. Unzip and install the previously downloaded JDK

TAR-ZXVF jdk-7u71-linux-i586.tar.gz 

6. Add Java environment variables to profile

Vi/etc/profile 
export java_home=/usr/java/jdk1.7.0_71 
export Classpath=.:%java_home%/lib/dt.jar:%java_ Home%/lib/tools.jar 
export path= $PATH: $JAVA _home/bin 

7. Immediate entry into force of the document

Source/etc/profile  

8. Detect whether the installation is successful

 
 

Second, the installation of Tomcat

1. Upload the tomcat.tar.gz to the/var/local below (the path can be selected by yourself), and then unpack

 
 

2. Move the uploaded tomcat to a directory and change the name

MV apache-tomcat-7.0.57/ 

3. Start Tomcat

 
 

Direct Access Tomcat default address after startup

4. When unable to access, shut down the firewall

 
 

5. Set power-on self-starter

The first method: adding Tomcat and java_home environment variables under/etc/rs.local

Vi/etc/rs.local 
java_home=/usr/java/jdk1.7.0_71 
export Java_home 

Here's a bit of a description, rc.local before the/etc/profile, so you will not get the Java environment variables, so add the code before startup.sh Java_home

Third, install Oracle

Official Installation Guide: https://docs.oracle.com/cd/E11882_01/install.112/e24323/toc.htm

Reference article: http://www.jb51.net/article/47076.htm

1, hardware requirements (this is not the point, reader Network)

2, software requirements

2.1 Viewing Dependency Packs

 
 

In addition to these packages mentioned on the official web site, the following packages are also suggested for installation:

unixODBC-2.2.11

unixodbc-devel-2.2.11

elfutils-libelf-devel-0.97

pdksh-5.2.14

2.2 Install the required package in Yum mode

 
 

2.3 Installation Libxp

This library, this must be installed, otherwise install Oracle will appear Java Exception.

 
 

3. Environment configuration

3.1 Shutdown firewall, disable SELinux

 
 
# Vi/etc/selinux/config 
selinux=disabled 

and then reboot.

3.2 Modify machine name (general default equality)

Here the/etc/sysconfig/network in the hostname to be consistent with the/etc/hosts, if consistent without modification

3.3 Creating Users and groups

The user name and group set up here will help you choose directly when installing Oracle. Otherwise, there are no users and groups at installation.

Set up Group Oinstall

 
 

Building a group DBA

Groupadd dba 

Add user Oracle and add it to Oinstall and DBA groups

USERADD-G oinstall-g dba Oracle 

Test Oracle Account Setup completed

 
 

Create a new password for Oracle

passwd Oracle 

3.4 Creating an Oracle installation folder and a data storage folder

Mkdir-p/opt/oracle/ 
mkdir-p/opt/oracle/orainventory 
chown-r oracle:oinstall/opt/oracle 

3.5 Configuring System Kernel Parameters

 
 

Add the following parameters:

FS.AIO-MAX-NR = 1048576 
Fs.file-max = 6815744 
Kernel.shmmni = 4096 Kernel.sem 
= 32000 MB 
128 Pv4.ip_local_port_range = 9000 65500 
net.core.rmem_default = 262144 Net.core.rmem_max 
= 
4194304 Net.core.wmem_default = 262144 

Enable changes that have just been made

 
 

3.6 Modifying the number of processes and the maximum number of sessions

Edit/etc/security/limits.conf

vi/etc/security/limits.conf 

Oracle Soft nproc 2047 
Oracle hard nproc 16384 
Oracle Soft nofile 1024 

3.7 Set the associated information, execute the following command, modify the associated file/etc/pam.d/login

Vi/etc/pam.d/login 

Join:

Session required/lib/security/pam_limits.so 

3.8 Modify the system startup environment parameters, execute the following commands, modify the system startup environment parameter file

 
 

After Pathmunge, add:

if [$USER = "Oracle"]; Then 
if [$SHELL = "/bin/ksh"]; then 
ulimit-p 16384 ulimit-n 65536 
Else 
ulimit-u 16384-n 655 The 
fi 

3.9 Switching users, configuring Oracle User Environment variables

Vi. bash_profile 
oracle_base=/opt/oracle 
oracle_home= $ORACLE _base/product/11.2.0/dbhome_1/bin/ (Different versions of the ORACLE installation directory may not be the same, this is 11.2.0) 
oracle_sid=sims (database instance, defined yourself) 
ld_library_path= $ORACLE _home/lib 
PATH = $PATH: $ORACLE _home/bin: $HOME/bin 

Website recommends not set up the installation folder that is $oracle_home, but I suggest that the establishment here, because do not build good, the back of the DBCA, NETCA and other orders are not found

Make settings take effect

 
 

3.10 Installation

Put the downloaded Oracle files under/opt/oracle

Su-oracle 
$ cd/opt/oracle 
$ unzip Linux.11gr2_database_1of2.zip 

3.11 To resolve Chinese garbled before installation

Echo $LANG If it is not in English, it is temporarily set as follows

 
 

3.12 Switch to graphical interface installation

If it is remote, need to install remote software, otherwise can not enter the graphical installation interface;

If you are operating directly on the server, you do not need, so the installation of CentOS, you need to choose Desktop installation

Cd/opt/oracle/databse 

Note Some points:

The first step of the mailbox can not write; Installation method I chose the single database installation, only installed the software body, did not establish a database and monitoring, so the installation needs to create a database and configuration monitoring.

Here to pay attention to, I see a lot of information on the Internet is to create a database and then configure the monitoring, I do not know how this is done, but I in the actual operation,

It is impossible to create a database first, you must first configure the monitor!

4 after the installation is complete, the Oracle user logs in

4.1 Configuration Monitor:

 
 

Step by step, next.

4.2 Creating a database:

 
 

Attention to the character set, remember to choose Chinese.

(If Oracle_home does not specify, you cannot use these commands, so you can first look at your current oracle_home, that is, Echo $ORACLE _home)

4.3 Whether the test was successfully installed

To view the listening status:

 
 

Database connection:

Sqlplus/as SYSDBA 

To this, CentOS6 Oracle G database installation was successful.

Four, CentOS6 launch Oracle

1. Manually start the database

Log on with an Oracle user

$lsnrctl start 
$sqlplus/as sysdba 

And then we can manipulate the database.

2. Automatically start the database

2.1 Root User Login

Modify Oratab

#vi/etc/oratab 
sims:/opt/oracle/product/11.2.0/dbhome_1:y (n to Y) 

Save

2.2 Modification Dbstart,dbshut

#vi/opt/oracle/11.2.0/bin/dbstart 
oracle_home_listner= $ORACLE _home (originally $) 
#vi/opt/oracle/11.2.0/bin/dbshut 
oracle_home_listner= $ORACLE _home (originally $) 

2.3 Adding content to rc.local

 
 

Add the following content to the file

Su oracle-lc "/opt/oracle/product/11.2.0/dbhome_1/bin/lsnrctl start" 
su oracle-lc "/opt/oracle/product/11.2.0/ Dbhome_1/bin/dbstart " 

esc:wq! 

Done!

V. Other
Linux Update Source: Https://lug.ustc.edu.cn/wiki/mirrors/help/centos
1. Enter Yum Source configuration directory as root

Su Root
cd/etc/yum.repos.d/

2. Backup system with the Yum source

MV Centos-base.repo Centos-base.repo.bak

3. Download the corresponding version of the hkust Yum Source, put into the/etc/yum.repos.d/

You can also wget Http://centos.ustc.edu.cn/Centos-Base.repo (but this method personally feels bad to determine the source version)

4. After the source is updated, the cache is generated so that the operation takes effect immediately

Yum Makecache

5. Start the update

Yum Update

Install Chinese Input Method

1. Install as Root

SU root
yum install "@Chinese Support"

2. Settings to add the input method just installed to the Input method list

Click System-->preferences-->input method. Then click "Enable Input Method feature", check "enabling input Features", and select "Use IBus (Recommended)", click "Preferred Input Method"

Click "Input Method Preferences", click on the Input Methods tab, select Chinese, select Pinyin in the list (of course, you will be other input method can also choose other), click "Add", add the selected input method to the Input method list

3.reboot

finished! Have fun!

The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.

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.