网站地图    收藏   

主页 > 后端 > mysql数据库 >

mysql生成表文件、truncate、Load - mysql数据库栏目

来源:自学PHP网    时间:2015-04-16 10:51 作者: 阅读:

[导读] SELECT -- 39; select * from ` 39;,TABLE_SCHEMA, 39;` ` 39;,TABLE_NAME, 39;` into outfile 39; 39; work opdir repair 39; 39; 39;-- concat( 39;union all -- select coun...

SELECT -- ' select *  from `',TABLE_SCHEMA,'`.`',TABLE_NAME,'` into outfile ''/work/opdir/repair'''
-- concat('union all 
-- select count(1) as count_, ''`',TABLE_SCHEMA,'`.`',TABLE_NAME, '`'' as tbname from `',TABLE_SCHEMA,'`.`',TABLE_NAME ,'`')
-- as sql_
CONCAT( ' select *  from `',TABLE_SCHEMA,'`.`',TABLE_NAME,'` into outfile ''/work/opdir/repair/',TABLE_SCHEMA,'.',TABLE_NAME,'.tsv'' ;
 truncate table ' ,TABLE_SCHEMA,'.',TABLE_NAME,' ;
 LOAD DATA   infile  ''/work/opdir/repair/',TABLE_SCHEMA,'.',TABLE_NAME,'.tsv'' INTO TABLE ',TABLE_SCHEMA,'.',TABLE_NAME,' CHARACTER SET utf8;
 
')
ExeSql
FROM information_schema.TABLES t 
WHERE t.TABLE_TYPE LIKE '%T%'
AND t.TABLE_SCHEMA IN
(
'BCReport_Sync'-- ,'AdConversions','AdSync','BCSourceData_Sync'
)
AND t.`TABLE_NAME` NOT LIKE '%Log%'
AND t.`TABLE_NAME` NOT LIKE '%bak%' 
AND t.`TABLE_NAME` NOT LIKE '%History%'
AND t.`TABLE_NAME` NOT LIKE '%Tmp_%'
AND t.`TABLE_NAME` NOT LIKE '%bak%'
AND t.`TABLE_NAME` NOT LIKE '%Monitor%'
AND t.`TABLE_NAME` NOT LIKE '%bak%'
AND t.`TABLE_NAME` NOT LIKE '%backup%'
AND t.`TABLE_NAME` NOT LIKE '%_BK'
AND t.`TABLE_NAME` NOT LIKE '%_Temp'

AND t.`TABLE_NAME` NOT LIKE '%2013%'

AND t.`TABLE_NAME` NOT LIKE '%2'
AND t.`TABLE_NAME` NOT LIKE '%2012%'
AND t.`TABLE_NAME` NOT LIKE '%2012%'
AND t.`TABLE_NAME` NOT LIKE '%2014%'

AND  CONCAT(t.TABLE_SCHEMA ,'.', t.`TABLE_NAME`) IN
('AdConversions.DataInbound_TaskSchedule'	,
'AdConversions.DeviceForComparison'	,
'AdConversions.Fact_Realtime_Conversion'	,
'AdDataCenter.Ad_Account_Mirror'	,
'AdDataCenter.Ad_Account'	,
'AdDataCenter.Ad_AdGroup_AdAction_Mobisage'	,
'AdDataCenter.Ad_AdGroup_BidPrice'	,
'AdDataCenter.Ad_AdGroup_Property'	,
'AdDataCenter.Ad_AdGroup_WeekTimePeriod'	,
'AdDataCenter.Ad_AdGroup'	,
'AdDataCenter.Ad_Campaign_BudgetList'	,
'AdDataCenter.Ad_Campaign_DockingProduct_Mapping'	,
'AdDataCenter.Ad_Campaign_GeoTargeting'	,
'AdDataCenter.Ad_Campaign'	,
'AdDataCenter.Ad_Creative_Additional'	,
'AdDataCenter.Ad_Creative_ImageAd'	,
'AdDataCenter.Ad_Creative_Offerwall'	,
'AdDataCenter.Ad_Creative_Template'	,
'AdDataCenter.Ad_Creative'	,
'AdDataCenter.Ad_Targeting_Mobisage_AppIncluded'	,
'AdDataCenter.Ad_Targeting_Mobisage'	,
'AdDataCenter.Ad_Targeting'	,
'AdDataCenter.AdCreativeTemplate_SlotSize_Mapping'	,
'AdDataCenter.AdSync_AdCreative'	,
'AdDataCenter.App_MediaType_Mapping'	,
'AdDataCenter.AppOfferwall_Category_Mapping'	,
'AdDataCenter.Bill_AdAccount_Recharge_Daily'	,
'AdDataCenter.Bill_AdAccount_Spend_Daily'	,
'AdDataCenter.Dim_App'	,
'AdDataCenter.Dim_Slot'	,
'AdDataCenter.Docking_Product'	,
'AdDataCenter.Offerwall_AppBuckleScale_Mapping'	,
'AdDataCenter.Plugin_AdGroup'	,
'AdDataCenter.Slot_Affiliate_Business_Ratio'	,
'AdSync.Ad_Campaign_RealtimeControl'	,
'BCSourceData_Sync.Data_TaskSchedule'	,
'BCSourceData_Sync.Source_Fact_AccountHourlySpend'	,
'BCSourceData_Sync.Source_Fact_AdCreative_App_Usage_ThirdPartPlatform'	)

自学PHP网专注网站建设学习,PHP程序学习,平面设计学习,以及操作系统学习

京ICP备14009008号-1@版权所有www.zixuephp.com

网站声明:本站所有视频,教程都由网友上传,站长收集和分享给大家学习使用,如由牵扯版权问题请联系站长邮箱904561283@qq.com

添加评论