1.挂载镜像,使用本地的yum源
挂载iso镜像
/etc/yum.repos.d
touch CentOS-Media.repo
[c7-media]
name=CentOS-$releasever - Media
baseurl=file:///mnt/ #挂载的路径
gpgcheck=1
enabled=1 #启用这个yum源
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
yum clean all
yum makecache
yum list 查看
2.oracle建好库之后,需要创建用户
sqlplus /nolog
conn / as sysdba;
查看用户
select * from all_users;
create user linan identified by xxx;
更改密码
alter user linan identified by xxx;
授权dba用户
GRANT dba, connect, resource to xxx;
授权普通用户
GRANT dba, connect, resource to xxxx;
commit;
conn username/password
3.jdk配置
jdk:
export JAVA_HOME=/usr/local/src/jdk1.7.0_79
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=$JAVA_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin
4.限制tomcat使用的内存
JAVA_OPTS="-server -Xms800m -Xmx800m -XX:PermSize=64M -XX:MaxNewSize=256m -XX:MaxPermSize=128m -Djava.awt.headless=true"
5.指定的tomcat设定成jdk8
vim bin/catalina.sh
export JAVA_HOME=/home/tomcat/jdk1.8.0_151
vim bin/setclasspath.sh
export JAVA_HOME=/home/tomcat/jdk1.8.0_151
6.jsp显示时间
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
JSP在页面显示实时时间
<%
Date d = new Date();
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String now = df.format(d);
%>
192.168.3.105 当前时间:<%=now %>
nginx 转发 tomcat
location ^~ /txserver/ {
proxy_pass http://tomcat;
}
location ~\.jsp$ {
proxy_pass http://tomcat;
}
upstream tomcat {
#ip_hash;
server 192.168.3.105:8080;
#server xxx:8201;
}
7.vim 操作
shift < 向做移动
- tcpdump 抓包
抓包tcpdump tcpdump -i eth0 port 443 tcpdump -i eth0 port 443 -w 1.cap 保存到文件 tcpdump -i eth0 -s 0 port 443 -s 0 : 抓取数据包时默认抓取长度为68字节。加上-S 0 后可以抓到完整的数据包
9.orcle启动
oracle 迁移数据
exp linan/linan@app dumpfile=d:\linan.dmp
create directory expdp_dir as 'D:\';
grant read,write on directory expdp_dir to linan;
expdp linan/linan@app DIRECTORY=expdp_dir DUMPFILE=linan.dmp
exp linan/linan@app file=d:\linan.dmp log=d:\explinan.log
set NLS_LANG=AMERICAN_AMERICA.AL32UTF8
imp linan/linan@xinapp file=d:\linan.dmp fromuser=linan touser=linan log=d:\implinan.log
import done in AL32UTF8 character set and AL16UTF16 NCHAR character set
重建表
SELECT 'alter table '||TABLE_NAME||' move tablespace FCCMS;' FROM USER_TABLES WHERE TABLESPACE_NAME = 'USERS'
重建索引
SELECT 'alter index '|| INDEX_NAME ||' rebuild tablespace FCCMS;' FROM user_indexes;
oracel 数据库导出
exp xxx/xxx@orcl file=/home/orcl.dmp full=y
启动监听
lsnrctl start
lsnrctl stop
启动实例
export ORACLE_SID=orcl
sqlplus /nolog
conn / as sysdba
startup
shutdown
startup mount
alter database open;
遇到问题
ORA-00214: control file
'/ora/oracle/fast_recovery_area/linantest/control02.ctl' version 77669
inconsistent with file '/ora/oracle/oradata/linantest/control01.ctl' version
控制文件替换
ORA-00742: Log read detects lost write in thread %d sequence %d block %d
ORA-00312: online log 2 thread 1: '/ora/oracle/oradata/orcl/redo02.log'
RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL
ALTER DATABASE OPEN RESETLOGS;
RECOVER DATABASE UNTIL CANCEL;
/ora/oracle/diag/tnslsnr/localhost/listener/trace
关注 linsten.log 是否大于4G ,超过4G会有问题
10.软链接
ln -s /home/mysql_bakup /opt/mysql_bakup
11.时间同步
* */1 * * * timedatectl set-timezone 'Asia/Shanghai'
* */1 * * * /usr/sbin/ntpdate 192.168.3.1;/sbin/hwclock -w
12.mysql备份
备份命令
mysqldump --single-transaction --master-data=2 -h ${dbserver} -u${dbuser} -p${dbpasswd} ${dbname} > ${logpath}/${backtime}_dqws_pro.sql 2>> ${logpath}/mysqlback.log;
导入
mysql -uroot -p123456 < 20181105_xxx_pro.sql
13 curl 模型post请求
curl -d "" ""