问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

高并发下数据库插入重复数据,有什么好方法

发布网友 发布时间:2022-04-07 23:26

我来回答

2个回答

懂视网 时间:2022-04-08 03:47

> backup database format =‘/home/oracle/arch/dbbak_%U‘ plus archivelog;

2.修改监听文件,静态注册监听

SID_LIST_LISTENER =
 (SID_LIST =
 (SID_DESC =
  (GLOBAL_DBNAME = testdb)
  (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1/)
 (SID_NAME =testdb)
 )
 (SID_DESC =
  (GLOBAL_DBNAME = dupdb)
  (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1/)
  (SID_NAME =dupdb)
 )
 )

3.修改tnsnames.ora文件

DBTEST =
 (DESCRIPTION =
 (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = testdb)(PORT = 1521))
 )
  (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = dbtest)
  )
 )
 
DUPDB =
 (DESCRIPTION =
 (ADDRESS_LIST =
  (ADDRESS = (PROTOCOL = TCP)(HOST = testdb)(PORT = 1521))
 )
 (CONNECT_DATA =
  (SERVER = DEDICATED)
  (SERVICE_NAME = dupdb)
 )
 )

4.为duplicate 数据库创建参数文件initdupdb.ora

db_name=dupdb
db_block_size=8192
compatible=11.2.0.4.0
remote_login_passwordfile=exclusive
control_files=(‘/u01/app/oracle/oradata/dupdb/control01.ctl‘,‘/u01/app/oracle/oradata/dupdb/control02.ctl‘)
db_file_name_convert=(‘/u01/app/oracle/oradata/dbtest‘,‘/u01/app/oracle/oradata/dupdb‘)
log_file_name_covert=(‘/u01/app/oracle/oradata/dbtest‘,‘/u01/app/oracle/oradata/dupdb‘)

#其他参数是可选的

5.启动auxiliary database(duplicate database)

$ export ORACLE_SID=dupdb
$ sqlplus /nolog
SQL> connect /as sysdba
SQL> startup nomount pfile=‘/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initdupdb.ora‘
ORACLE instance started.

Total System Global Area 317370368 bytes
Fixed Size   2252784 bytes
Variable Size  260046864 bytes
Database Buffers  50331648 bytes
Redo Buffers  4739072 bytes
SQL> 

6.启动rman

$ export ORACLE_SID=dupdb
$ rman 

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Jun 25 07:52:09 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

RMAN> connect target sys/system1@dbtest

connected to target database: DBTEST (DBID=1275290034)

RMAN> connect auxiliary /

connected to auxiliary database: DUPDB (not mounted)

RMAN> 

7.启动duplicate database操作

RMAN> duplicate target database to dupdb;

以下为duplicate命令的执行结果:

RMAN> duplicate target database to dupdb;

Starting Duplicate Db at 25-JUN-2015 08:18:24
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=396 device type=DISK

contents of Memory Script:
{
 sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
 shutdown clone immediate;
 startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 321548288 bytes

Fixed Size   2252824 bytes
Variable Size  264245224 bytes
Database Buffers  50331648 bytes
Redo Buffers   4718592 bytes

contents of Memory Script:
{
 sql clone "alter system set db_name = 
 ‘‘DBTEST‘‘ comment=
 ‘‘Modified by RMAN duplicate‘‘ scope=spfile";
 sql clone "alter system set db_unique_name = 
 ‘‘DUPDB‘‘ comment=
 ‘‘Modified by RMAN duplicate‘‘ scope=spfile";
 shutdown clone immediate;
 startup clone force nomount
 restore clone primary controlfile;
 alter clone database mount;
}
executing Memory Script

sql statement: alter system set db_name = ‘‘DBTEST‘‘ comment= ‘‘Modified by RMAN duplicate‘‘ scope=spfile

sql statement: alter system set db_unique_name = ‘‘DUPDB‘‘ comment= ‘‘Modified by RMAN duplicate‘‘ scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 321548288 bytes

Fixed Size   2252824 bytes
Variable Size  264245224 bytes
Database Buffers  50331648 bytes
Redo Buffers   4718592 bytes

Starting restore at 25-JUN-2015 08:18:40
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=396 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/DBTEST/autobackup/2015_06_25/o1_mf_s_883287663_brp8zhvt_.bkp
channel ORA_AUX_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/DBTEST/autobackup/2015_06_25/o1_mf_s_883287663_brp8zhvt_.bkp tag=TAG20150625T054103
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/u01/app/oracle/oradata/dupdb/control01.ctl
output file name=/u01/app/oracle/oradata/dupdb/control02.ctl
Finished restore at 25-JUN-2015 08:18:41

database mounted

contents of Memory Script:
{
 set until scn 1553917;
 sql clone ‘alter database flashback off‘;
 set newname for datafile 1 to 
 "/u01/app/oracle/oradata/dupdb/system01.dbf";
 set newname for datafile 2 to 
 "/u01/app/oracle/oradata/dupdb/sysaux01.dbf";
 set newname for datafile 3 to 
 "/u01/app/oracle/oradata/dupdb/undotbs01.dbf";
 set newname for datafile 4 to 
 "/u01/app/oracle/oradata/dupdb/users01.dbf";
 set newname for datafile 5 to 
 "/u01/app/oracle/oradata/dupdb/example01.dbf";
 set newname for datafile 6 to 
 "/u01/app/oracle/oradata/dupdb/nnc_data01.dbf";
 set newname for datafile 7 to 
 "/u01/app/oracle/oradata/dupdb/nnc_data02.dbf";
 set newname for datafile 8 to 
 "/u01/app/oracle/oradata/dupdb/nnc_data03.dbf";
 set newname for datafile 9 to 
 "/u01/app/oracle/oradata/dupdb/nnc_index01.dbf";
 set newname for datafile 10 to 
 "/u01/app/oracle/oradata/dupdb/nnc_index02.dbf";
 set newname for datafile 11 to 
 "/u01/app/oracle/oradata/dupdb/nnc_index03.dbf";
 restore
 clone database
 ;
}
executing Memory Script

executing command: SET until clause

sql statement: alter database flashback off

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 25-JUN-2015 08:18:46
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/dupdb/system01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /u01/app/oracle/oradata/dupdb/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/dupdb/undotbs01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/dupdb/users01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /u01/app/oracle/oradata/dupdb/example01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/dupdb/nnc_data01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/dupdb/nnc_data02.dbf
channel ORA_AUX_DISK_1: restoring datafile 00008 to /u01/app/oracle/oradata/dupdb/nnc_data03.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to /u01/app/oracle/oradata/dupdb/nnc_index01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /u01/app/oracle/oradata/dupdb/nnc_index02.dbf
channel ORA_AUX_DISK_1: restoring datafile 00011 to /u01/app/oracle/oradata/dupdb/nnc_index03.dbf
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/arch/dbbak_0tqabpiv_1_1
channel ORA_AUX_DISK_1: piece handle=/home/oracle/arch/dbbak_0tqabpiv_1_1 tag=TAG20150625T054047
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:25
Finished restore at 25-JUN-2015 08:19:11

contents of Memory Script:
{
 switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=13 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/system01.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=14 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=15 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=16 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=17 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=18 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/nnc_data01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=19 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/nnc_data02.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=20 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/nnc_data03.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=21 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/nnc_index01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=22 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/nnc_index02.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=23 STAMP=883297151 file name=/u01/app/oracle/oradata/dupdb/nnc_index03.dbf

contents of Memory Script:
{
 set until scn 1553917;
 recover
 clone database
 delete archivelog
 ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 25-JUN-2015 08:19:11
using channel ORA_AUX_DISK_1

starting media recovery

archived log for thread 1 with sequence 10 is already on disk as file /home/oracle/arch/1_10_883118265.dbf
archived log for thread 1 with sequence 11 is already on disk as file /home/oracle/arch/1_11_883118265.dbf
archived log file name=/home/oracle/arch/1_10_883118265.dbf thread=1 sequence=10
archived log file name=/home/oracle/arch/1_11_883118265.dbf thread=1 sequence=11
media recovery complete, elapsed time: 00:00:01
Finished recover at 25-JUN-2015 08:19:13
Oracle instance started

Total System Global Area 321548288 bytes

Fixed Size   2252824 bytes
Variable Size  264245224 bytes
Database Buffers  50331648 bytes
Redo Buffers   4718592 bytes

contents of Memory Script:
{
 sql clone "alter system set db_name = 
 ‘‘DUPDB‘‘ comment=
 ‘‘Reset to original value by RMAN‘‘ scope=spfile";
 sql clone "alter system reset db_unique_name scope=spfile";
 shutdown clone immediate;
 startup clone nomount;
}
executing Memory Script

sql statement: alter system set db_name = ‘‘DUPDB‘‘ comment= ‘‘Reset to original value by RMAN‘‘ scope=spfile

sql statement: alter system reset db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area 321548288 bytes

Fixed Size   2252824 bytes
Variable Size  264245224 bytes
Database Buffers  50331648 bytes
Redo Buffers   4718592 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DUPDB" RESETLOGS ARCHIVELOG 
 MAXLOGFILES 16
 MAXLOGMEMBERS 3
 MAXDATAFILES 100
 MAXINSTANCES 8
 MAXLOGHISTORY 292
 LOGFILE
 GROUP 1 ( ‘/u01/app/oracle/oradata/dupdb/redo01.log‘ ) SIZE 50 M REUSE,
 GROUP 2 ( ‘/u01/app/oracle/oradata/dupdb/redo02.log‘ ) SIZE 50 M REUSE,
 GROUP 3 ( ‘/u01/app/oracle/oradata/dupdb/redo03.log‘ ) SIZE 50 M REUSE
 DATAFILE
 ‘/u01/app/oracle/oradata/dupdb/system01.dbf‘
 CHARACTER SET ZHS16GBK


contents of Memory Script:
{
 set newname for tempfile 1 to 
 "/u01/app/oracle/oradata/dupdb/temp01.dbf";
 switch clone tempfile all;
 catalog clone datafilecopy "/u01/app/oracle/oradata/dupdb/sysaux01.dbf", 
 "/u01/app/oracle/oradata/dupdb/undotbs01.dbf", 
 "/u01/app/oracle/oradata/dupdb/users01.dbf", 
 "/u01/app/oracle/oradata/dupdb/example01.dbf", 
 "/u01/app/oracle/oradata/dupdb/nnc_data01.dbf", 
 "/u01/app/oracle/oradata/dupdb/nnc_data02.dbf", 
 "/u01/app/oracle/oradata/dupdb/nnc_data03.dbf", 
 "/u01/app/oracle/oradata/dupdb/nnc_index01.dbf", 
 "/u01/app/oracle/oradata/dupdb/nnc_index02.dbf", 
 "/u01/app/oracle/oradata/dupdb/nnc_index03.dbf";
 switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /u01/app/oracle/oradata/dupdb/temp01.dbf in control file

cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/sysaux01.dbf RECID=1 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/undotbs01.dbf RECID=2 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/users01.dbf RECID=3 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/example01.dbf RECID=4 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/nnc_data01.dbf RECID=5 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/nnc_data02.dbf RECID=6 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/nnc_data03.dbf RECID=7 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/nnc_index01.dbf RECID=8 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/nnc_index02.dbf RECID=9 STAMP=883297164
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/dupdb/nnc_index03.dbf RECID=10 STAMP=883297164

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/sysaux01.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/undotbs01.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/users01.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/example01.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/nnc_data01.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/nnc_data02.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/nnc_data03.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/nnc_index01.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=9 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/nnc_index02.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=10 STAMP=883297164 file name=/u01/app/oracle/oradata/dupdb/nnc_index03.dbf

contents of Memory Script:
{
 Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 25-JUN-2015 08:19:28

RMAN> 

 

在相同的主机上创建一个duplicate数据库

标签:

热心网友 时间:2022-04-08 00:55

MySql避免重复插入记录的几种方法
本文章来给大家提供三种在mysql中避免重复插入记录方法,主要是讲到了ignore,Replace,ON DUPLICATE KEY UPDATE三种方法,有需要的朋友可以参考一下

方案一:使用ignore关键字
如果是用主键primary或者唯一索引unique区分了记录的唯一性,避免重复插入记录可以使用:
复制代码 代码如下:

INSERT IGNORE INTO `table_name` (`email`, `phone`, `user_id`) VALUES ('test9@163.com', '99999', '9999');

这样当有重复记录就会忽略,执行后返回数字0

还有个应用就是复制表,避免重复记录:
复制代码 代码如下:

INSERT IGNORE INTO `table_1` (`name`) SELECT `name` FROM `table_2`;

方案二:使用Replace

语法格式:
复制代码 代码如下:

REPLACE INTO `table_name`(`col_name`, ...) VALUES (...);
REPLACE INTO `table_name` (`col_name`, ...) SELECT ...;
REPLACE INTO `table_name` SET `col_name`='value',

...算法说明:
REPLACE的运行与INSERT很相像,但是如果旧记录与新记录有相同的值,则在新记录被插入之前,旧记录被删除,即:

尝试把新行插入到表中
当因为对于主键或唯一关键字出现重复关键字错误而造成插入失败时:
从表中删除含有重复关键字值的冲突行
再次尝试把新行插入到表中
旧记录与新记录有相同的值的判断标准就是:
表有一个PRIMARY KEY或UNIQUE索引,否则,使用一个REPLACE语句没有意义。该语句会与INSERT相同,因为没有索引被用于确定是否新行复制了其它的行。
返回值:
REPLACE语句会返回一个数,来指示受影响的行的数目。该数是被删除和被插入的行数的和
受影响的行数可以容易地确定是否REPLACE只添加了一行,或者是否REPLACE也替换了其它行:检查该数是否为1(添加)或更大(替换)。
示例:
# eg:(phone字段为唯一索引)
复制代码 代码如下:

REPLACE INTO `table_name` (`email`, `phone`, `user_id`) VALUES ('test569', '99999', '123');

另外,在 SQL Server 中可以这样处理:

复制代码 代码如下:

if not exists (select phone from t where phone= '1') insert into t(phone, update_time) values('1', getdate()) else update t set update_time = getdate() where phone= '1'

更多信息请看:http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#replace

方案三:ON DUPLICATE KEY UPDATE
如‍上所写,你也可以在INSERT INTO…..后面加上 ON DUPLICATE KEY UPDATE方法来实现。如果您指定了ON DUPLICATE KEY UPDATE,并且插入行后会导致在一个UNIQUE索引或PRIMARY KEY中出现重复值,则执行旧行UPDATE。
例如,如果列a被定义为UNIQUE,并且包含值1,则以下两个语句具有相同的效果:
复制代码 代码如下:

INSERT INTO `table` (`a`, `b`, `c`) VALUES (1, 2, 3) ON DUPLICATE KEY UPDATE `c`=`c`+1;
UPDATE `table` SET `c`=`c`+1 WHERE `a`=1;

如果行作为新记录被插入,则受影响行的值为1;如果原有的记录被更新,则受影响行的值为2。

注释:如果列b也是唯一列,则INSERT与此UPDATE语句相当:
复制代码 代码如下:

UPDATE `table` SET `c`=`c`+1 WHERE `a`=1 OR `b`=2 LIMIT 1;

如果a=1 OR b=2与多个行向匹配,则只有一个行被更新。通常,您应该尽量避免对带有多个唯一关键字的表使用ON DUPLICATE KEY子句。

您可以在UPDATE子句中使用VALUES(col_name)函数从INSERT…UPDATE语句的INSERT部分引用列值。换句话说,如果没有发生重复关键字冲突,则UPDATE子句中的VALUES(col_name)可以引用被插入的col_name的值。本函数特别适用于多行插入。VALUES()函数只在INSERT…UPDATE语句中有意义,其它时候会返回NULL。
复制代码 代码如下:

INSERT INTO `table` (`a`, `b`, `c`) VALUES (1, 2, 3), (4, 5, 6) ON DUPLICATE KEY UPDATE `c`=VALUES(`a`)+VALUES(`b`);

本语句与以下两个语句作用相同:

复制代码 代码如下:

INSERT INTO `table` (`a`, `b`, `c`) VALUES (1, 2, 3) ON DUPLICATE KEY UPDATE `c`=3;
INSERT INTO `table` (`a`, `b`, `c`) VALUES (4, 5, 6) ON DUPLICATE KEY UPDATE c=9;

注释:当您使用ON DUPLICATE KEY UPDATE时,DELAYED选项被忽略。

示例:
这个例子是我在实际项目中用到的:是将一个表的数据导入到另外一个表中,数据的重复性就得考虑(如下),唯一索引为:email:
复制代码 代码如下:

INSERT INTO `table_name1` (`title`, `first_name`, `last_name`, `email`, `phone`, `user_id`, `role_id`, `status`, `campaign_id`)
SELECT '', '', '', `table_name2`.`email`, `table_name2`.`phone`, NULL, NULL, 'pending', 29 FROM `table_name2`
WHERE `table_name2`.`status` = 1
ON DUPLICATE KEY UPDATE `table_name1`.`status`='pending'

再贴一个例子:

复制代码 代码如下:

INSERT INTO `class` SELECT * FROM `class1` ON DUPLICATE KEY UPDATE `class`.`course`=`class1`.`course`

其它关键:DELAYED 做为快速插入,并不是很关心失效性,提高插入性能。
IGNORE 只关注主键对应记录是不存在,无则添加,有则忽略。

特别说明:在MYSQL中UNIQUE索引将会对null字段失效,也就是说(a字段上建立唯一索引):
复制代码 代码如下:

INSERT INTO `test` (`a`) VALUES (NULL);

是可以重复插入的(联合唯一索引也一样)。
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
tplink无线扩展器怎样重置密码 扩展器原始的密码是什么 如何重新设置TPLink扩展器的密码简单步骤教你修改TPLink扩展器的... 为什么要加入tcpip协议 父母如何给孩子做一个好榜样 父母应该如何做孩子的榜样? 冬季草原防火安全知识 冬季景区该如何预防火灾 厨房暗管漏水 多少钱 手脚出汗,睡眠不好,早泄是阳虚还是阴虚 魂冥泪的小说包有吗?可以分享下百度云吗?谢谢! solidworks2011 x64 sp1.0安装 求 一攻三受 by 魂冥泪 跪求solidworks2011破解不成功是怎么了 求魂冥泪小说一攻三受 SolidWorks2011卸载了,SolidWorks后台下载程序还在工作 求魂冥泪的bl小说,《一攻三受》。最好是TXT格式的,谢谢! 高分问solidworks2011安装不停弹出下载弹窗,安装界面没任何按钮,怎么处理,是因为缺文件还是什么,附图 求小说《一攻三受》by魂冥泪 txt 叫乔什么的耽美小说三个字 SolidWorks.v2011.SP0.0.x64的安装步奏 魂冥泪小说合集百度云 SolidWorks 2011 solidworks2011下载 solidworks2011破解 solidworks2011 sp1 solidworks2011教程 为什么solidworks 2011安装时提示项目文件不存在? 求魂冥泪的小说集合,重点是(一攻三受)这篇,9 5 2 6 2 4 6 3 4谢谢 现代耽美父子文主角姓宋父亲强迫儿子 哪里下载的solidworks2011不用每个月都要破解的, 求缓归矣《春江水暖》txt百度云资源,急! 谁有solidworks2011中午破解版的下载地址? 魂冥泪的《一攻三受》《宝贝宝贝》 你用的SOLIDWORKS2011是什么版本,是破解的吗?是64位还是32位的? 能告诉下solidworks2011的 photoview360是在哪里下载的吗?谢谢了 怎么样下载和安装solidworks2011中文版。我的电脑是windows7旗舰版32位的 Solidworks 2011 总是安装错误 (win7) 求父欲txt、一攻三受txt by魂冥泪全文网盘 win7 下安装solidworks2011 破解完后还是有30天权限,我采用的是SSQ的破解文件,请教 父攻子受,都姓宋的小说名字叫什么? SOS!!!跪求Solidworks2011版可用序列号~~~不胜感激啊..=333= 神武5开小号搭配 成都哪儿有婚庆司仪培训学校?需要多少钱?学多久? 中信银行信用卡可以自己网上激活么 网上申请的中信银行信用卡怎么在网上激活不了 中信银行的社保卡当做银行卡来用的话,没有,如果没有激活,可以往里面打钱吗? 植物黄油可以炒菜吃吗 中信银行信用卡没有激活在网上是查不到的吗? 植物黄油的危害是什么? 为什么不禁止植物黄油 植物黄油不含反式脂肪酸能直接吃吗 植物黄油能蒸馍用吗? 华为手机怎么开颜色反