Új hozzászólás Aktív témák

  • kem

    addikt

    Sziasztok!

    Meg mindig nem vagyok valami nagy DBA de ugy tunik a jelenlegi feladatom kicsit segiteni fog ebben :) RDS MySQL 5.6-ot frissitunk 5.7-re, es az Amazon szerint az uzemkiesest drasztikusan le lehet csokkenteni ha a kovetkezo alteraciot vegigtolom az adatbazisokon. A gond csak annyi, hogy nekem ez nagyon magas. Ha valaki csinalta mar vagy erti mirol van szo es nem banja kifejthetne nekem :) Elore is koszonom a valaszokat!

    Upgrades to MySQL Version 5.7 Might Be Slow:
    MySQL version 5.6.4 introduced a new date and time format for the datetime, time, and timestamp columns that allows fractional components in date and time values. When upgrading a DB instance to MySQL version 5.7, MySQL forces the conversion of all date and time column types to the new format.

    ...
    To find all tables in your database that have datetime, time, or timestamp columns and create an ALTER TABLE <table_name> FORCE; command for each table, use the following query.

    Query:
    SELECT DISTINCT CONCAT('ALTER TABLE `',
    REPLACE(is_tables.TABLE_SCHEMA, '`', '``'), '`.`',
    REPLACE(is_tables.TABLE_NAME, '`', '``'), '` FORCE;')
    FROM information_schema.TABLES is_tables
    INNER JOIN information_schema.COLUMNS col ON col.TABLE_SCHEMA = is_tables.TABLE_SCHEMA
    AND col.TABLE_NAME = is_tables.TABLE_NAME
    LEFT OUTER JOIN information_schema.INNODB_SYS_TABLES systables ON
    SUBSTRING_INDEX(systables.NAME, '#', 1) = CONCAT(is_tables.TABLE_SCHEMA,'/',is_tables.TABLE_NAME)
    LEFT OUTER JOIN information_schema.INNODB_SYS_COLUMNS syscolumns ON
    syscolumns.TABLE_ID = systables.TABLE_ID AND syscolumns.NAME = col.COLUMN_NAME
    WHERE col.COLUMN_TYPE IN ('time','timestamp','datetime')
    AND is_tables.TABLE_TYPE = 'BASE TABLE'
    AND is_tables.TABLE_SCHEMA NOT IN ('mysql','information_schema','performance_schema')
    AND (is_tables.ENGINE = 'InnoDB' AND syscolumns.MTYPE = 6);

    Forras

    :R :R :R

Új hozzászólás Aktív témák