forever杨的个人博客

I want to be forever young!


  • 首页

  • 文章202

  • 分类31

  • 标签175

  • 公益

  • 关于

  • 搜索

Oracle 整库迁移

发表于 2020-10-13 | 更新于 2020-11-05 | 分类于 Oracle
| 字数: 994 | 时长 ≈ 1 分钟
标签 expdp impdp

导出

1
2
3
4
5
6
7
8
9
10
11
12
expdp 用户名/密码  directory=DMP logfile=e_T_C_CNCM_EXTINFO.log dumpfile=T_C_CNCM_EXTINFO%U.dmp PARALLEL=6  cluster=no  compression=ALL tables=(table1,table2)

directory=DMP -- 这个是虚拟目录(日志文件和DMP文件存放路径), 需求提前在数据库里面创建,需要DBA权限。
create directory DMP as '/dmp/backup';
grant read,write,EXECUTE on directory DMP to 用户名;

logfile=e_T_C_CNCM_EXTINFO.log -- EXPDP日志
dumpfile=T_C_CNCM_EXTINFO%U.dmp -- 输出的DMP文件,其中%U为并行导出产生的序号,如果开6个并行,就可能会有六个文件,自动从01-06编号
PARALLEL=6 -- 并行导出,可以根据主机CPU增加,最好不要超过CODE数
cluster=no -- 关闭cluster(防止非共享磁盘写文件问题)
compression -- 压缩
tables=() -- 可以写多个table
阅读全文 »

Oracle 编码配置

发表于 2020-10-13 | 更新于 2020-11-05 | 分类于 Oracle
| 字数: 494 | 时长 ≈ 1 分钟
标签 编码

查编码

1
select userenv('language') from dual
阅读全文 »

elastic-job 使用

发表于 2020-10-02 | 更新于 2021-04-09 | 分类于 elastic-job
| 字数: 751 | 时长 ≈ 1 分钟
标签 elastic-job

2.1.5 版本

context-path配置

修改 context-path

com.dangdang.ddframe.job.restful.RestfulServer

1
2
3
4
5
private ServletContextHandler buildServletContextHandler() {
ServletContextHandler result = new ServletContextHandler(ServletContextHandler.SESSIONS);
result.setContextPath("/");
return result;
}
阅读全文 »

Oracle spool操作

发表于 2020-09-30 | 更新于 2020-11-19 | 分类于 Oracle
| 字数: 611 | 时长 ≈ 1 分钟
标签 spool
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/ksh
echo "set echo off;
set heading off;
set line 100;
set long 2000000000;
set longchunksize 255;
set wra on;
set newpage none;
set pagesize 0;
set numwidth 12;
set termout off;
set trimout on;
set trimspool on;
set feedback off;
set timing on;
execute dbms_logmnr.add_logfile(LogFileName=>'/oracle/app/oracle/logs/hrbfct_1_4156_748575599.arc',Options=>dbms_logmnr.new);
execute dbms_logmnr.start_logmnr(DictFileName=>'/oracle/app/oracle/logs/dict.ora');
spool /oracle/app/oracle/logs/record3.txt;
select id||'|'||name from t_user;
spool off;
" | sqlplus '/as sysdba'>/dev/null

Oracle dblink操作

发表于 2020-09-28 | 更新于 2020-11-05 | 分类于 Oracle
| 字数: 414 | 时长 ≈ 1 分钟
标签 dblink

创建

1
2
3
4
-- 语法
-- create <public> database link <dblink_name> connect to <user> identified by <user_pwd> using <dblink>

create database link db_test connect to scott identified by tiger using '(DESCRIPTION=(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.1)(PORT = 1521)))(CONNECT_DATA=(SERVER = DEDICATED)(SERVICE_NAME = orcl)))';
阅读全文 »

Oracle 归档日志

发表于 2020-09-28 | 更新于 2021-04-06 | 分类于 Oracle
| 字数: 2.3k | 时长 ≈ 2 分钟
标签 archiver

开启、关闭归档

开启

1
2
3
4
5
6
7
8
9
10
-- 关闭数据库
shutdown immediate;
-- 打开数据库
startup mount;
-- 开启归档日志
alter database archivelog;
-- 开启数据库
alter database open;
-- 查看归档日志是否开启
archive log list;
阅读全文 »

Linux ftp 命令

发表于 2020-09-25 | 更新于 2020-11-06 | 分类于 Linux
| 字数: 615 | 时长 ≈ 1 分钟
标签 ftp

登录

1
ftp <ip> <port>

下载

1
get <file_name>
阅读全文 »

docker pentaho-kettle 安装和配置

发表于 2020-09-21 | 更新于 2020-10-19 | 分类于 kettle
| 字数: 742 | 时长 ≈ 1 分钟
标签 pentaho-kettle docker

docker配置

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
version: "3.8"

services:
jenkins_agent:
container_name: ts_kettle
image: hiromuhota/webspoon:0.9.0.22
ports:
- "8081:8080"
volumes:
- "./pdi/kettle:/home/tomcat/.kettle"
- "./pdi/pentaho:/home/tomcat/.pentaho"
- "./pdi/tomcat/plugins:/usr/local/tomcat/plugins"
- "./pdi/tomcat/system:/usr/local/tomcat/system"
- "./pdi/tomcat/simple-jndi:/usr/local/tomcat/simple-jndi"
- "./pdi/tomcat/webapps/spoon:/usr/local/tomcat/webapps/spoon"
- "/var/run/docker.sock:/var/run/docker.sock"
- "/etc/localtime:/etc/localtime"
restart: always
阅读全文 »

Oracle 表空间操作

发表于 2020-09-15 | 更新于 2021-04-06 | 分类于 Oracle
| 字数: 3.3k | 时长 ≈ 3 分钟
标签 Oracle

空间回收

1
purge recyclebin;
阅读全文 »

Windows 默认软件不可用的问题

发表于 2020-09-08 | 更新于 2022-09-23 | 分类于 软件
| 字数: 281 | 时长 ≈ 1 分钟
标签 Windows

命令打开服务

1
services.msc

命令行打开网络中心

1
ncpa.cpl

软链

1
2
3
4
# 建立软链接
mklink /D "C:\Program Files\VanDyke Software\Clients" "D:\Program Files\SecureCRT"
# 删除软链接
rmdir "C:\Program Files\VanDyke Software\Clients"

kill 进程

1
2
3
4
# 查询进程号
netstat -ano | findstr 8080
# tasklist
taskkill /pid 12804 -t -f

ssh无密码登录

发表于 2020-09-04 | 更新于 2022-04-15 | 分类于 Linux
| 字数: 806 | 时长 ≈ 1 分钟
标签 ssh

主控节点设置ssh无密码跳转到受控节点的信任关系

假设有3台服务器

  • 主控服务器

    • 192.168.123.1
  • 受控服务器

    • 192.168.123.2
    • 192.168.123.3

其中192.168.123.1需要无密码登录到192.168.123.2和192.168.123.3

即在192.168.123.1上执行

1
ssh -p22 user@192.168.123.2

可以无密码登录到192.168.123.2

阅读全文 »

docker 使用

发表于 2020-09-02 | 更新于 2024-06-25 | 分类于 docker
| 字数: 2.9k | 时长 ≈ 3 分钟
标签 docker

打包镜像

  • save

    1
    docker save -o nginx.tar nginx:1.18.0-alpine-perl
  • load

    1
    docker load --input nginx.tar
阅读全文 »

docker kafka 安装和配置

发表于 2020-08-28 | 更新于 2020-10-19 | 分类于 kafka
| 字数: 1.1k | 时长 ≈ 1 分钟
标签 docker kafka

scala版本2.13

kafka版本2.6.0

docker pull wurstmeister/kafka:2.13-2.6.0

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
version: "3.8"

services:
kafka:
container_name: ts_kafka
image: wurstmeister/kafka:2.13-2.6.0
ports:
- "9092:9092"
volumes:
- "KAFKA_ADVERTISED_HOST_NAME=172.54.102.25"
# 在 kafka 集群中,每个 kafka 都有一个 BROKER_ID 来区分自己
- "KAFKA_BROKER_ID=0"
# 配置 kafka 的监听端口
- "KAFKA_LISTENERS=PLAINTEXT://9092"
# 把 kafka 的地址端口注册给 zookeeper
- "KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://9092"
# 配置 zookeeper
- "KAFKA_ZOOKEEPER_CONNECT=zookeeper01:2181,zookeeper02:2181/kafka"
# 关闭 Topic 自动创建
- "KAFKA_AUTO_CREATE_TOPICS_ENABLE=false"
- "./logs:/tmp/kafka-logs"
- "/var/run/docker.sock:/var/run/docker.sock"
# 容器时间同步虚拟机的时间
- "/etc/localtime:/etc/localtime"
restart: always

/var/run/docker.sock挂载了之后,在容器内就可以执行”docker ps”、”docker port”这些命令了,这是docker官方提供的能力。假设kafka容器的9092映射到宿主机的30001端口,那么kafka注册到ZK的时候,要注册的IP应该是宿主机的IP,端口应该是30001,这样才能保证外部可访问,所以kafka容器启动时会执行一个名为start-kafka.sh的脚本,里面用docker port命令来获取宿主机的端口,因此必须要挂载/var/run/docker.sock才能执行docker port命令

docker mysql安装和配置

发表于 2020-08-24 | 更新于 2022-06-17 | 分类于 mysql
| 字数: 1.7k | 时长 ≈ 2 分钟
标签 docker mysql

mysql

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
version: "3.8"

services:
mysql:
image: mysql:5.7.31
container_name: mysql
ports:
- "3306:3306"
volumes:
- "./data/:/var/lib/mysql"
- "./logs/:/var/log/mysql"
# - "./conf/conf.d:/etc/mysql/conf.d"
# - "./conf/mysql.conf.d:/etc/mysql/mysql.conf.d"
- "./conf/my.cnf:/etc/mysql/conf.d/my.cnf"
- "/etc/localtime:/etc/localtime"
environment:
MYSQL_ROOT_PASSWORD: "test123456"
restart: always

my.cnf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License, version 2.0,
# as published by the Free Software Foundation.
#
# This program is also distributed with certain software (including
# but not limited to OpenSSL) that is licensed under separate terms,
# as designated in a particular file or component or in included license
# documentation. The authors of MySQL hereby grant you an additional
# permission to link the program and your derivative works with the
# separately licensed software that they have included with MySQL.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License, version 2.0, for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/

docker nexus3安装和配置

发表于 2020-08-24 | 更新于 2020-10-19 | 分类于 docker
| 字数: 402 | 时长 ≈ 1 分钟
标签 docker nexus3

nexus3

docker-compose.yml

1
2
3
4
5
6
7
8
9
10
11
12
version: "3.8"

services:
nexus3:
container_name: ts_nexus3
image: sonatype/nexus3:3.26.1
ports:
- "8081:8081"
volumes:
- "./data:/nexus-data"
- "/etc/localtime:/etc/localtime"
restart: always

问题:Error creating bundle cache.
Unable to update instance pid: Unable to create directory /nexus-data/instances

解决:sudo chmod -R 775 data/

1…345…14
forever杨

forever杨

开心又过一日,唔开心又过一日

202 文章
31 分类
175 标签
GitHub
友情链接
  • Tidy的个人博客
© 2024 forever杨 | 站点总字数: 706k