Monthly Archive: 八月 2015

mysql使用存储过程生成测试数据

声明存过

# pre delete
drop procedure insert_parquet;

#declare procedure
delimiter @
create procedure insert_parquet(in item integer)
begin
declare counter int;
set counter = item;
while counter >= 1 do
insert into parquet values(counter,concat('company',counter),counter+0.1,CURTIME());
set counter = counter - 1;
end while;
end
@
delimiter ;

测试使用

mysql> truncate table parquet;
Query OK, 0 rows affected

mysql> call insert_parquet(1000000);<br>Query OK, 1 row affected (50 min 18.30 sec)<br>

生成了100w条数据。还挺快,不到1小时完成。

 

 

 

RedHat使用vnc远程显示桌面

安装vncserver

[root@test~]# yum install vnc-server

 

配置vnc

[root@test ~]# vim /etc/sysconfig/vncservers 

 VNCSERVERS="2:root"
 VNCSERVERARGS[2]="-geometry 800x600 -nolisten tcp -localhost"

 

启动vnc

[root@abmdev01 ~]# vncserver 

You will require a password to access your desktops.

Password:
Verify:
Passwords don't match - try again
Password:
Verify:

New 'abmdev01:1 (root)' desktop is abmdev01:1

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/abmdev01:1.log

使用客户端连接

QQ截图20150804171734

 

关闭vnc连接

[root@test~]# vncserver -list

TigerVNC server sessions:

X DISPLAY #     PROCESS ID
:1              6069
:2              6487
[root@test~]# vncserver -kill :1
Killing Xvnc process ID 6069
[root@test~]# vncserver -kill :2
Killing Xvnc process ID 6487

关闭vnc服务

[root@test~]# service vncserver stop