Posts tagged: database

PMB database configuration and tunning my.ini MySQL

my.ini

IOF>>

# CLIENT SECTION
# ———————————————————————-
#
# The following options will be read by MySQL client applications.
# Note that only client applications shipped by MySQL are guaranteed
# to read this section. If you want your own MySQL client program to
# honor these values, you need to specify it as an option during the
# MySQL client library initialization.
#
[client]

port=3306

[mysql]

default-character-set=utf8
# SERVER SECTION
# ———————————————————————-
#
# The following options will be read by the MySQL Server. Make sure that
# you have installed the server correctly (see above) so it reads this
# file.
#
[mysqld]

# The TCP/IP Port the MySQL Server will listen on
port=3306
#Path to installation directory. All paths are usually resolved relative to this.
basedir=”D:/MySQL_BIN/”

#Path to the database root
datadir=”D:/MySQL_DATA/Data/”

#Log the slow queries
log-slow-queries = “D:/MySQL_LOG/lowqueries.log”
#log-bin = “D:/MySQL_LOG/bin.log”
log-error = “D:/MySQL_LOG/error.log”
#log = “D:/MySQL_LOG/log.log”
#Query cache (KB)
query_alloc_block_size = 8192
query_cache_limit = 1048576
query_cache_min_res_unit = 4096
query_cache_size = 49999872
query_cache_type = 1
query_cache_wlock_invalidate = 0
query_prealloc_size = 8192

#Parameters changed by recommendations sqltuner
join-buffer-size = 256K
tmp-table-size = 90M
max-heap-table-size = 90M
thread-cache-size = 4
innodb-buffer-pool-size = 4M

#Parameters changed by recommendarions PMB
max_allowed_packet = 16M

<<EOF

PMB OPAC MySQL database configuration files db_param.inc.php opac_db_param.inc.php

./includes/db_param.inc.php

IOF>>
switch(LOCATION):
case ‘remote’: // mettre ici les valeurs pour l’accés distant
define(‘SQL_SERVER’, ‘remote’);  // nom du serveur . exemple : http://sql.free.fr
define(‘USER_NAME’, ‘username’); // nom utilisateur
define(‘USER_PASS’, ‘userpwd’);  // mot de passe
define(‘DATA_BASE’, ‘dbname’);  // nom base de données
define(‘SQL_TYPE’,  ‘mysql’);  // Type de serveur de base de données
break;
default:  // valeurs pour l’accès local
define(‘SQL_SERVER’, ‘sek-sql-server.simonalsa.com:3306′); // nom du serveur
define(‘USER_NAME’, ‘biblio_pmb’);  // nom utilisateur
define(‘USER_PASS’, password’);  // mot de passe
define(‘DATA_BASE’, ‘biblio’); // nom base de données
define(‘SQL_TYPE’,  ‘mysql’);   // Type de serveur de base de données
break;
endswitch;
<<EOF
./opac_css/includes/opac_db_param.inc.php

IOF>>

switch(LOCATION):
case ‘remote’: // mettre ici les valeurs pour l’accés distant
define(‘SQL_SERVER’, ‘remote’);  // nom du serveur . exemple : http://sql.free.fr
define(‘USER_NAME’, ‘username’); // nom utilisateur
define(‘USER_PASS’, ‘userpwd’);  // mot de passe
define(‘DATA_BASE’, ‘dbname’);  // nom base de données
define(‘SQL_TYPE’,  ‘mysql’);  // Type de serveur de base de données
break;
default:  // valeurs pour l’accès local
define(‘SQL_SERVER’, ‘sek-sql-server.simonalsa.com:3306′); // nom du serveur
define(‘USER_NAME’, ‘biblio_pmb’);  // nom utilisateur
define(‘USER_PASS’, password’);  // mot de passe
define(‘DATA_BASE’, ‘biblio’); // nom base de données
define(‘SQL_TYPE’,  ‘mysql’);   // Type de serveur de base de données
break;
endswitch;

<<EOF

Simple MySQL server backup DATABASE batch

IOF>>
@ECHO OFF
SET SUSER=backup_www
SET SPASSWD=XXXXXX
rem date?
FOR /F “TOKENS=2-4 DELIMS=/ ” %%A IN (‘DATE /T’) DO (SET date=%%B%%A%%C)
rem db? filename?
SET db=dbname
SET filename_db=%db%_db_%date%.bak
del F:\BACKUP\server.domain\MySQL\%filename_db%.rar
mysqldump -u %SUSER% -p%SPASSWD% –complete-insert –default-character-set=utf8 %db% > F:\Backup\MySQL\%filename%
rar a -m3 -v1G -vn F:\BACKUP\server.domain\MySQL\%filename_db%.rar F:\BACKUP\server.domain\MySQL\%filename_db%
del F:\BACKUP\server.domain\MySQL\%filename_db%
<<EOF

Magento local.xml database configuration file

Magento database configuration file: /var/www/www.simonalsa.com/htdocs/app/etc/local.xml

 
<config>
    <global>
        <install>
            <date><![CDATA[Tue, 02 Mar 2010 18:20:15 +0000]]></date>
        </install>
        <crypt>
            <key><![CDATA[key]]></key>
        </crypt>
        <disable_local_modules>false</disable_local_modules>
        <resources>
            <db>
                <table_prefix><![CDATA[]]></table_prefix>
            </db>
            <default_setup>
                <connection>
                    <host><![CDATA[database.server.com]]></host>
                    <username><![CDATA[user]]></username>
                    <password><![CDATA[password]]></password>
                    <dbname><![CDATA[database]]></dbname>
                    <active>1</active>
                </connection>
            </default_setup>
        </resources>
        <session_save><![CDATA[files]]></session_save>
    </global>
    <admin>
        <routers>
            <adminhtml>
                <args>
                    <frontName><![CDATA[admin]]></frontName>
                </args>
            </adminhtml>
        </routers>
    </admin>
</config>

If you are using cache mode into your Magento server application you must reload the cache of the config files from the Magento Server Administration to apply the new configuration.

Simple Microsoft MsSQL server backup DATABASE & LOG batch

IOF>>

@ECHO OFF
SET SUSER=backup_www
SET SPASSWD=XXXXXX

rem date?
FOR /F “TOKENS=2-4 DELIMS=/ ” %%A IN (‘DATE /T’) DO (SET date=%%B%%A%%C)

rem db? filename?

SET db=dbname

SET filename_db=%db%_db_%date%.bak

SET filename_log=%db%_log_%date%.bak

del F:\BACKUP\server.domain\MSSQL\%filename_db%.rar

del F:\BACKUP\server.domain\MSSQL\%filename_log%.rar

OSQL -U%SUSER% -P%SPASSWD% -D server.domain -n -Q “BACKUP DATABASE [dbname] TO DISK = ‘\\machine.domain\F$\BACKUP\server.domain\MSSQL\%filename_db%’”

rar a -m3 -v1G -vn F:\BACKUP\server.domain\MSSQL\%filename_db%.rar F:\BACKUP\server.domain\MSSQL\%filename_db%
del F:\BACKUP\server.domain\MSSQL\%filename_db%

OSQL -U%SUSER% -P%SPASSWD% -D server.domain -n -Q “BACKUP LOG [dbname] TO DISK = ‘\\machine.domain\F$\BACKUP\server.domain\MSSQL\%filename_log%’”

rar a -m3 -v1G -vn F:\BACKUP\server.domain\MSSQL\%filename_log%.rar F:\BACKUP\server.domain\MSSQL\%filename_log%
del F:\BACKUP\server.domain\MSSQL\%filename_log%

Backup Microsoft SCVMM database to file

BackupVMMDatabase.bat

IOF>>

ECHO OFF

rem date?
FOR /F “TOKENS=2-4 DELIMS=/ ” %%A IN (‘DATE /T’) DO (SET date=%%B%%A%%C)

rem db? filename?

SET file=BackupVMMDatabase
SET filename=%file%_%date%.bak

del /Q D:\BACKUP\VMM_DATABASE\%filename%.rar

del /Q D:\BACKUP\TEMP\*.*

rmdir D:\BACKUP\TEMP

mkdir D:\BACKUP\TEMP

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -PSConsoleFile D:\BACKUP\BIN\Consola.psc1 -command “. ‘D:\BACKUP\BIN\BackupVMMDatabase.ps1′”

rar_64bits a -ao -ow -m4 -mt4 -rr -rv -v1G -vn -t D:\BACKUP\VMM_DATABASE\%filename%.rar D:\BACKUP\TEMP

del /Q D:\BACKUP\TEMP\*.*

rmdir D:\BACKUP\TEMP

<<EOF

Consola.psc1

IOF>>

<?xml version=”1.0″ encoding=”utf-8″?>
<PSConsoleFile ConsoleSchemaVersion=”1.0″>
  <PSVersion>1.0</PSVersion>
  <PSSnapIns>
    <PSSnapIn Name=”Microsoft.SystemCenter.VirtualMachineManager” />
  </PSSnapIns>
</PSConsoleFile>

<<EOF

BackupVMMDatabase.ps1

IOF>>

# Description: Backs up the VMM database.

# Specify the VMM server and domain.
$VMMServer = Get-VMMServer -ComputerName “sek-wmm-02.grupo.sek”

# Specify the backup folder path and name. To back
# up a database to a network share, specify the UNC
# path, for example, \\SQLServer01\VMMBackups.

Backup-VMMServer –Path “D:\BACKUP\TEMP” -VMMServer $VMMServer

<<EOF

Trend Micro IWSS 3.1 database (init script, sqls and bin files)

From the command line execute

cmd> InitDb.bat [sa] password MSSQL

This tools is saved in the installation disk. For example: C:\IWSS 3.1\iwss_31_win_b1158\Disk1

Trend Micro IWSS 3.1 database (init script, sqls and bin files)

WordPress Themes