Skip to content

Instantly share code, notes, and snippets.

@realmgic
realmgic / split_device_op
Created November 29, 2019 13:24
Evenly divide a device into partitions, include dlog allocation (optional) and over provisioning (optional and sometimes recommended)
function split_device_op {
if [[ $# -lt 2 ]] ; then
echo 'Evenly divide a device into partitions'
echo 'Usage: split_device_op device_to_part num_data_part [dlog_size] [op_size]'
echo 'dlog_size - digest log partition size in GiB, defaults to 0'
echo 'op_size - Over-provision size in GiB, defaults to 0'
echo 'example: split_device_op .dev/nvme0n1 5 100 1400'
return 1
fi
use doag;
set autocommit=0;
drop table if exists quotes;
create table quotes
( id int unsigned auto_increment primary key
, author varchar(64) , quote varchar(4000)
, source varchar(64)
use sys; -- or sys.
--
select * from sys.version;
show full tables in sys;
-- summary views
select * From sys.host_summary\G
use doag
drop TABLE employees;
drop table employees_old;
CREATE TABLE employees_old
(id NUMERIC,
first_name varchar(20),
last_name varchar(20),
user_id varchar(20),
job_title varchar(20)