DataBase
mysql backup
usage
#mysqldump [options] db_name [tables]
#mysqldump [options] –databases db_name1 [db_name2 db_name3...]
#mysqldump [options] –all-databases
Example
#mysqldump -u root -p mydatabase > db.sql
Specific table
#mysqldump -u root -p mydatabase -tables customer > db.sql
How to restore database
#mysql -u root -p database < db.sql
If want to restore to specific database
mysql -u root -pMyPassword MyDatabase < db.sql
MYSQL limit Optimization-2
The MYSQL optimization is very important. Other most commonly used also most need to optimize are limit. mysql limit has brought enormous convenient to the paging, but the data quantity one is big, the limit performance suddenly drops.
Similarly takes 10 data
select * from temp limit 10000,10
and
select * from temp limit 0,10
It is not a quantity rank.
Now [...]
MYSQL limit Optimization
select * from table LIMIT 5,10; #return to 6-15th line
select * from table LIMIT 5; #return to 0-5 line
select * from table LIMIT 0,5; #return to 0-5 line
Performance optimization:
In MySQL5.0 limit high performance.
1.
Select * From cyclopedia Where ID>=(
Select Max(ID) From (
Select ID From cyclopedia Order By ID limit 90001
) As tmp
) limit 100;
2.
Select * From [...]
Oracle class - PHP
<?php
class DB_Sql {
var $Debug = false;
var $Home = “/u01/app/oracle/ora90″;
var $Remote = 1;
/**
* http://www.easemarry.com/blog
* This Query will be sent directly after the first connection
* Example:
* var $ConnectQuery=”ALTER SESSION SET nls_date_language=german nls_date_format=’DD.MM.RRRR’”;
* -> Set the date format for this session, this is fine when your ora-role
* cannot be altered
*/
var $ConnectQuery=”;
/**
[...]
