使用goldengate 迁移Oracle到postgresql

 环境:

--源端:

IP:10.0.4.16

hostname:tencent

Oracle数据库版本:12.2.0.1.0

ogg for oracle版本:19.1.0.0.4

SID:orcl

--目标端:

IP:10.0.4.16

hostname:tencent

postgresql数据库版本:14.6

ogg for postgresql版本:21.3.0.0.0

db:ogg

2、安装和配置OGG软件(源端),以下操作都是在源端操作

2.1创建安装目录

mkdir -p /oracle/ogg

2.2设置oracle环境变量

export ORACLE_BASE=/oracle/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1

export PATH=$ORACLE_HOME/bin:/oracle/ogg:$PATH

export OGGHOME=/oracle/ogg

export ORACLE_SID=orcl

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$OGGHOME:$LD_LIBRARY_PATH

export TNS_ADMIN=$ORACLE_HOME/network/admin

2.3建立OGG表空间和用户

create tablespace oggtbs datafile '/oradata/orcl/oggtbs.dbf' size 200M autoextend on;

create user ogg identified by ogg default tablespace ogg;

grant connect, resource TO ogg;

grant select any dictionary, select any table TO ogg;

grant flashback any table TO ogg;

grant execute on dbms_flashback TO ogg;

grant ALTER ANY TABLE to ogg;

grant insert any table to ogg;

grant update any table to ogg;

grant delete any table to ogg;

grant create table,create sequence to ogg;

grant execute on utl_file to ogg;

grant dba to ogg;

alter system set enable_goldengate_replication=true;

2.4添加附加日志和force logging,并切换日志

如果源端不开启归档,需添加多组日志。

alter database force logging;

alter database add SUPPLEMENTAL log data;

SQL>select NAME,OPEN_MODE,FORCE_LOGGING,SUPPLEMENTAL_LOG_DATA_MIN from v$database;

NAME OPEN_MODE FORCE_LOGGING SUPPLEME


ORCL READ WRITE YES YES

2.5 创建OGG的管理工作目录

在配置OGG进程之前,首先需要创建OGG的管理目录,执行以下操作:

GGSCI (tencent) 3> create subdirs

Creating subdirectories under current directory /oracle/ogg

Parameter file /oracle/ogg/dirprm: created.

Report file /oracle/ogg/dirrpt: created.

Checkpoint file /oracle/ogg/dirchk: created.

Process status files /oracle/ogg/dirpcs: created.

SQL script files /oracle/ogg/dirsql: created.

Database definitions files /oracle/ogg/dirdef: created.

Extract data files /oracle/ogg/dirdat: created.

Temporary files /oracle/ogg/dirtmp: created.

Credential store files /oracle/ogg/dircrd: created.

Masterkey wallet files /oracle/ogg/dirwlt: created.

Dump files /oracle/ogg/dirdmp: created.

只有提交事务的record才会被捕获。抽取、投递、应用日志的单位是record,而不是trail文件。

2.6配置MGR参数文件,并启动mgr

mgr进程是这些进程的管理和守护进程,目标端的mgr进程还与源端进行通信

edit params mgr

PORT 7809

GGSCI (tencent) 7> start mgr

Manager started.

GGSCI (tencent) 8> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

2.7添加extract进程 抽取进程:负责抓取需要传输的数据(添加进程的时候为抽取点,而不是启动进程的时候) 从21开始OGG需要配置tns #查看当前数据库语言 SQL> select userenv('language') from dual; USERENV('LANGUAGE')

AMERICAN_AMERICA.ZHS16GBK

--配置extract进程

#编辑参数

GGSCI (tencent as ogg@orcl) 21> edit params exta

extract exta

SETENV (NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

SETENV (ORACLE_HOME=/oracle/app/oracle/product/12.2.0/db_1)

SETENV (ORACLE_SID=orcl)

USERID ogg@orcl, PASSWORD ogg

DISCARDFILE ./dirrpt/exta.dsc,APPEND,MEGABYTES 1024

EXTTRAIL ./dirdat/ea

table hr.*;

#创建extract组

ADD EXTRACT exta, TRANLOG, BEGIN NOW

#创建本地 trail 文件

ADD EXTTRAIL ./dirdat/ea, EXTRACT exta, MEGABYTES 5

#启动extract进程

GGSCI (tencent as ogg@orcl) 22> start exta

GGSCI (tencent as ogg@orcl) 24> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING EXTA 00:01:45 00:00:03

2.8投递进程

投递进程:

EDIT PARAMS pumpa

#编辑参数

GGSCI (tencent as ogg@orcl) 26> edit param pumpa

EXTRACT pumpa

SETENV (NLS_LANG=AMERICAN_AMERICA.UTF8)

PASSTHRU

RMTHOST 10.0.4.16, MGRPORT 7810

RMTTRAIL ./dirdat/pa

TABLE hr.*;

#用add extract指定本地 trail 文件

ADD EXTRACT pumpa, EXTTRAILSOURCE ./dirdat/ea

#用add rmttrail指定远程 trail 文件

ADD RMTTRAIL ./dirdat/pa, EXTRACT pumpa, MEGABYTES 5

#启动Pump进程

START EXTRACT pumpa

GGSCI (tencent) 13> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

EXTRACT RUNNING EXTA 00:00:00 00:00:00

EXTRACT RUNNING PUMPA 00:00:00 00:00:01

2.9生成define文件

在异构的同步复制中需要生成define文件。用于数据兼容不同数据库。

edit params defgen

#参数文件内容

defsfile ./dirdef/defgen.def

userid ogg, password ogg

TABLE hr.*;

#退出ggsci命令

GGSCI (tencent) 20> exit

#生成文件

[oracle@tencent ogg]$ defgen paramfile ./dirprm/defgen.prm

Oracle GoldenGate Table Definition Generator for Oracle

Version 19.1.0.0.4 OGGCORE_19.1.0.0.0_PLATFORMS_191017.1054

Linux, x64, 64bit (optimized), Oracle 12c on Oct 17 2019 13:20:56

Copyright (C) 1995, 2019, Oracle and/or its affiliates. All rights reserved.

Starting at 2023-07-25 23:54:08

Operating System Version:

Linux

Version #1 SMP Tue Jun 28 15:37:28 UTC 2022, Release 3.10.0-1160.71.1.el7.x86_64

Node: tencent

Machine: x86_64

soft limit hard limit

Address Space Size : unlimited unlimited

Heap Size : unlimited unlimited

File Size : unlimited unlimited

CPU Time : unlimited unlimited

Process id: 2283

** Running with the following parameters **

defsfile ./dirdef/defgen.def

userid ogg, password ***

TABLE hr.;Expanding wildcard table specification hr.:

Retrieving definition for HR.COUNTRIES.

Retrieving definition for HR.DEPARTMENTS.

Retrieving definition for HR.EMPLOYEES.

Retrieving definition for HR.EMP_DETAILS_VIEW.

2023-07-25 23:54:10 WARNING OGG-06439 No unique key is defined for table EMP_DETAILS_VIEW. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.

Retrieving definition for HR.JOBS.

Retrieving definition for HR.JOB_HISTORY.

Retrieving definition for HR.LOCATIONS.

Retrieving definition for HR.REGIONS.

Retrieving definition for HR.RSXY_QT_ZRRSBJN_TEMP.

2023-07-25 23:54:10 WARNING OGG-06439 No unique key is defined for table RSXY_QT_ZRRSBJN_TEMP. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.

Definitions generated for 9 tables in ./dirdef/defgen.def.

#生成文件后传送文件到目标端dirdef目录下

cp /oracle/ogg/dirdef/defgen.def /postgresql/ogg/dirdef

三、安装和配置OGG软件(目标端),以下操作都是在目标端操作

3.1 创建安装目录

mkdir -p /postgresql/ogg

3.2 配置环境变量

export PGHOME=/postgresql/pg14

export PGDATA=/postgresql/pgdata

export PATH=$PGHOME/bin:$OGGHOME:/usr/bin/isql:$PATH

export OGGHOME=/postgresql/ogg

export ODBCINI=$OGGHOME/odbc.ini

export LD_LIBRARY_PATH=$PGHOME/lib:/postgresql/ogg/lib:$LD_LIBRARY_PATH

3.3 创建ogg用户

[postgres@tencent dirdef]$ psql

psql (14.6)

Type "help" for help.

postgres=# create database ogg;

CREATE DATABASE

postgres=# create user ogg superuser password 'ogg';

CREATE ROLE

postgres=# \c ogg ogg

You are now connected to database "ogg" as user "ogg".

ogg=# \c

You are now connected to database "ogg" as user "ogg".

ogg=# create schema ogg;

CREATE SCHEMA

3.4 创建DSN

ogg for postgresql使用的是ODBC来连接数据库,因此需要指明ODBC dirver

--安装UnixODBC

yum install -y unixODBC.x86_64

--安装PostgresqlODBC

yum install -y postgresql-odbc.x86_64

--配置ODBC

cd /etc/ 复制odbcinst.ini到ogg的home目录下,查看odbcinst

(注意该文件不要改动)

[postgres@tencent ogg]$ cat odbcinst.ini

Example driver definitions

Driver from the postgresql-odbc package

Setup from the unixODBC package

[PostgreSQL]

Description = ODBC for PostgreSQL

Driver = /usr/lib/psqlodbcw.so

Setup = /usr/lib/libodbcpsqlS.so

Driver64 = /usr/lib64/psqlodbcw.so

Setup64 = /usr/lib64/libodbcpsqlS.so

FileUsage = 1

Driver from the mysql-connector-odbc package

Setup from the unixODBC package

[MySQL]

Description = ODBC for MySQL

Driver = /usr/lib/libmyodbc5.so

Setup = /usr/lib/libodbcmyS.so

Driver64 = /usr/lib64/libmyodbc5.so

Setup64 = /usr/lib64/libodbcmyS.so

FileUsage = 1

--配置odbc.ini,在该文件中填写

[postgres@tencent ogg]$ vi odbc.ini

[ODBC Data Sources]

gg_pg=DataDirect 14.6 PostgreSQL Wire Protocol #gg_pg数据库别名,与下面gg_pg相同

[ODBC]

IANAAppCodePage=106 #106等价于UTF8

InstallDir=/postgresql/ogg #ogg home目录

[gg_pg]

Driver=/postgresql/ogg/lib/GGpsql25.so #OGG安装目录下有内置ODBC驱动

Description=DataDirect 14.6 PostgreSQL Wire Protocol

Database=ogg

HostName=10.0.4.16

PortNumber=4519

--登录Postgresql数据库

修改profile文件,添加ODBCINI,指定ODBC DRIVER路径

[postgres@tencent ogg]$ vi ~/.bash_profile

export ODBCINI=$OGGHOME/odbc.ini

#添加odbcini访问路径,默认访问/etc目录下的odbc.ini

#此时isql访问数据库失败,可以忽略,如下

[postgres@tencent ogg]$ isql gg_pg

[ISQL]ERROR: Could not SQLConnect

#ggsci登录postgresql

[postgres@tencent ogg]$ ggsci

Oracle GoldenGate Command Interpreter for PostgreSQL

Version 21.3.0.0.0 OGGCORE_21.3.0.0.0_PLATFORMS_210728.1047

Oracle Linux 7, x64, 64bit (optimized), PostgreSQL on Aug 4 2021 20:27:55

Operating system character set identified as UTF-8.

Copyright (C) 1995, 2021, Oracle and/or its affiliates. All rights reserved.

GGSCI (tencent) 1> dblogin sourcedb gg_pg userid ogg,password ogg

2023-07-26 11:12:21 INFO OGG-03036 Database character set identified as UTF-8. Locale: en_US.utf8.

2023-07-26 11:12:21 INFO OGG-03037 Session character set identified as UTF-8.

Successfully logged into database.

3.5 创建ogg目录

GGSCI (tencent) 1> create subdirs

Creating subdirectories under current directory /postgresql/ogg

Parameter file /postgresql/ogg/dirprm: created.

Report file /postgresql/ogg/dirrpt: created.

Checkpoint file /postgresql/ogg/dirchk: created.

Process status files /postgresql/ogg/dirpcs: created.

SQL script files /postgresql/ogg/dirsql: created.

Database definitions files /postgresql/ogg/dirdef: created.

Extract data files /postgresql/ogg/dirdat: created.

Temporary files /postgresql/ogg/dirtmp: created.

Credential store files /postgresql/ogg/dircrd: created.

Master encryption key wallet files /postgresql/ogg/dirwlt: created.

Dump files /postgresql/ogg/dirdmp: created.

3.6 配置mgr组

edit params mgr

GGSCI (tencent) 2> view param mgr

port 7810

GGSCI (tencent) 3> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

3.7 添加checkpoint表

为了保证源和目标端在传数据的时候不会重复或者少传,在目标端添加checkpoin表

GGSCI (tencent) 4> dblogin sourcedb gg_pg userid ogg,password ogg

2023-07-26 11:12:21 INFO OGG-03036 Database character set identified as UTF-8. Locale: en_US.utf8.

2023-07-26 11:12:21 INFO OGG-03037 Session character set identified as UTF-8.

Successfully logged into database.

GGSCI (tencent as ogg@gg_pg) 2> add checkpointtable ogg.checkpointtab

Successfully created checkpoint table ogg.checkpointtab.

3.8 配置replicate进程

#编辑参数文件

GGSCI (tencent) 6>edit params repa

REPLICAT repa

SOURCEDEFS ./dirdef/defgen.def

SETENV(ODBCINI=/postgresql/ogg/odbc.ini)

SETENV(NLS_LANG=AMERICAN_AMERICA.ZHS16GBK)

TARGETDB gg_pg,userid ogg,password ogg

DISCARDFILE ./ogg/dirrpt/repa.rpt, append

MAP hr.*, TARGET hr.*;

#添加 Replicat 进程

add replicat repa,exttrail ./dirdat/pa,begin now,checkpointtable ogg.checkpointtab

#启动 Replicat 进程

GGSCI (tencent as ogg@gg_pg) 8> start repa

#查看进程启动情况

GGSCI (tencent as ogg@gg_pg) 9> info all

Program Status Group Lag at Chkpt Time Since Chkpt

MANAGER RUNNING

REPLICAT RUNNING REPA 00:00:00 00:00:00

第四章 数据验证

--创建表结构

1、源端oracle执行

SQL> create table t1 (id int);

Table created.

#添加附加日志

GGSCI (tencent) 12> dblogin userid ogg,password ogg

Successfully logged into database.

GGSCI (tencent as ogg@orcl) 13> add trandata hr.*

2、目标端postgresql执行

ogg=# create user hr with password 'hr';

CREATE ROLE

ogg=# grant all on database ogg to hr;

GRANT

ogg=# create schema hr;

CREATE SCHEMA

ogg=# alter schema hr owner to hr;

ALTER SCHEMA

ogg=> create table hr.t1 (id int);

CREATE TABLE

ogg=> \d

List of relations

Schema | Name | Type | Owner

--------+------+-------+-------

hr | t1 | table | hr

(1 row)

--源端oracle插入数据

SQL> insert into t1 values(1);

1 row created.

SQL> commit;

Commit complete.

#查看数据插入情况

GGSCI (tencent) 10> stats exta

Sending STATS request to EXTRACT EXTA ...

Start of Statistics at 2023-07-26 11:35:09.

Output to /oracle/ogg/dirdat/ea:

Extracting from HR.T1 to HR.T1:

*** Total statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Daily statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Hourly statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Latest statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

End of Statistics.

#捕获进程正常,捕获一条数据

GGSCI (tencent) 11> stats pumpa

Sending STATS request to EXTRACT PUMPA ...

Start of Statistics at 2023-07-26 11:35:15.

Output to ./dirdat/pa:

Extracting from HR.T1 to HR.T1:

*** Total statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Daily statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Hourly statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Latest statistics since 2023-07-26 11:35:07 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

End of Statistics.

#传输进程正常,传输一条数据

--目标端postgresql查看数据 [postgres@tencent ogg]$ psql ogg hr psql (14.6) Type "help" for help. ogg=> \c You are now connected to database "ogg" as user "hr". ogg=> select * from t1; id

1

(1 rows)

GGSCI (tencent as ogg@gg_pg) 35> stats repa

Sending STATS request to Replicat group REPA ...

Start of statistics at 2023-07-26 11:46:17.

Replicating from HR.T1 to hr.t1:

*** Total statistics since 2023-07-26 11:46:09 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Daily statistics since 2023-07-26 11:46:09 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Hourly statistics since 2023-07-26 11:46:09 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

*** Latest statistics since 2023-07-26 11:46:09 ***

Total inserts 1.00

Total updates 0.00

Total deletes 0.00

Total upserts 0.00

Total discards 0.00

Total operations 1.00

End of statistics.

#数据应用正常,目标库插入一条数据。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/8652.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

ES6基础知识三:对象新增了哪些扩展?

一、属性的简写 ES6中,当对象键名与对应值名相等的时候,可以进行简写 const baz {foo:foo}// 等同于 const baz {foo}方法也能够进行简写 const o {method() {return "Hello!";} };// 等同于const o {method: function() {return "…

【MATLAB绘图】

MATLAB绘图函数:Plot函数详解 介绍 MATLAB是一种常用的科学计算和数据可视化工具,它提供了强大的绘图函数,使用户能够创建各种类型的图表和图形。 基本语法 plot函数的基本语法如下: plot(x, y)其中,x和y是长度相…

第八次CCF计算机软件能力认证

第一题:最大波动 小明正在利用股票的波动程度来研究股票。 小明拿到了一只股票每天收盘时的价格,他想知道,这只股票连续几天的最大波动值是多少,即在这几天中某天收盘价格与前一天收盘价格之差的绝对值最大是多少。 输入格式 输入…

子网划分和计网解题方法

子网的基本概念 子网是计算机网络中的一个逻辑单元,是由多个IP地址组成的网络。在计算机网络中,IP地址是一个32位的二进制数,用于标识网络上的设备。子网划分是将一个大型的IP地址网络划分为多个小的IP地址网络,每个小的IP地址网…

uni-app:实现账号密码登录,并且实现当页面登录过该账号在下次登录时无需再输入账号密码(本地缓存实现)

效果 前端代码 一、完整代码 <template><view><view class"all"><view class"title"><image :src"title_login" alt"图片损坏" /></view><form class"login-form" submit"fo…

TSDB - VictoriaMetrics 技术原理浅析

一、前言 在监控领域&#xff0c;通常需要指标存储组件TSDB&#xff0c;目前开源的TSDB组件比较多&#xff0c;各个组件性能、高可用性、维护成本等等各有差异。本文不分析选型问题&#xff0c;重点讲解VictoriaMetrics&#xff08;后面简称为vm&#xff09;。 有兴趣的朋友建议…

吉林大学计算机软件考研经验贴

文章目录 简介政治英语数学专业课 简介 本人23考研&#xff0c;一战上岸吉林大学软件工程专硕&#xff0c;政治72分&#xff0c;英一71分&#xff0c;数二144分&#xff0c;专业课967综合146分&#xff0c;总分433分&#xff0c;上图&#xff1a; 如果学弟学妹需要专业课资料…

Mysql执行计划字段解释

文章目录 一、前言二、如何查看执行计划三、执行计划各字段解释四、select_type4.1、SIMPLE&#xff08;简单查询&#xff09;4.1.1、简单的单表查询4.1.2、多表连接查询 4.2、PRIMARY&#xff08;主查询&#xff09;4.2.1、包含复杂子查询的外层查询4.2.2、UNION语句中的第一个…

自动化测试框架unittest与pytest的区别!

引言 前面文章已经介绍了python单元测试框架&#xff0c;大家平时经常使用的是unittest&#xff0c;因为它比较基础&#xff0c;并且可以进行二次开发&#xff0c;如果你的开发水平很高&#xff0c;集成开发自动化测试平台也是可以的。而这篇文章主要讲unittest与pytest的区别&…

可解释的 AI:在transformer中可视化注意力

Visualizing Attention in Transformers | Generative AI (medium.com) 一、说明 在本文中&#xff0c;我们将探讨可视化变压器架构核心区别特征的最流行的工具之一&#xff1a;注意力机制。继续阅读以了解有关BertViz的更多信息&#xff0c;以及如何将此注意力可视化工具整合到…

Debian12中为python3配置虚拟环境及在Pycharm中使用虚拟环境

在Debian 12中&#xff0c;python默认为python 3.11。 基于应用&#xff0c;现需设置虚拟环境。 1.安装venv模块 从python3.3开始&#xff0c;配置python虚拟环境&#xff0c;可用venv模块&#xff0c;更加方便了。 执行命令&#xff1a; #apt install python3.11-venv 2.…

Java虚拟机——前端编译优化

Java的编译期是有上下文语境影响的&#xff0c;不同语境下可以指不同的过程&#xff1a; 可以是前端编译器&#xff0c;把*.java文件转变成*.class文件的过程。 JDK的Javac、Eclipse JDT中的增量式编译器 可以指Java虚拟机的即时编译器&#xff08;JIT编译器&#xff09;在运…

【算法基础:搜索与图论】3.6 二分图(染色法判定二分图匈牙利算法)

文章目录 二分图介绍染色法判定二分图例题&#xff1a;860. 染色法判定二分图 匈牙利匹配二分图最大匹配匈牙利匹配算法思想例题&#xff1a;861. 二分图的最大匹配 二分图介绍 https://oi-wiki.org/graph/bi-graph/ 二分图是图论中的一个概念&#xff0c;它的所有节点可以被…

FPGA驱动SPI屏幕(附完整工程)

一. 简介 相信大家都玩过屏幕&#xff0c;在FPGA上使用最多的就是VGA/HDMI接口的显示器了&#xff0c;这两种显示器的优点就不用说了&#xff0c;缺点就是体积比较大&#xff0c;而且价格比较贵&#xff0c;对于追求便携/价格低的我来说&#xff0c;SPI接口的屏幕才是我的首要…

更新合集 | 七月功能上新记

点击链接了解详情 七月来临&#xff0c;正式开启 2023 下半年的新征途&#xff01;这个盛夏&#xff0c;腾讯云 CODING 上线了微信扫码注册、微信通知、Go 制品管理等重点能力&#xff0c;为企业及团队研发管理带来更多便利&#xff01;以下是 CODING 新功能速递&#xff0c;快…

登录页的具体实现 (小兔鲜儿)【Vue3】

登录页 整体认识和路由配置 整体认识 登录页面的主要功能就是表单校验和登录登出业务 准备模板 <script setup></script><template><div><header class"login-header"><div class"container m-top-20"><h1 cl…

详解go的hex.Encode原理

简言 今天看nsq的messageID生成的时候&#xff0c;发现它使用了hex.Encode函数来产生编码&#xff0c;那就顺道研究一下这个编码方式。 原理 hex是16进制的意思&#xff0c;encode是进行编码的意思&#xff0c;内部实现也很简单&#xff0c;就是 每4位计算出十六进制的值&a…

基于Python机器学习、深度学习在气象、海洋、水文等技能提升教程

详情点击链接&#xff1a;基于Python机器学习、深度学习技术提升气象、海洋、水文领域实践应用 前言 Python是功能强大、免费、开源&#xff0c;实现面向对象的编程语言&#xff0c;能够在不同操作系统和平台使用&#xff0c;简洁的语法和解释性语言使其成为理想的脚本语言。…

数据可视化(1)

使用python带的matplotlib库进行简单的绘图。使用之前先进行安装&#xff0c;pip install matplotlib。如果安装了Anaconda,则无需安装matplotlib。 1.简单折线图 #绘制简单图表 import matplotlib.pyplot as plt plt.plot([1,2,3,4,5]) plt.show() import matplotlib.pyp…

2023年的深度学习入门指南(19) - LLaMA 2源码解析

2023年的深度学习入门指南(19) - LLaMA 2源码解析 上一节我们学习了LLaMA 2的补全和聊天两种API的使用方法。本节我们来看看LLaMA 2的源码。 补全函数text_completion源码解析 上一节我们讲了LLaMA 2的编程方法。我们来复习一下&#xff1a; generator Llama.build(ckpt_di…