More than 10 o'clock in the evening, the leader suddenly gave a big job, let's deploy an environmental requirement as follows:
os:centos6.5
jdk1.8
tomcat8.0.22
oracle-11g
Instantly feel the Moe
What is a JDK? I've never done it before, and there's only one of them that knows about Tomcat and nothing else.
The production process is now recorded as follows:
A: Introduction
First, get to know what the next thing is.
1:jdk
The JDK (Java Development Kit,java Development Kit, Java Development tool) is a program development environment that writes Java applets and applications. It consists of a running environment on top of the operating system layer and the tools that developers need to compile, debug, and run applets and applications written in the Java language. The JDK is the core of the entire Java, including the Java Runtime (Java Runtime Envirnment), a stack of Java tools, and a Java-based class library (Rt.jar).
As I understand it, it should be something like GCC.
2 Tomcat
Tomcat server is a free open source Web application server, belongs to the lightweight application server, in small and medium-sized systems and concurrent access users are not widely used, is the first choice to develop and debug JSP programs.
is actually a Java can be developed to publish the Dongdong
3 Oracle 11g
Oracle 11g is the latest database software launched, Oracle 11g has more than 400 features, after 15 million hours of testing, the development workload reached 36,000 people/month, equivalent to 1000 employees for continuous research and development 3 years. Oracle 11g delivers high performance, scalability, availability, and security, and makes it easier to run on a grid of low-cost servers and storage devices, with unique features compared to previous versions of Oracle 11g
is a very good database software, anyway, I did not use
Two. Installation
1 Installing the JDK
: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
According to the actual situation download, I download here is a 64-bit RPM package
Reference Document: http://my.oschina.net/zhangjie830621/blog/280935
Statement:
Before installing, please configure the Yum source, because to install the desktop and a lot of dependent packages, it is recommended to install Epel. The command is as follows:
Yum Install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Delete the Java JDK package that comes with your system, such as:
Rpm-qa | Grep-e ' ^open[jre|jdk]|j[re|dk] '
Yum Remove Java-1.6.0-openjdk
Yum Remove Java-1.7.0-openjdk
Installing the JDK
RPM-IVH jdk-8u5-linux-64.rpm
Installation process If a file can not be created, there are probably two possible, one is the package is not, compare the operating system is 64, you have to pack 32, that certainly not; second, the package is not removed clean, please carefully troubleshoot
Install OK, check the version
Java-version
By default it is installed under/usr/java
2 Installing Tomcat
Here I have the package can be used directly, without compiling the installation
Here is a download link: Link: http://pan.baidu.com/s/1pJJtk0N Password: EKFL
Reference Document: Http://www.linuxidc.com/Linux/2015-01/111485.htm
Here I will install Tomcat under/OPT
Tar zxvf/soft/apache-tomcat-8.0.23.tar.gz
Mv/apache-tomcat-8.0.23/opt/tomcat8
Chmod-r +x/opt/tomcat8
To do this, you can actually open or close the service directly from the command under its bin, but we want to add it to the system service, so we need to define the environment variables, and write a small script
As follows
Vim/etc/profile command, add the environment variable code as follows (add to end)
#jdk Config
Export java_home=/usr/java/jdk1.8.0_45
Export Calsspath= $JAVA _home/lib/*.*
#tomcat Config
Export TOMCAT_HOME=/OPT/TOMCAT8
Export CATALINA_HOME=/OPT/TOMCAT8
#path Config
Export path= $PATH: $JAVA _home/bin: $TOMCAT _home/bin
Write a script
Vi/etc/rc.d/init.d/tomcat generates a script file with the following content
#!/bin/bash
#/etc/rc.d/init.d/tomcat
# init script for Tomcat precesses
# Processname:tomcat
# Description:tomcat is a J2SE server
# chkconfig:2345 86 16
# Description:start up the Tomcat servlet engine.
if [-f/etc/init.d/functions]; Then
. /etc/init.d/functions
elif [-f/etc/rc.d/init.d/functions]; Then
. /etc/rc.d/init.d/functions
Else
Echo-e "\atomcat:unable to locate functions lib. Cannot continue. "
Exit-1
Fi
Retval=$?
Catalina_home= "/opt/tomcat8" #tomcat安装目录
Case "$" in
Start
If [-f $CATALINA _home/bin/startup.sh];
Then
echo $ "Starting Tomcat"
$CATALINA _home/bin/startup.sh
Fi
;;
Stop
If [-f $CATALINA _home/bin/shutdown.sh];
Then
echo $ "Stopping Tomcat"
$CATALINA _home/bin/shutdown.sh
Fi
;;
*)
echo $ "Usage: $ {start|stop}"
Exit 1
;;
Esac
Exit $RETVAL
chmod 755/etc/rc.d/init.d/tomcat to make the script file executable
Chkconfig--add/etc/rc.d/init.d/tomcat #将其加到服务中
Add the following statement to the vim/opt/tomcat8/bin/catalina.sh file:
#auto Startup Tomcat Config
Export java_home=/usr/java/jdk1.8.0_45/
Export CATALINA_HOME=/OPT/TOMCAT8
Export CATALINA_BASE=/OPT/TOMCAT8
Export catalina_tmpdir=/opt/tomcat8/temp/
To start the Tomcat services: Service Tomcat start
Stop Tomcat Services: Service Tomcat stop
Visit: http://localhost:8080
It is relatively simple to set the default username and password. is to fix the Tomcat-user.xml file, define role, and then bind the user
3: Install Oracle 11g
First you install the desktop
Yum Groupinstall "Desktop" "X Windows System"
This installation is a bit complicated, specifically not written, the reference document is as follows:
Http://wenku.baidu.com/link?url= 43vmbt9oxnjylzky7j9n0orte6-erakxe-sqvj3r57lwpoiuas1gppbapxp2casp4b-ttxgi3f3fg63zcfxvvnipji5zaj8kncz1up4e4tu &qq-pf-to=pcqq.c2c
http://blog.csdn.net/gaofeng2009123/article/details/8021150
Http://www.linuxidc.com/Linux/2015-02/113222p8.htm
Login
Simple inspection
[Email protected] ~]$ sqlplus "/As SYSDBA"
Sql*plus:release 11.2.0.1.0 Production on Sat Jan 24 14:51:10 2015
Copyright (c) 1982, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the partitioning, OLAP, Data Mining and Real application testing options
Sql>startup
When performing this step, note that there can be no error, if any, please refer to the following troubleshooting guide; The main reading is the wrong code number.
Sql> CREATE TABLE z_test (ID number,name varchar (20));
Table created.
sql> INSERT INTO Z_test Select 1, ' a ' from dual;
1 row created.
Sql> select * from Z_test;
ID NAME
---------- ----------------------------------------
1 A
Sql> commit;
Commit complete.
Sql> exit
Report:
————————————————————————————————————————————————————————
User name related
Username/Password Login ID description
Sys/change_on_install SYSDBA or Sysoper cannot log on as NORMAL and can be used as the default system administrator
System/manager SYSDBA or NORMAL cannot log on as Sysoper and can be used as the default system administrator
Sysman/oem_temp Sysman user name for OMS
Scott/tiger Normal Normal User
Aqadm/aqadm SYSDBA or NORMAL Advanced Queue Administrator
Dbsnmp/dbsnmp SYSDBA or NORMAL replication administrator
——)——————————————————————————————————————————————————————
Error and Troubleshooting Guide:
Http://www.linuxidc.com/Linux/2014-04/100206.htm
Oracle sqlplus Common Command Daquan
Sql> Show All-View all 68 system variable values
Sql> Show user--show current connected users
Sql> Show Error--Show errors
Sql> set heading off-suppresses output column headers, default value on
Sql> set feedback off-suppresses the last-line count feedback, with the default value "6 or more records, loopback on"
Sql> set timing on-default is off, set query time-consuming, can be used to estimate the execution times of SQL statements, test performance
Sql> set Sqlprompt "sql>"--Set default prompt, default value is "Sql>"
Sql> set Linesize 1000--Set screen display line width, default 100
Sql> set autocommit on--Set whether to submit automatically, default to OFF
Sql> set pause on--default is off, set pause, will stop the screen display, wait for the ENTER key, and then display the next page
Sql> set arraysize 1--Defaults to 15
Sql> set Long 1000--default is 80
Description
The Long value defaults to 80, and setting 1000 is to show more content because a long data type is used in many data dictionary views, such as:
Sql> desc user_views
Column name nullable value no type
------------------------------- -------- ----
View_name not NULL VARCHAR2 (30)
Text_length number
TEXT LONG
sql> Define a = ' 20000101 12:01:01 '--Define local variables, if you want to use a constant like a carriage return that is included in various displays,
--You can use the Define command to set
Sql> select &a from dual;
Original value 1:select &a from dual
New value 1:select ' 20000101 12:01:01 ' from dual
' 2000010112:01:01
-----------------
20000101 12:01:01
Questions raised:
1, the user needs to perform an identical SQL operation for each table under the database user, it is troublesome to type the SQL statement again and again.
Implementation method:
Sql> set heading off-Suppresses output column headers
Sql> set feedback off-suppresses the counting feedback for the last line
Lists the definitions of all synonyms under the current user and can be used to test the true existence of synonyms
Select ' Desc ' | | Tname from tab where tabtype= ' synonym ';
Query the number of records for all tables under the current user
Select ' Select ' | | tname| | ', COUNT (*) from ' | | tname| | '; ' from tab where tabtype= ' TABLE ';
Grant the SELECT permission to public for all tables that match the criteria
Select ' Grant Select on ' | | table_name| | ' to public, ' from User_tables where ' condition ';
Delete various objects under the user
Select ' Drop ' | | tabtype| | ' ' | | Tname from Tab;
Delete eligible users
Select ' Drop user ' | | username| | ' cascade; ' from All_users where user_id>25;
Quickly compile all views
----When the database is dumped on a new server (database rebuild), the view needs to be recompiled again.
----because of problems with the table-space view's connection to tables in other tablespaces, you can quickly compile with PL/SQL language features.
Sql> SPOOL on. Sql
Sql> SELECT ' ALTER VIEW ' | | tname| | ' COMPILE; ' From TAB;
Sql> SPOOL OFF
Then execute the on.sql.
Sql> @ON. Sql
Of course, authorization and creating synonyms can also be done quickly, such as:
sql> Select ' GRANT select on ' | | tname| | ' to user name; ' From TAB;
sql> SELECT ' CREATE synonym ' | | tname| | ' for user name. ' | | tname| | '; ' From TAB;
List of commands:
Assume that the current execution command is: SELECT * from Tab;
(a) ppend add text to buffer current line end a order by Tname result: SELECT * from tab order by Tname;
(Note: A followed by 2 spaces)
(c) Hange/old/new replaces the old text with the new text in the current line c/*/tname result: select Tname from Tab;
(c) Hange/text Delete text from the current line c/tab result: select Tname from;
Del Delete when moving forward
Del n Deletes the nth row
(i) Nput text adds a row after the current line
(l) IST displays all rows in the buffer
(l) ist n shows the nth row in the buffer
(l) IST m n Display buffer m to n rows
Run command to execute the current buffer
/command to execute the current buffer
R command to execute the current buffer
The @ file name runs the SQL file that is transferred into memory, such as:
sql> Edit s< return >
If the S.sql file does not exist under the current directory, the system automatically generates the S.sql file,
Enter "SELECT * from Tab;" To save the exit.
Sql> @s< return >
The system automatically queries all tables, views, and synonyms under the current user.
@@ 文件名 name is used when calling a. sql file in a. sql file
The Save file name Buffer command is saved as a file, and the default file name extension is. sql
Get file name in SQL file to disk
Start file name runs the SQL file that is transferred into memory
Spool file name the following actions and execution results "spool" is saved to the disk file, the default file name extension is. lst
Spool Displays the current "spool" status
Spool off stop output
Cases:
Sql> Spool A
Sql> Spool
Being spooled to A.lst
Sql> Spool Off
Sql> Spool
Currently no spool
Exit Sql*plus
DESC table name shows the structure of the table
Show user displays the currently connected users
Show Error shows errors
Show all shows the values of all 68 system variables
Edit opens the default editor, the default is Notepad.exe in the Windows system, the last SQL statement in the buffer is transferred into the Afiedt.buf file for editing
The edit file name puts the. sql file specified in the current directory into the editor for editing
Clear screen clears the current display
Two Oracle sqlplus Statement Editing commands
First we enter such an instruction:
SELECT emp_id, Emp_name
From Employees
The input command can then add a statement after the previous instruction, such as when the above statement is run:
Input WHERE emp_age > 30
The following command can be obtained:
SELECT emp_id, Emp_name
From Employees
WHERE emp_age > 30
The ln command is used to specify the operation of the nth-line statement that is entered, such as after the statement is run:
L1 the currently selected statement line is the
SELECT emp_id, Emp_name
("*" is indicated before the statement)
The a command is used to add characters directly to the end of the current line, such as when the above statement is run:
A, emp_dept
Then the executed instruction becomes:
SELECT emp_id, Emp_name, emp_dept
From Employees
WHERE emp_age > 30
The C command modifies the characters in the current statement, such as typing after the statement is run:
The c/emp_name/emp_age/executes an instruction that changes to:
SELECT emp_id, Emp_age, emp_dept
From Employees
WHERE emp_age > 30
The del n command is used to delete the nth-line instruction, for example, after the above statement is run:
DEL 3
Then the executed instruction becomes:
SELECT emp_id, Emp_age, emp_dept
From Employees
This article is from the "Zhengerniu" blog, make sure to keep this source http://liufu1103.blog.51cto.com/9120722/1662656
Centos6.5 installation jdk8+tomcat8.0.22+oracle-11g