percona

Would the following primary key change work with `pt-online-schema-change`?

心不动则不痛 提交于 2019-12-11 20:51:05
问题 This is a follow-up of Can I use pt-online-schema-change to change a primary key?. Goal: I'd like to ALTER a table's primary key using pt-online-schema-change. Specifically I want migrate from single-column primary key (a) to a composite primary key (a,b) (where a is the same column in both cases). Idea: I understand pt-online-schema-change generally doesn't work when both primary key and unique key is missing. My plan is therefor to do the following: Add a unique key: pt-online-schema-change

Problems export/importing between MySQL versions

不想你离开。 提交于 2019-12-11 13:04:20
问题 I'm attempting to import an SQL file generated by 5.5.25-MariaDB-mariadb1 into 5.1.55-rel12.6 - (Percona Server (GPL), 12.6 , Revision 200) after importing the first 11 tables the import process breaks with the following error:- ERROR 1064 (42000) at line 35252: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'PAGE_CHECKSUM=1' at line 10 Line 35252 contains the following:- CREATE TABLE `kygvj_bwps_lockouts`

Can I use pt-online-schema-change to change a primary key?

独自空忆成欢 提交于 2019-12-11 09:17:55
问题 I'm considering using pt-online-schema-change to ALTER a primary key (changing it from one column, to a composite primary index) of a table. Are there any limitations to doing this? The documentation states In most cases the tool will refuse to operate unless a PRIMARY KEY or UNIQUE INDEX is present in the table. See --alter for details. 回答1: Well, don't do that. Running pt-online-schema-change on a table w/o a single column unique index, may result in a loss of data. See #3 here: http://www

InnoDB: custom auto-increment using insert select. Can there be duplicate-key error?

↘锁芯ラ 提交于 2019-12-11 08:36:25
问题 I have a table like: idx (PK) clmn_1 Both are INTs. idx is not defined as auto-increment, but I am trying to simulate it. To insert into this table, I am using: "INSERT INTO my_tbl (idx, clmn_1) \ SELECT IFNULL(MAX(idx), 0) + 1, %s \ FROM my_tbl", val_clmn_1 Now, this works. The query that I have is about atomicity. Since I read and then insert to the same table, when multiple inserts happen simultaneous can there potentially be a duplicate-key error? And, how can I test it myself? I am using

Migration From Tokumx 1.5 To Percona Server For mongodb 3.11

爱⌒轻易说出口 提交于 2019-12-11 07:37:03
问题 Migrating Data from Tokumx To Percona Server For MonoDB Step 1 : This guide describes how to upgrade existing Percona TokuMX instance to Percona Server for MongoDB. The following JavaScript files are required to perform the upgrade: • allDbStats.js • tokumx_dump_indexes.js • psmdb_restore_indexes.js You can download those files from GitHub. Step 2 : Run the allDbStats.js script to record database state before migration: $ mongo ./allDbStats.js > ~/allDbStats.before.out Step 3 : Perform a dump

技术分享 | 使用 Perf 和火焰图分析软件

ぐ巨炮叔叔 提交于 2019-12-10 17:28:48
作者:Agustín 翻译:孟维克 原文: https://www.percona.com/blog/2019/11/20/profiling-software-using-perf-and-flame-graphs/ 在这篇博文中,我们将探讨如何一起使用perf和火焰图。它们用于生成我们选择的软件正在调用的函数的图形。在此我们使用Percona分支版本,但是它可以扩展到任何可以进行解析堆栈跟踪的软件。 在继续之前,请注意,与任何分析工具一样,除非您知道自己在做什么,否则不要在生产环境运行。 安装需要的软件包 为了简单,为使用CentOS7版本,但是对于基于Debian的发行版来说,它们应该是相同的(步骤中的唯一区别是用 apt-get install linux-tools-$(uname -r) 代替yum命令)。 安装perf SHELL> sudo yum install -y perf 获得火焰图软件包 SHELL> mkdir -p ~/src SHELL> cd ~/src SHELL> git clone https://github.com/brendangregg/FlameGraph 全部安装完毕!让我们继续 抓取采集样本 火焰图是一种可视化数据的方式,所以我们需要一些可以作为基础的样本。可以用三种方式做到这一点(请注意,这里我们使用 -p

Taking backup remotely using innobackupex

风格不统一 提交于 2019-12-09 03:05:05
问题 I am trying to take backup from a remote machine using innobackupex. ./innobackupex --host=<mysql_server> --user=<username> <backup_dir>. Its failing as it is unable to locate a directory in the server. (Errcode: 2 - No such file or directory) I am assuming it is searching for the directory in the local machine. Please let me know how can we run the backup remotely ? 回答1: I suspect you are confusing innobackupex with something like mysqldump . The former backs up the actual table files, while

MySQL can take more than an hour to start

岁酱吖の 提交于 2019-12-08 15:15:31
I have a mysql (Percona) 5.7 instance with over 1Million tables. When I start the database, it can take more than an hour to start. Errorlog doesn't show anything, but when I trace mysqld_safe, I found out that MySQL is getting a stat on every file in the DB. Any idea why this may happen? Also, please no suggestion to fix my schema, this is a blackbox. Thanks This turned out to be 2 issues (other than millions of tables)! When MySQL start, and a crash recovery is needed, as of 5.7.17, it needs to traverse your datadir to build it's dictionary. This will be lifted in future releases(8.0), as

pt-table-sync, Strange Issues regarding Hostname

寵の児 提交于 2019-12-08 12:48:15
问题 I am trying to run pt-table-sync to re-synchronise a MYSQL Master-Slave replication. I have two VPS Systems which are running Debian 5, and the replication is running without any issues. The problem I have is that when I run pt-table-sync on the MASTER server, it keeps failing to connect to the SLAVE server. I am running the following command: pt-table-sync --dry-run --sync-to-master h='ip of slave server',u='user',p='password' Which returns: Host 'my website address' is not allowed to

Is Percona backwards compatible with MySQL? The Ruby in Rails Case

我的梦境 提交于 2019-12-08 04:37:19
问题 I'm starting a Ruby on Rails project and I'm interested in using Percona as my DBMS. I've read that Percona is fully compatible with MySQL tooling I wonder if I can use Ruby on Rails tooling with Percona (using the MySQL support)? 回答1: As long as you have the mysql client libraries you should be able to build the mysql gem which is the interface rails (through active record) uses to interact with mysql. You may have to pass the percona mysql_config when building the gem like so: gem install