pg_repack bloat 处理测试初步

一、软件安装

1.软件需求:

postgresql-9.5.2.tar.gz

pg_repack-1.3.4.zip

2.安装pg_repack

[[email protected] pg_repack-1.3.4]# export PATH=/opt/pgsql/9.5.2/bin:$PATH

[[email protected] pg_repack-1.3.4]# export LD_LIBRARY_PATH=/opt/pgsql/9.5.2/lib

[[email protected] pg_repack-1.3.4]# export MANPATH=/opt/pgsql/9.5.2/share/man:$MANPATH

[[email protected] pg_repack-1.3.4]# make

make[1]: Entering directory `/home/soft/pg_repack-1.3.4/bin‘

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -I/opt/pgsql/9.5.2/include -DREPACK_VERSION=1.3.4 -I. -I./ -I/opt/pgsql/9.5.2/include/server -I/opt/pgsql/9.5.2/include/internal -D_GNU_SOURCE   -c -o pg_repack.o pg_repack.c

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -I/opt/pgsql/9.5.2/include -DREPACK_VERSION=1.3.4 -I. -I./ -I/opt/pgsql/9.5.2/include/server -I/opt/pgsql/9.5.2/include/internal -D_GNU_SOURCE   -c -o pgut/pgut.o pgut/pgut.c

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -I/opt/pgsql/9.5.2/include -DREPACK_VERSION=1.3.4 -I. -I./ -I/opt/pgsql/9.5.2/include/server -I/opt/pgsql/9.5.2/include/internal -D_GNU_SOURCE   -c -o pgut/pgut-fe.o pgut/pgut-fe.c

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 pg_repack.o pgut/pgut.o pgut/pgut-fe.o -L/opt/pgsql/9.5.2/lib -lpq -L/opt/pgsql/9.5.2/lib -Wl,--as-needed -Wl,-rpath,‘/opt/pgsql/9.5.2/lib‘,--enable-new-dtags  -lpgcommon -lpgport -lz -lreadline -lrt -lcrypt -ldl -lm -o pg_repack

make[1]: Leaving directory `/home/soft/pg_repack-1.3.4/bin‘

make[1]: Entering directory `/home/soft/pg_repack-1.3.4/lib‘

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -DREPACK_VERSION=1.3.4 -I. -I./ -I/opt/pgsql/9.5.2/include/server -I/opt/pgsql/9.5.2/include/internal -D_GNU_SOURCE   -c -o repack.o repack.c

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -DREPACK_VERSION=1.3.4 -I. -I./ -I/opt/pgsql/9.5.2/include/server -I/opt/pgsql/9.5.2/include/internal -D_GNU_SOURCE   -c -o pgut/pgut-be.o pgut/pgut-be.c

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -DREPACK_VERSION=1.3.4 -I. -I./ -I/opt/pgsql/9.5.2/include/server -I/opt/pgsql/9.5.2/include/internal -D_GNU_SOURCE   -c -o pgut/pgut-spi.o pgut/pgut-spi.c

( echo ‘{ global:‘; gawk ‘/^[^#]/ {printf "%s;\n",$1}‘ exports.txt; echo ‘ local: *; };‘ ) >exports.list

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -O2 -fpic -shared -Wl,--version-script=exports.list -o pg_repack.so repack.o pgut/pgut-be.o pgut/pgut-spi.o -L/opt/pgsql/9.5.2/lib -Wl,--as-needed -Wl,-rpath,‘/opt/pgsql/9.5.2/lib‘,--enable-new-dtags

sed ‘s,REPACK_VERSION,1.3.4,g‘ pg_repack.sql.in > pg_repack--1.3.4.sql;

sed ‘s,REPACK_VERSION,1.3.4,g‘ pg_repack.control.in > pg_repack.control

make[1]: Leaving directory `/home/soft/pg_repack-1.3.4/lib‘

make[1]: Entering directory `/home/soft/pg_repack-1.3.4/regress‘

make[1]: Nothing to be done for `all‘.

make[1]: Leaving directory `/home/soft/pg_repack-1.3.4/regress‘

[[email protected] pg_repack-1.3.4]# make install

make[1]: Entering directory `/home/soft/pg_repack-1.3.4/bin‘

/bin/mkdir -p ‘/opt/pgsql/9.5.2/bin‘

/usr/bin/install -c  pg_repack ‘/opt/pgsql/9.5.2/bin‘

make[1]: Leaving directory `/home/soft/pg_repack-1.3.4/bin‘

make[1]: Entering directory `/home/soft/pg_repack-1.3.4/lib‘

/bin/mkdir -p ‘/opt/pgsql/9.5.2/lib‘

/bin/mkdir -p ‘/opt/pgsql/9.5.2/share/extension‘

/bin/mkdir -p ‘/opt/pgsql/9.5.2/share/extension‘

/usr/bin/install -c -m 755  pg_repack.so ‘/opt/pgsql/9.5.2/lib/pg_repack.so‘

/usr/bin/install -c -m 644 .//pg_repack.control ‘/opt/pgsql/9.5.2/share/extension/‘

/usr/bin/install -c -m 644  pg_repack--1.3.4.sql pg_repack.control ‘/opt/pgsql/9.5.2/share/extension/‘

make[1]: Leaving directory `/home/soft/pg_repack-1.3.4/lib‘

make[1]: Entering directory `/home/soft/pg_repack-1.3.4/regress‘

make[1]: Nothing to be done for `install‘.

make[1]: Leaving directory `/home/soft/pg_repack-1.3.4/regress‘

[[email protected] pg_repack-1.3.4]#

3.创建初始环境

[[email protected] ~]$ createdb bloatdb

[[email protected] ~]$ psql -d bloatdb -c "create extension pgstattuple;"

CREATE EXTENSION

[[email protected] ~]$ psql -d bloatdb -c "CREATE EXTENSION pg_repack;"

CREATE EXTENSION

[[email protected] ~]$

$ psql bloatdb

psql (9.5.2)

Type "help" for help.

bloatdb=# \dx

List of installed extensions

Name     | Version |   Schema   |                         Description

-------------+---------+------------+--------------------------------------------------------------

pg_repack   | 1.3.4   | public     | Reorganize tables in PostgreSQL databases with minimal locks

pgstattuple | 1.3     | public     | show tuple-level statistics

plpgsql     | 1.0     | pg_catalog | PL/pgSQL procedural language

(3 rows)

二、静态(无活跃交易)膨胀整理测试

1.处理表tbl指定索引

1).准备环境

bloatdb=# create table tbl(id int primary key, first varchar(20),second varchar(20));

CREATE TABLE

bloatdb=# create index idx_tbl_first on tbl (first);

CREATE INDEX

bloatdb=# create index idx_tbl_second on tbl (second);

CREATE INDEX

bloatdb=# SELECT count(*) FROM tbl;

count

-------

0

(1 row)

bloatdb=# SELECT pg_size_pretty(pg_total_relation_size(‘tbl‘));

pg_size_pretty

----------------

24 kB

(1 row)

bloatdb=# INSERT INTO tbl VALUES(generate_series(1,10000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

INSERT 0 10000

bloatdb=# SELECT count(*) FROM tbl;

count

-------

10000

(1 row)

bloatdb=# SELECT pg_size_pretty(pg_total_relation_size(‘tbl‘));

pg_size_pretty

----------------

1584 kB

(1 row)

bloatdb=#

更新列

bloatdb=# UPDATE tbl SET first= ‘updated-001‘;

UPDATE 10000

bloatdb=# SELECT count(*) FROM tbl;

count

-------

10000

(1 row)

bloatdb=# SELECT pg_size_pretty(pg_total_relation_size(‘tbl‘));

pg_size_pretty

----------------

3376 kB

(1 row)

bloatdb=#

2).查询膨胀率

建立膨胀统计表

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" --create_stats_table

膨胀统计

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_second.......................................................(52.69%) 417 kB wasted

2. public.idx_tbl_first........................................................(52.64%) 413 kB wasted

3. public.tbl_pkey.............................................................(57.79%) 388 kB wasted

[[email protected] ~]$

3).处理膨胀

指定数据库的特定索引

[[email protected] ~]$ pg_repack -d bloatdb --index idx_tbl_first

INFO: repacking index "public"."idx_tbl_first"

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_second.......................................................(52.69%) 417 kB wasted

2. public.tbl_pkey.............................................................(57.79%) 388 kB wasted

3. public.idx_tbl_first.....................................................(0.93%) 3121 bytes wasted

[[email protected] ~]$

2.处理表tbl所有索引

1).准备环境

bloatdb=# update tbl set second=‘chris‘;

UPDATE 10000

bloatdb=# SELECT count(*) FROM tbl;

count

-------

10000

(1 row)

bloatdb=# SELECT pg_size_pretty(pg_total_relation_size(‘tbl‘));

pg_size_pretty

----------------

3600 kB

(1 row)

bloatdb=#

bloatdb=# update tbl set first=‘chris‘;

UPDATE 10000

bloatdb=# SELECT count(*) FROM tbl;

count

-------

10000

(1 row)

bloatdb=# SELECT pg_size_pretty(pg_total_relation_size(‘tbl‘));

pg_size_pretty

----------------

4176 kB

(1 row)

bloatdb=#

2).检查膨胀

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_second.......................................................(59.94%) 820 kB wasted

2. public.idx_tbl_first........................................................(40.94%) 409 kB wasted

3. public.tbl_pkey.............................................................(28.73%) 193 kB wasted

[[email protected] ~]$

3).处理tbl表所有索引膨胀

[[email protected] ~]$ pg_repack -d bloatdb --table tbl --only-indexes

INFO: repacking indexes of "tbl"

INFO: repacking index "public"."idx_tbl_first"

INFO: repacking index "public"."idx_tbl_second"

INFO: repacking index "public"."tbl_pkey"

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_first.....................................................(1.23%) 3028 bytes wasted

2. public.idx_tbl_second....................................................(1.23%) 3028 bytes wasted

3. public.tbl_pkey..........................................................(1.23%) 3028 bytes wasted

[[email protected] ~]$

3.处理tbl数据和索引膨胀

1).索引膨胀

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_first.........................................................(57.87%) 49 MB wasted

2. public.idx_tbl_second........................................................(39.29%) 34 MB wasted

3. public.tbl_pkey..............................................................(51.22%) 26 MB wasted

2).处理膨胀online VACUUM FULL 数据库bloatdb表tbl(数据和索引)

[[email protected] ~]$ pg_repack --no-order --table tbl -d bloatdb

INFO: repacking table "tbl"

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.tbl_pkey..............................................................(0.0%) 0 bytes wasted

2. public.idx_tbl_second........................................................(0.0%) 0 bytes wasted

3. public.idx_tbl_first.........................................................(0.0%) 0 bytes wasted

[[email protected] ~]$

三、动态(有交易发生时)膨胀处理

1.整个表做膨胀处理

1).初始条件

-- clear table data

bloatdb=# select * from tbl;

id | first | second

----+-------+--------

(0 rows)

bloatdb=#

bloatdb=# INSERT INTO tbl VALUES(generate_series(1,100000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

INSERT 0 100000

bloatdb=# UPDATE tbl SET first= ‘updated-001‘;

UPDATE 100000

bloatdb=#

-- check bloat

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_second........................................................(67.26%) 17 MB wasted

2. public.idx_tbl_first.........................................................(67.46%) 17 MB wasted

3. public.tbl_pkey............................................................(63.91%) 9832 kB wasted

[[email protected] ~]$

2).大量插入数据同时做膨胀处理

statement_timeout=0, 视情况调整:maintenance_work_mem,wal_keep_segments(streaming,SSD<2000>)

先插入数据,过程中处理膨胀加上-T参数值为3600.

-- session 1:insert data

bloatdb=# INSERT INTO tbl VALUES(generate_series(100001,3000000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

光标闪烁

-- session 2:repack during insert

$ pg_repack -d bloatdb --no-order --table tbl --wait-timeout=3600

INFO: repacking table "tbl"

光标闪烁

--session 1 finish insert

bloatdb=# INSERT INTO tbl VALUES(generate_series(100001,3000000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

INSERT 0 2900000

bloatdb=#

-- session 2: finish repack

[[email protected] ~]$ pg_repack -d bloatdb --no-order --table tbl --wait-timeout=3600

INFO: repacking table "tbl"

-- session 2:膨胀检查

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.tbl_pkey..............................................................(0.0%) 0 bytes wasted

2. public.idx_tbl_second........................................................(0.0%) 0 bytes wasted

3. public.idx_tbl_first.........................................................(0.0%) 0 bytes wasted

[[email protected] ~]$

-- session 1: 数据检查

bloatdb=# select count(*) from tbl ;

count

---------

3000000

(1 row)

bloatdb=#

2.指定tbl表所有索引膨胀处理

1).准备数据

--session 1: insert data

bloatdb=# delete FROM tbl;

DELETE 3000000

bloatdb=# INSERT INTO tbl VALUES(generate_series(1,100000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

INSERT 0 100000

bloatdb=# update tbl set first=‘chris‘;

UPDATE 100000

bloatdb=#

-- session 2:check bloat

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.tbl_pkey..............................................................(41.14%) 28 MB wasted

2. public.idx_tbl_second.......................................................(4.32%) 4471 kB wasted

3. public.idx_tbl_first........................................................(2.96%) 2889 kB wasted

[[email protected] ~]$

2).online insert and repack

--session 1: insert large data

bloatdb=# INSERT INTO tbl VALUES(generate_series(100001,3000000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

光标闪烁

-- session 2:process bloat,during session 1 inert large data

[[email protected] ~]$ pg_repack -d bloatdb --table tbl --only-indexes -T 3600

INFO: repacking indexes of "tbl"

INFO: repacking index "public"."idx_tbl_first"

INFO: repacking index "public"."idx_tbl_second"

光标闪烁

--session 1:insert finish

bloatdb=# INSERT INTO tbl VALUES(generate_series(100001,3000000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

INSERT 0 2900000

bloatdb=#

--session 2:repack finish

[[email protected] ~]$ pg_repack -d bloatdb --table tbl --only-indexes -T 3600

INFO: repacking indexes of "tbl"

INFO: repacking index "public"."idx_tbl_first"

INFO: repacking index "public"."idx_tbl_second"

INFO: repacking index "public"."tbl_pkey"

3) check table data and index bloat

--session 2:check bloat

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.tbl_pkey..............................................................(0.0%) 0 bytes wasted

2. public.idx_tbl_first.........................................................(0.0%) 0 bytes wasted

3. public.idx_tbl_second........................................................(0.0%) 0 bytes wasted

[[email protected] ~]$

--session 1:check table data

bloatdb=# select count(*) from tbl;

count

---------

3000000

(1 row)

bloatdb=#

3.指定tbl表指定索引膨胀处理

注意:--index(concurrently方式创建索引),--only-indexes无法同时使用。

[[email protected] ~]$ pg_repack -d bloatdb --index idx_tbl_first --only-indexes

ERROR: cannot specify --index (-i) and --only-indexes (-x)

1).准备数据

-- read data

bloatdb=# delete FROM tbl;

DELETE 3000000

bloatdb=# INSERT INTO tbl VALUES(generate_series(1,100000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

INSERT 0 100000

bloatdb=# update tbl set first=‘chris‘;

UPDATE 100000

bloatdb=#

-- check bloat

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_second........................................................(47.57%) 97 MB wasted

2. public.tbl_pkey.............................................................(9.44%) 7206 kB wasted

3. public.idx_tbl_first........................................................(3.11%) 3040 kB wasted

[[email protected] ~]$

2).online insert and repack

--session 1: insert large data

bloatdb=# INSERT INTO tbl VALUES(generate_series(100001,3000000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

光标闪烁

-- session 2:process bloat,during session 1 inert large data

[[email protected] ~]$ pg_repack -d bloatdb --index idx_tbl_second --wait-timeout=3600

INFO: repacking index "public"."idx_tbl_second"

光标闪烁

--session 1:insert finish

bloatdb=# INSERT INTO tbl VALUES(generate_series(100001,3000000), ‘first‘||(random()*(10^3))::integer, ‘second‘||(random()*(10^3))::integer);

INSERT 0 2900000

bloatdb=#

--session 2:repack finish

[[email protected] ~]$ pg_repack -d bloatdb --index idx_tbl_second --wait-timeout=3600

INFO: repacking index "public"."idx_tbl_second"

[[email protected] ~]$

3) check table data and index bloat

--session 2:check bloat

[[email protected] ~]$ /home/soft/pg_bloat_check-master/pg_bloat_check.py -c "dbname=bloatdb" -t tbl

1. public.idx_tbl_first........................................................(50.77%) 102 MB wasted

2. public.tbl_pkey...............................................................(47.6%) 65 MB wasted

3. public.idx_tbl_second........................................................(0.0%) 0 bytes wasted

[[email protected] ~]$

--session 1:check table data

bloatdb=# select count(*) from tbl;

count

---------

3000000

(1 row)

bloatdb=#

测试结论:

  1. 一般同等条件下,索引比数据更容易膨胀。
  2. 在磁盘空间较紧张的情况下,建议一条接着一条索引处理。
  3. 一般bloat处理所需磁盘空闲空间是对象size的2倍,所以处理前必须先关注空闲磁盘空间大小。
  4. 注意pg_repack版本对Pg版本的支持情况,9.6截至2016-11-26仍未支持,详见http://pgxn.org/dist/pg_repack/doc/pg_repack.html#Releases
  5. 处理存在在线交易的表或者索引对象的bloat时,注意设置超时参数--wait-timeout,一般设置为1800或3600(特别感谢李海龙建议)。

特别声明:本说明只针对此次测试环境,在生产环境要在业务低峰时期运行,为了保证系统数据安全,建议先备份数据,然后做膨胀处理

时间: 2024-10-15 19:08:13

pg_repack bloat 处理测试初步的相关文章

ios的单眼测试OCUnit以及OCTest测试初步

1.首先创建一个应用或者打开一个已经存在的应用程序用于测试. 2.打开相应的test文件,一般都会有了的xcode5.0之后. 如上如:我们可以看到一个text中的测试文件,现在一般都是继承了XCTestCase这个测试的基类.修改一句代码,如代码区中的黄色的那一句,因为它默认有一句是显示错误的代码,如果运行测试的话,会显示测试失败的.改了之后就会测试成功.eg:执行cmd+U或者咋菜单中找执行. 运行之后的结果: 这样就创建见了一个简单的XCTest(OCUnit)测试,它们之间的关系,后面会

freetype显示矢量字体 -- 在PC上测试初步使用

解压freetype-2.4.10.tar.bz2, 重命名为freetype-2.4.10_pc放入01th_pc目录下. 进入目录配置:./configure 编译:make 安装:sudo make install 编译应用程序:example.cgcc -o example1 example1.c -I /usr/local/include/freetype2 -lfreetype -lmgcc编译参数设置           -I     +头文件目录             库文件 

使用locust对设备ID的生成逻辑的并发测试初步实践

项目背景:现阶段我们项目主要有两大场景,一是交易风控,二是账户风控,两大的场景的很多规则都和设备ID有关,比如设备黑名单,设备A在黑名单库并且相关规则开启,设备A请求交易时就会有预警事件发生,所以设备ID的生成逻辑至关重要,主要和A.B.C 三大因素有关,大概如下: 1.同A,不管后面的B,C是否不一致首先根据传入消息的A ,到ES中查询 如果存在相同的则用原A的设备ID(DeviceID)2.不同A1)B一样,C不一样,则用原B的设备ID(DeviceID)2)C一样,B不一样,则用原C的设备

Google Test测试框架分析

Google Test测试框架分析 一.简介 Google Test是由Google主导的一个开源的C++自动化测试框架,简称GTest.GTest基于xUnit单元测试体系,和CppUint类似,可以看作是JUnit.PyUnit等对C++的移植. 下图是GTest测试框架的测试过程,表示的是GTest的两种测试方式. 下面将使用一个极其简单的例子表示xUnit测试的主要过程.如对Hummer的CTXString类的成员方法GetLength进行测试.详见下面GTest代码和注释说明. //

测试基于salt-ssh的密码及密钥

这里先记录下下今天对salt-ssh关于密码以密钥的测试情况(后期完善) 操作系统版本: [[email protected] ~]# cat /etc/redhat-release  CentOS release 6.7 (Final) 主机信息: master: 10.10.10.140(安装salt-ssh) node01: 10.10.10.141 node01:10.10.10.142 基于密码验证的测试过程: a.安装epel源以及salt-ssh [[email protected

“类名称”+“::”调用方式

注: 对静态函数或静态成员的调用方式不做分析: 以下提到的测试环境为vc6.0: 调试程序时看到这样的代码: 1 pObj->ClassName::Function(); 开始不理解为什么要在“->”后加上类名“ClassName::”,一般使用中类名称加“::”(ClassName::)是用来调用静态函数或静态成员的,带着疑问做了下尝试. 定义类A: 1 class A 2 { 3 public: 4 void Test() 5 { 6 int nVal= 8; 7 int nVal1 =

总结:基于Oracle Logminer数据同步

第 1 页 共 20 页 出自石山园主,博客地址:http://www.cnblogs.com/shishanyuan LogMiner 配置使用手册 1 Logminer 简介 1.1 LogMiner介绍 Oracle LogMiner 是 Oracle 公司从产品 8i 以后提供的一个实际非常有用的分析工具,使用该工具可以轻松获得 Oracle 在线/归档日志文件中的具体内容,特别是该工具可以分析出所有对于数据库操作的 DML 和 DDL 语句.该工具特别适用于调试.审计或者回退某个特定的

Quick Cocos2dx Http通讯

服务端:Python 通讯协议:Http 参考文章: 1 用python实现一个基本的http server服务器 http://blog.sina.com.cn/s/blog_416e30630100gjyk.html 2 http://stackoverflow.com/questions/8470414/strange-jquery-error-code-501-message-unsupported-method-options 由于是照着刀塔传奇的思路来做的,刀塔传奇是无需进行常连接的

MVC 树节点Table格式授权

这几夜心里颇不平静, 奈何 JS水平有限,前台效果耗时四天,后台传值一天,直至昨夜丑时测试初步完成,其实就是一个给tree来授权,网上开源的插件很多,如treejs.easyui 等等,只是这里授权稍有不同,如下图,只能放在Table中去实现.一行一行的写js,最后写的差不多有个100多行. 项目原界面不方便截图,这里随手写个原生态的 Demo 如图所示,首先这是一个Table,无论枝节点还是叶节点都作为一行(tr),功能菜单列表中叶节点(无分支) 后对应新增.修改等六个功能(复选框) 先来说说