当前位置: 首页 > news >正文

2021好心人给个开车的网站seo排名第一的企业

2021好心人给个开车的网站,seo排名第一的企业,宁波做网站gs,青柠影院观看免费高清电视剧DB2 load的过程: (1)、装入阶段 装入阶段将源数据解析成物理数据页的格式,直接装入到数据页中。必要时还收集索引键和表统计信息。 (2)、构建索引阶段 根据在装入阶段收集的索引键创建表索引。 &#xff08…

DB2 load的过程:
(1)、装入阶段

      装入阶段将源数据解析成物理数据页的格式,直接装入到数据页中。必要时还收集索引键和表统计信息。

 (2)、构建索引阶段

      根据在装入阶段收集的索引键创建表索引。
(3)、删除重复阶段

      在此阶段将违反了主键约束和唯一约束的行删除(主键约束包含了唯一约束),如果定义了异常表,这些删除的行将会插入到异常表中,在装载完成后可以查询异常来查看那些行违反了唯一性约束

测试:
[db2inst1@t3-dtpoc-dtpoc-web04 ~]$ db2 "create table employee(id int not null primary key,name varchar(10))"
DB20000I  The SQL command completed successfully.
[db2inst1@t3-dtpoc-dtpoc-web04 ~]$ db2 "create table employee_exception(id int not null,name varchar(10))"                    
DB20000I  The SQL command completed successfully.

vi employee.del
1,liys
2,zhangs
3,wangw
4,lius
2,error

[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "load from employee.del of del insert into employee for exception employee_exception nonrecoverable"
SQL3109N  The utility is beginning to load data from file 
"/home/db2inst1/liys/employee.del".

SQL3500W  The utility is beginning the "LOAD" phase at time "08/30/2023 
14:27:58.655991".

SQL3519W  Begin Load Consistency Point. Input record count = "0".

SQL3520W  Load Consistency Point was successful.

SQL3110N  The utility has completed processing.  "5" rows were read from the 
input file.

SQL3519W  Begin Load Consistency Point. Input record count = "5".

SQL3520W  Load Consistency Point was successful.

SQL3515W  The utility has finished the "LOAD" phase at time "08/30/2023 
14:27:58.702249".

SQL3500W  The utility is beginning the "BUILD" phase at time "08/30/2023 
14:27:58.706067".

SQL3213I  The indexing mode is "REBUILD".

SQL3515W  The utility has finished the "BUILD" phase at time "08/30/2023 
14:27:58.764588".

SQL3500W  The utility is beginning the "DELETE" phase at time "08/30/2023 
14:27:58.790554".

SQL3509W  The utility has deleted "1" rows from the table.

SQL3515W  The utility has finished the "DELETE" phase at time "08/30/2023 
14:27:58.798497".


Number of rows read         = 5
Number of rows skipped      = 0
Number of rows loaded       = 5
Number of rows rejected     = 0
Number of rows deleted      = 1
Number of rows committed    = 5

可以看到主键重复的行被扔进了异常表。

[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "select * from employee_exception"

ID          NAME      
----------- ----------
          2 error 

值得注意的是
Oracle端:’C’和’C ‘被认为是两个不同字符。
Db2端:’C’和’C ‘则是相同字符,导致其中的’C ‘插入失败,报出SQL0803N。所从ORACLE导出数据然后Load进DB2的时候,会有主键重复的情况。这也是复制软件如CDC复制时经常报主键冲突的原因,解决方法就是设置主键冲突源获胜,目标端丢弃重复数据。

[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "create table employee1(id varchar(10) not null primary key,name varchar(10))"
DB20000I  The SQL command completed successfully.
[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "insert into employee1 values('liys  ','llljjj  ')"
DB20000I  The SQL command completed successfully.
[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "select id||'AAA', name||'AAA' from employee1"

1             2            
------------- -------------
liys  AAA     llljjj  AAA  

  1 record(s) selected.

[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "insert into employee1 values('liys','llljjj  ')"  
DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned:
SQL0803N  One or more values in the INSERT statement, UPDATE statement, or 
foreign key update caused by a DELETE statement are not valid because the 
primary key, unique constraint or unique index identified by "1" constrains 
table "DB2INST1.EMPLOYEE1" from having duplicate values for the index key.  
SQLSTATE=23505
 
 但是如果前边有空格呢?不会主键冲突,DB2也会认为不冲突
 [db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "insert into employee1 values('  liys','llljjj  ')"   
DB20000I  The SQL command completed successfully.
[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "select id||'AAA', name||'AAA' from employee1"

1             2            
------------- -------------
liys  AAA     llljjj  AAA  
  liysAAA     llljjj  AAA  

  2 record(s) selected.
  
  
 如果输入的字符长度超过varchar(10)呢,会自动截断还是插入失败呢? DB2插入会报错失败,但是Load会截断然后插入。
 
 
Number of rows read         = 2
Number of rows skipped      = 0
Number of rows loaded       = 2
Number of rows rejected     = 0
Number of rows deleted      = 0
Number of rows committed    = 2

[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "select *  from employee"

ID          NAME      
----------- ----------
          1 fj        
          2 waizhonggu

  2 record(s) selected.
  
  [db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "insert into employee1 values (3,'slafdjlakjfsadhflhaslfhalsf')"
DB21034E  The command was processed as an SQL statement because it was not a 
valid Command Line Processor command.  During SQL processing it returned:
SQL0433N  Value "slafdjlakjfsadhflhaslfhalsf" is too long.  SQLSTATE=22001
[db2inst1@t3-dtpoc-dtpoc-web04 liys]$ db2 "select *  from employee"                                       

ID          NAME      
----------- ----------
          1 fj        
          2 waizhonggu

  2 record(s) selected.


  
MYSQL测试;
load data local infile "/home/mysql/liys/employee1.del" into table user lines terminated by '\n';

mysql> load data local infile "/home/mysql/liys/employee1.del" into table employee lines terminated by '\n';
Query OK, 4 rows affected, 11 warnings (0.00 sec)
Records: 5  Deleted: 0  Skipped: 1  Warnings: 11

mysql> select * from employee;
+----+------+
| id | name |
+----+------+
|  1 | NULL |
|  2 | NULL |
|  3 | NULL |
|  4 | NULL |
+----+------+
4 rows in set (0.00 sec)

发现id=5的被SKIPPED,但是name列都是NULL,加上FIELDS TERMINATED BY ','就可以了

mysql> load data local infile "/home/mysql/liys/employee1.del" into table employee FIELDS TERMINATED BY ',' lines terminated by '\n';
Query OK, 4 rows affected, 1 warning (0.01 sec)
Records: 5  Deleted: 0  Skipped: 1  Warnings: 1

mysql> select * from employee;
+----+--------+
| id | name   |
+----+--------+
|  1 | liy    |
|  2 | zhangs |
|  3 | wangw  |
|  4 | lius   |
+----+--------+
4 rows in set (0.00 sec)

mysql> 

那MYSQL端:’C’和’C ‘被认为是两个不同字符吗?测试发现MYSQL和DB2是完全一致的

mysql> create table employee1(id varchar(10) not null primary key,name varchar(10));
Query OK, 0 rows affected (0.01 sec)

mysql> insert into employee1 values('liys  ','llljjj  ');
Query OK, 1 row affected (0.01 sec)
mysql> select concat(id,'AAA'),concat(name,'AAA') from employee1;                                        
+------------------+--------------------+
| concat(id,'AAA') | concat(name,'AAA') |
+------------------+--------------------+
| liys  AAA        | llljjj  AAA        |
+------------------+--------------------+
1 row in set (0.00 sec)

mysql> insert into employee1 values('liys','llljjj  ');
ERROR 1062 (23000): Duplicate entry 'liys' for key 'PRIMARY'

      
mysql> insert into employee1 values('liys1','llljjj  ');
Query OK, 1 row affected (0.01 sec)

mysql> select concat(id,'AAA'),concat(name,'AAA') from employee1;
+------------------+--------------------+
| concat(id,'AAA') | concat(name,'AAA') |
+------------------+--------------------+
| liys  AAA        | llljjj  AAA        |
| liys1AAA         | llljjj  AAA        |
+------------------+--------------------+
2 rows in set (0.00 sec)

mysql> insert into employee1 values('  liys1','llljjj  ');

mysql> insert into employee1 values('  liys1','llljjj  ');
Query OK, 1 row affected (0.00 sec)

mysql> select concat(id,'AAA'),concat(name,'AAA') from employee1;
+------------------+--------------------+
| concat(id,'AAA') | concat(name,'AAA') |
+------------------+--------------------+
|   liys1AAA       | llljjj  AAA        |
| liys  AAA        | llljjj  AAA        |
| liys1AAA         | llljjj  AAA        |
+------------------+--------------------+
3 rows in set (0.00 sec)

mysql> insert into employee1 values('  liys','llljjj  ');
Query OK, 1 row affected (0.01 sec)

mysql> select concat(id,'AAA'),concat(name,'AAA') from employee1;
+------------------+--------------------+
| concat(id,'AAA') | concat(name,'AAA') |
+------------------+--------------------+
|   liysAAA        | llljjj  AAA        |
|   liys1AAA       | llljjj  AAA        |
| liys  AAA        | llljjj  AAA        |
| liys1AAA         | llljjj  AAA        |
+------------------+--------------------+
4 rows in set (0.00 sec)

 
 如果输入的字符长度超过varchar(10)呢,会自动截断还是插入失败呢?测试结果MYSQL和DB2完全一样, 插入会报错失败,但是Load会截断然后插入。
 
vi employee1.del
3,fhjl
6,woaizhogngguoodddafafsaa

mysql> load data local infile "/home/mysql/liys/employee1.del" into table employee FIELDS TERMINATED BY ',' lines terminated by '\n';
Query OK, 2 rows affected, 1 warning (0.00 sec)
Records: 2  Deleted: 0  Skipped: 0  Warnings: 1

mysql> select * from employee;
+----+------------+
| id | name       |
+----+------------+
|  3 | fhjl       |
|  6 | woaizhogng |
+----+------------+
2 rows in set (0.00 sec)


mysql> insert into employee values (234,'afasfhflashflashflaisfasfsafassaf');
ERROR 1406 (22001): Data too long for column 'name' at row 1
mysql> 

http://www.khdw.cn/news/17085.html

相关文章:

  • 通过ip访问网站需要怎么做网络营销网站推广
  • 帮做网站的网站网站建设山东聚搜网络
  • 公司网站用什么cms系统产品关键词
  • 部门网站建设需求确认表太原百度关键词排名
  • 网站关键词的优化在哪做seo研究中心道一老师
  • 福建省人民政府驻广州办事处seo快速排名培训
  • 方圆网 网站建设百度客户管理系统登录
  • 成都网站建设推广港哥熊掌号公司做网站怎么做
  • 自己做服务器和网站台州seo排名公司
  • 网站图片做cdn公司怎么在百度上推广
  • 网站申请怎么样推广自己的店铺和产品
  • 潍坊企业模板建站2020站群seo系统
  • 吉林大学学院网站建设群免费注册网站有哪些
  • 网站 提示危险佛山网站快速排名提升
  • 天津网站建站模板佛山竞价账户托管
  • 沈阳网站建设思路深圳龙岗区疫情最新消息
  • 阿里做外贸是哪个网站搜索引擎关键词seo优化公司
  • 学javaweb可以做网站嘛seo引擎优化公司
  • 网站如何做视频教程汕头网站设计公司
  • 淄博网站制作制作seo数据是什么意思
  • 学做网站有用吗重庆百度推广排名
  • 网络维护网站seo数据优化
  • 深圳西乡做网站sem搜索引擎
  • 品牌建设和品牌推广谷歌推广优化
  • 网站模板 登陆东营百度推广公司
  • 开发型网站报价方法网站设计平台
  • 直接用ip访问网站百度搜索关键词优化方法
  • 做国外衣服的网站有哪些百度知道下载安装
  • 做淘宝网站代理友情链接格式
  • 网站建设法律友情链接推广平台