Guest User

Untitled

a guest
Jan 17th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.41 KB | None | 0 0
  1. -- Setting Global format Barracuda for UTF8mb4
  2. --SET @@GLOBAL.innodb_file_format = 'Barracuda';
  3.  
  4. SET GLOBAL innodb_file_format=Barracuda;
  5. SET GLOBAL innodb_file_format_max = "Barracuda";
  6. SET GLOBAL innodb_file_per_table=1;
  7. SET GLOBAL innodb_large_prefix=1; -- optional (if you also need wide indexes)
  8. SET GLOBAL innodb_strict_mode = "ON";
  9.  
  10.  
  11. -- IF USE LARAVEL, ADD LINES ON config/databases.php
  12. -- MySQL
  13. -- 'engine' => null
  14. -- ||
  15. -- \/
  16. -- 'engine' => 'InnoDB ROW_FORMAT=DYNAMIC',
  17.  
  18.  
  19. ---------------------------------------
  20. -- EXPLAIN ABOUT FORMAT TO BARRACUDA --
  21. ---------------------------------------
  22.  
  23. -- Show version MariaDB / MySQL
  24. SELECT version();
  25. -- +------------+
  26. -- | version() |
  27. -- +------------+
  28. -- | 5.5.21-log |
  29. -- +------------+
  30. -- 1 row in set (0.00 sec)
  31.  
  32.  
  33. -- verify current setting engine DB
  34. SHOW variables like "%innodb_file%";
  35. -- +--------------------------+----------+
  36. -- | Variable_name | Value |
  37. -- +--------------------------+----------+
  38. -- | innodb_file_format | Antelope |
  39. -- | innodb_file_format_check | ON |
  40. -- | innodb_file_format_max | Antelope |
  41. -- | innodb_file_per_table | ON |
  42. -- +--------------------------+----------+
  43. -- 4 rows in set (0.00 sec)
  44.  
  45.  
  46. ---------------------------
  47. -- SETTINGS TO BARRACUDA --
  48. ---------------------------
  49.  
  50. -- SET GLOBAL INNODB FILE FORMAT BARRACUDA
  51. SET GLOBAL innodb_file_format = barracuda;
  52. -- Query OK, 0 rows affected (0.00 sec)
  53.  
  54. -- Verify current setting engine DB
  55. SHOW variables like "%innodb_file%";
  56. -- +--------------------------+-----------+
  57. -- | Variable_name | Value |
  58. -- +--------------------------+-----------+
  59. -- | innodb_file_format | Barracuda |
  60. -- | innodb_file_format_check | ON |
  61. -- | innodb_file_format_max | Antelope |
  62. -- | innodb_file_per_table | ON |
  63. -- +--------------------------+-----------+
  64. -- 4 rows in set (0.00 sec)
  65.  
  66. -- SET GLOBAL INNODB FILE FORMAT MAX BARRACUDA
  67. SET GLOBAL innodb_file_format_max = barracuda;
  68. -- Query OK, 0 rows affected (0.00 sec)
  69.  
  70. -- Verify current setting engine DB
  71. SHOW variables like "%innodb_file%";
  72. -- +--------------------------+-----------+
  73. -- | Variable_name | Value |
  74. -- +--------------------------+-----------+
  75. -- | innodb_file_format | Barracuda |
  76. -- | innodb_file_format_check | ON |
  77. -- | innodb_file_format_max | Barracuda |
  78. -- | innodb_file_per_table | ON |
  79. -- +--------------------------+-----------+
  80. -- 4 rows in set (0.00 sec)
  81. --
  82. -- I had observed a single line logged in Error Log file :
  83. --
  84. -- [root@dhcppc0 Desktop]# tail -1 /usr/local/mysql/data/dhcppc0.err
  85. -- 120402 11:26:52 [Info] InnoDB: the file format in the system tablespace is
  86. -- now set to Barracuda.
  87. --
  88. -- After switching to barracuda file format, I could also access my Database
  89. -- and tables without any error :
  90.  
  91. --------------------
  92. -- SHOW DATABASES --
  93. --------------------
  94.  
  95. SHOW DATABASES;
  96. -- +--------------------+
  97. -- | Database |
  98. -- +--------------------+
  99. -- | information_schema |
  100. -- | mysql |
  101. -- | opentaps1 |
  102. -- | performance_schema |
  103. -- | test |
  104. -- +--------------------+
  105. -- 5 rows in set (0.00 sec)
  106.  
  107. USE opentaps1;
  108.  
  109. -- Database changed
  110.  
  111. SELECT COUNT(*) FROM product;
  112.  
  113. -- +----------+
  114. -- | count(*) |
  115. -- +----------+
  116. -- | 3244 |
  117. -- +----------+
  118. -- 1 row in set (0.42 sec)
  119.  
  120. SHOW engines;
  121.  
  122. -- +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
  123. -- | Engine | Support | Comment | Transactions | XA | Savepoints |
  124. -- +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
  125. -- | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
  126. -- | CSV | YES | CSV storage engine | NO | NO | NO |
  127. -- | MyISAM | YES | MyISAM storage engine | NO | NO | NO |
  128. -- | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO |
  129. -- | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
  130. -- | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
  131. -- | ARCHIVE | YES | Archive storage engine | NO | NO | NO |
  132. -- | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
  133. -- | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL |
  134. -- +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+
  135. -- 9 rows in set (0.00 sec)
  136.  
  137. SHOW engine innodb status\G
  138.  
  139. -- *************************** 1. row ***************************
  140. -- Type: InnoDB
  141. -- Name:
  142. -- Status:
  143. -- =====================================
  144. -- 120402 11:36:29 INNODB MONITOR OUTPUT
  145. -- =====================================
  146. -- Per second averages calculated from the last 18446744073709534037 seconds
  147. -- -----------------
  148. -- BACKGROUND THREAD
  149. -- -----------------
  150. -- srv_master_thread loops: 12 1_second, 12 sleeps, 1 10_second, 2 background,
  151. -- 2 flush
  152. -- srv_master_thread log flush and writes: 12
  153. -- ----------
  154. -- SEMAPHORES
  155. -- ----------
  156. -- OS WAIT ARRAY INFO: reservation count 5, signal count 5
  157. -- Mutex spin waits 2, rounds 60, OS waits 2
  158. -- RW-shared spins 3, rounds 90, OS waits 3
  159. -- RW-excl spins 0, rounds 0, OS waits 0
  160. -- Spin rounds per wait: 30.00 mutex, 30.00 RW-shared, 0.00 RW-excl
  161. -- ------------
  162. -- TRANSACTIONS
  163. -- ------------
  164. -- Trx id counter F01
  165. -- Purge done for trx's n:o < 0 undo n:o < 0
  166. -- History list length 0
  167. -- LIST OF TRANSACTIONS FOR EACH SESSION:
  168. -- ---TRANSACTION F00, not started
  169. -- MySQL thread id 1, OS thread handle 0x7f38309f9710, query id 28 localhost
  170. -- root
  171. -- show engine innodb status
  172. -- --------
  173. -- FILE I/O
  174. -- --------
  175. -- I/O thread 0 state: waiting for completed aio requests (insert buffer
  176. -- thread)
  177. -- I/O thread 1 state: waiting for completed aio requests (log thread)
  178. -- I/O thread 2 state: waiting for completed aio requests (read thread)
  179. -- I/O thread 3 state: waiting for completed aio requests (read thread)
  180. -- I/O thread 4 state: waiting for completed aio requests (read thread)
  181. -- I/O thread 5 state: waiting for completed aio requests (read thread)
  182. -- I/O thread 6 state: waiting for completed aio requests (write thread)
  183. -- I/O thread 7 state: waiting for completed aio requests (write thread)
  184. -- I/O thread 8 state: waiting for completed aio requests (write thread)
  185. -- I/O thread 9 state: waiting for completed aio requests (write thread)
  186. -- Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
  187. -- ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
  188. -- Pending flushes (fsync) log: 0; buffer pool: 0
  189. -- 554 OS file reads, 7 OS file writes, 7 OS fsyncs
  190. -- -0.01 reads/s, 16384 avg bytes/read, -0.00 writes/s, -0.00 fsyncs/s
  191. -- -------------------------------------
  192. -- INSERT BUFFER AND ADAPTIVE HASH INDEX
  193. -- -------------------------------------
  194. -- Ibuf: size 1, free list len 0, seg size 2, 0 merges
  195. -- merged operations:
  196. -- insert 0, delete mark 0, delete 0
  197. -- discarded operations:
  198. -- insert 0, delete mark 0, delete 0
  199. -- Hash table size 276707, node heap has 15 buffer(s)
  200. -- -0.15 hash searches/s, -0.12 non-hash searches/s
  201. -- ---
  202. -- LOG
  203. -- ---
  204. -- Log sequence number 221536390
  205. -- Log flushed up to 221536390
  206. -- Last checkpoint at 221536390
  207. -- 0 pending log writes, 0 pending chkp writes
  208. -- 10 log i/o's done, -0.00 log i/o's/second
  209. -- ----------------------
  210. -- BUFFER POOL AND MEMORY
  211. -- ----------------------
  212. -- Total memory allocated 137363456; in additional pool allocated 0
  213. -- Dictionary memory allocated 3476070
  214. -- Buffer pool size 8192
  215. -- Free buffers 7635
  216. -- Database pages 542
  217. -- Old database pages 220
  218. -- Modified db pages 0
  219. -- Pending reads 0
  220. -- Pending writes: LRU 0, flush list 0, single page 0
  221. -- Pages made young 0, not young 0
  222. -- -0.00 youngs/s, -0.00 non-youngs/s
  223. -- Pages read 542, created 0, written 1
  224. -- -0.01 reads/s, -0.00 creates/s, -0.00 writes/s
  225. -- Buffer pool hit rate 980 / 1000, young-making rate 0 / 1000 not 0 / 1000
  226. -- Pages read ahead -0.00/s, evicted without access -0.00/s, Random read ahead
  227. -- -0.00/s
  228. -- LRU len: 542, unzip_LRU len: 0
  229. -- I/O sum[0]:cur[238], unzip sum[0]:cur[0]
  230. -- --------------
  231. -- ROW OPERATIONS
  232. -- --------------
  233. -- 0 queries inside InnoDB, 0 queries in queue
  234. -- 1 read views open inside InnoDB
  235. -- Main thread process no. 2937, id 139879303665424, state: waiting for server
  236. -- activity
  237. -- Number of rows inserted 0, updated 0, deleted 0, read 3244
  238. -- -0.00 inserts/s, -0.00 updates/s, -0.00 deletes/s, -0.18 reads/s
  239. -- ----------------------------
  240. -- END OF INNODB MONITOR OUTPUT
  241. -- ============================
  242. -- 1 row in set (0.00 sec)
  243. -- a
  244.  
  245. -- Setting change format on table
  246. ALTER TABLE <table_name> ROW_FORMAT=DYNAMIC;
  247.  
  248. -- Convertir formato barracuda TODAS TABLAS
  249. USE INFORMATION_SCHEMA;
  250. SELECT CONCAT("ALTER TABLE `", TABLE_SCHEMA,"`.`", TABLE_NAME, "` ROW_FORMAT=DYNAMIC;") AS MySQLCMD FROM TABLES WHERE ENGINE='innodb' AND ROW_FORMAT != 'DYNAMIC' AND ROW_FORMAT !='COMPRESSED';
Add Comment
Please, Sign In to add comment