文章列表
把从Oracle数据库导出的数据导入到MySql数据库中1. 使用默认的结束符号导入到MySql数据库中:
LOAD DATA LOCAL INFILE 'd:\oracle.txt' IGNORE INTO TABLE alarmLog
此时Fields的结束符默认的就是'\t'制表符,而不是"\t"字符串.2. 当设定Fields结束符导入到MySql数据库中:
LOAD DATA LOCAL INFILE 'd:\oraclea.txt' IGNORE INTO TABLE alarmLog FIELDS TERMINATED BY '~'
以上两种情况使用的数据 ...
- 2009-03-04 00:58
- 浏览 1277
- 评论(0)
1. Log tableIF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[HotelOrder_OrderStatus_Log]') AND type in (N'U')) BEGIN CREATE TABLE [dbo].[HotelOrder_OrderStatus_Log]( [OrderStatusLogID] [int] IDENTITY(1,1) NOT NULL, [AppName] [nvarchar](50) NOT NULL, ...
- 2009-03-04 00:22
- 浏览 1007
- 评论(0)
/* --1---Create table---- */create table Sync_Table([id] [int] IDENTITY(1,1) NOT FOR REPLICATION NOT NULL,[Table_Name] [varchar](100) COLLATE Chinese_PRC_CI_AS NULL,CONSTRAINT [PK_Sync_Table] PRIMARY KEY CLUSTERED( [id] ASC)WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY]) ON [PRIMARY]
/* --2---Insert data ...
- 2009-03-03 00:23
- 浏览 867
- 评论(0)
MySQL Performance BlogPar example, on vais creater une table pour noter le traffic de l'Internet, il y a une table avec le traffic et le numero de package de le port et l'IP de address.la table comme:Create Table: CREATE TABLE `ipstat` ( `ip` int(10) unsigned NOT NULL, `hits` int(10) unsigned NOT N ...
- 2009-02-26 19:45
- 浏览 1088
- 评论(0)
--方法1查询表改为动态select * from sysobjects exec('select ID,Name from sysobjects') exec sp_executesql N'select ID,Name from sysobjects'--多了一个N为unicode
--方法2:字段名,表名,数据库名之类作为变量时,用动态SQL declare @FName varchar(20) set @FName='ID' exec('select '+@FName+' from sysobjects where '+@FName+'=5' ) declare @s varchar( ...
- 2009-02-25 00:41
- 浏览 2215
- 评论(0)
DECLARE @rows_per_page AS INTEGERDECLARE @current_page AS INTEGERDECLARE @total_pages AS INTEGERDECLARE @start_item AS INTEGERDECLARE @items_count AS INTEGER-- 设置每页的行数SET @rows_per_page = 10-- 设置要显示的页号(从1开始)SET @current_page = 3SELECT @total_pages = COUNT(*) / @rows_per_page + 1,@items_count= COUNT(* ...
- 2009-02-25 00:31
- 浏览 2886
- 评论(0)
use profiler to capture a server status for 24 hrs, the result stored into table Conn_AdminIII_2009_02_100. create indexCreate index idx_starttime on Conn_AdminIII_2009_02_10(starttime)
1.SQL query:select * from Conn_AdminIII_2009_02_10 where starttime between '2009-02-20 00:00:05.680' and '2009-02-2 ...
- 2009-02-25 00:29
- 浏览 911
- 评论(0)
This script is actually another slow log detector, but it will also send mail instead of writing logs only.
1. monitor MySQL, if the connection >= 30 then call the sendmail function---------------------------------------------------------$ more master_mysql_monitor.sh
#!/bin/shflag=30 //more than ...
- 2009-01-19 22:18
- 浏览 1303
- 评论(0)
c:\ mstsc /v:Server IP /admin // on local
c:\ tsadmin.exe // on target server, to kill some session, then reconnect by Remote Desktop
You have to cp tsadmin.exe from windows 2003's system32 to XPRef:http://thebackroomtech.com/2008/04/09/howto-remotely-disconnect-a-terminal-services-session/
- 2009-01-08 21:22
- 浏览 805
- 评论(0)
This StoredProcedure is using master.sys.xp_dirtree and master.sys.xp_create_subdir USE Master;GOSET NOCOUNT ON-- 1 - Variable declaration
- 2009-01-06 19:53
- 浏览 760
- 评论(0)
select job_name, run_datetime,SUBSTRING(run_duration, 1, 2) + ':'
- 2009-01-05 01:37
- 浏览 1055
- 评论(0)
**Index is slowing down the selecting actions **
Description the problem:
Table size 30G, Ram size 16G
mysql> select * from program_access_log where program_id between 1 and 4000;
very slow
Try to select the top 500,000 records:
mysql> select * from program_access_log where id between 1 and ...
- 2008-12-25 23:27
- 浏览 695
- 评论(0)
CREATE TABLE [DatabaseLog] (ID INT PRIMARY KEY IDENTITY(1,1),Command NVARCHAR(1000),PostTime NVARCHAR(24),[Event] NVARCHAR(100),[Schema] NVARCHAR(100),LoginName NVARCHAR(100),XmlEvent xml,[object] NVARCHAR(100),[login] NVARCHAR(100),hostname NVARCHAR(100),spid NVARCHAR(24))CREATE TRIGGER [ddlDatabase ...
- 2008-12-23 00:19
- 浏览 814
- 评论(0)
1. Delete all tables DECLARE @tablename varchar(50)DECLARE @truncatesql varchar(255)DECLARE TrCun_Cursor CURSOR FORselect [name] from sysobjects where type = 'U'-- or select [name] from sysobjects where type = 'U' and name 'table_you_do_NOT_want_to_delete'
OPEN TrCun_CursorFETCH TrCun_Cursor INTO @ ...
- 2008-12-23 00:19
- 浏览 933
- 评论(0)