-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
856 lines (561 loc) · 44 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hm's Blog</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="python、vim">
<meta property="og:type" content="website">
<meta property="og:title" content="Hm's Blog">
<meta property="og:url" content="http://huangming.github.io/index.html">
<meta property="og:site_name" content="Hm's Blog">
<meta property="og:description" content="python、vim">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Hm's Blog">
<meta name="twitter:description" content="python、vim">
<meta name="twitter:creator" content="@hmorz">
<link rel="alternative" href="/atom.xml" title="Hm's Blog" type="application/atom+xml">
<link rel="icon" href="/favicon.png">
<!-- <link href="//fonts.googleapis.com/css?family=Source+Code+Pro" rel="stylesheet" type="text/css"> -->
<link rel="stylesheet" href="/css/font-awesome.min.css">
<link href="/css/font-quigleywiggly.css" rel="Stylesheet" type="text/css" />
<link rel="stylesheet" href="/css/style.css" type="text/css">
<script src="/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="/js/girls.js" type="text/javascript"></script>
<script type="text/javascript" charset="utf-8" src="/js/weather.js"></script>
<link href="http://huangming.github.io/stylesheets/main.css" rel="stylesheet" media="all"/>
<link href="http://huangming.github.io/images/weather/default/julying-weather.css" rel="stylesheet" media="all"/>
<!--
-->
</head>
<body>
<div id="container">
<div id="wrap">
<header id="header">
<div id="banner"></div>
<div id="header-outer" class="outer">
<div id="header-title" class="inner">
<h1 id="logo-wrap">
<a href="/" id="logo">Hm's Blog</a>
</h1>
<h2 id="subtitle-wrap">
<a href="/" id="subtitle">I am here</a>
</h2>
</div>
<div id="header-inner" class="inner">
<nav id="main-nav">
<a id="main-nav-toggle" class="nav-icon"></a>
<a class="main-nav-link" href="/">Home</a>
<a class="main-nav-link" href="/archives">Archives</a>
<a class="main-nav-link" href="/vimwiki">Wiki</a>
</nav>
<nav id="sub-nav">
<a id="nav-rss-link" class="nav-icon" href="/atom.xml" title="RSS Feed"></a>
<a id="nav-search-btn" class="nav-icon" title="Search"></a>
<div id="search-form-wrap">
<form action="//google.com/search" method="get" accept-charset="UTF-8" class="search-form"><input type="search" name="q" results="0" class="search-form-input" placeholder="Search"><button type="submit" class="search-form-submit"></button><input type="hidden" name="sitesearch" value="http://huangming.github.io"></form>
</div>
</nav>
</div>
</div>
</header>
<div class="outer">
<section id="main">
<article id="post-oracle-ora00020" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-12-27-oracle-ora00020.html" class="article-date">
<time datetime="2016-12-27T04:03:57.000Z" itemprop="datePublished">2016-12-27</time>
</a> -->
<!-- -->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-12-27-oracle-ora00020.html">Oracle无法登陆:ORA-00020</a>
</h1>
<div class="article-meta">
<a href="/2016-12-27-oracle-ora00020.html" class="article-date">
<time datetime="2016-12-27T04:03:57.000Z" itemprop="datePublished">2016-12-27</time>
</a>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p>转自:<a href="http://blog.itpub.net/22621861/viewspace-1280235/" target="_blank" rel="external">http://blog.itpub.net/22621861/viewspace-1280235/</a></p>
<p>登录Oracle数据库,结果报ORA-00020: maximum number of processes (%s) exceeded错误。</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">select</span> username,<span class="keyword">count</span>(sid) <span class="keyword">from</span> v$<span class="keyword">session</span> <span class="keyword">group</span> <span class="keyword">by</span> username;</span></span><br><span class="line">USERNAME COUNT(SID)</span><br><span class="line"><span class="comment">------------------------------ ----------</span></span><br><span class="line"> 21</span><br><span class="line">SYSMAN 124</span><br><span class="line">SYS 1</span><br></pre></td></tr></table></figure>
<p>发现SYSMAN用户有大量会话数,后发现SYSMAN主要用的PROGRAM是OMS。</p>
<p>查阅OMS相关信息,得知其是由Enterprise Management产生的。</p>
<p>关闭EM,CMD下执行:</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">emctl stop dbconsole</span><br></pre></td></tr></table></figure>
<p>确保下次启动默认不启动EM,需要在Windows服务中关闭OracleDBConsoleORCL服务的自动启动。</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-12-27-oracle-ora00020.html" data-id="cixmol2zo0004ewfufntctfta" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-12-27-oracle-ora00020.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/oracle/">oracle</a></li></ul>
</footer>
</div>
</article>
<article id="post-dokuwiki-nginx" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-12-17-dokuwiki-nginx.html" class="article-date">
<time datetime="2016-12-17T12:56:06.000Z" itemprop="datePublished">2016-12-17</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/www/">www</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-12-17-dokuwiki-nginx.html">Windows下用Nginx部署DokuWiki</a>
</h1>
<div class="article-meta">
<a href="/2016-12-17-dokuwiki-nginx.html" class="article-date">
<time datetime="2016-12-17T12:56:06.000Z" itemprop="datePublished">2016-12-17</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/www/">www</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p><a href="https://www.dokuwiki.org/dokuwiki#">DokuWiki</a> 是一个使用,用途多样的开源 Wiki 软件,并且不需要数据库。部署Dokuwiki需要一个支持PHP的Webserver。通过nginx+php可以简单部署使用。<br><a href="http://nginx.org/en/">Nginx</a> (“engine x”) 是一个高性能的HTTP和反向代理服务器,也是一个IMAP/POP3/SMTP服务器。<br>本文环境:<code>windows10 64位</code>+<code>nginx1.11.7</code>+<code>php-5.6.29-Win32-VC11-x64</code></p>
<h2 id="下载解压软件">下载解压软件</h2><p>用到的软件均是绿色版,不用安装解压即可使用: </p>
<ul>
<li><a href="http://windows.php.net/downloads/releases/php-5.6.29-Win32-VC11-x64.zip">php-5.6.29-Win32-VC11-x64.zip</a> 解压到 <code>E:\OneDrive\www\php</code></li>
<li><a href="http://nginx.org/download/nginx-1.11.7.zip">nginx-1.11.7.zip</a> 解压到 <code>E:\OneDrive\www\nginx-1.11.7</code></li>
<li><a href="https://download.dokuwiki.org/src/dokuwiki/dokuwiki-stable.tgz">DokuWiki</a> 解压到 <code>E:\OneDrive\www\dokuwiki</code></li>
<li><a href="http://redmine.lighttpd.net/attachments/660/RunHiddenConsole.zip">RunHiddenConsole</a>(此程序用于隐藏nginx运行的窗口) 解压到 <code>E:\OneDrive\www\RunHiddenConsole.exe</code></li>
</ul>
<p class="article-more-link">
<a href="/2016-12-17-dokuwiki-nginx.html#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-12-17-dokuwiki-nginx.html" data-id="cixmol2zo0007ewfubqgpeor0" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-12-17-dokuwiki-nginx.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/dokuwiki/">dokuwiki</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/nginx/">nginx</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/wiki/">wiki</a></li></ul>
</footer>
</div>
</article>
<article id="post-cloud-notes-2012" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-12-03-cloud-notes-2012.html" class="article-date">
<time datetime="2016-12-03T04:03:57.000Z" itemprop="datePublished">2016-12-03</time>
</a> -->
<!-- -->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-12-03-cloud-notes-2012.html">无意翻到当年的云笔记</a>
</h1>
<div class="article-meta">
<a href="/2016-12-03-cloud-notes-2012.html" class="article-date">
<time datetime="2016-12-03T04:03:57.000Z" itemprop="datePublished">2016-12-03</time>
</a>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p>Create: Sat Nov 24 2012 07:09:37 GMT+0800 (中国标准时间)Link<br>学校举办一次中国象棋比赛,有10名同学参加,比赛采用单循环赛制,每名同学都要与其他9名同学比赛一局。比赛规则,每局棋胜者得2分,负者得0分,平局两人各得1分,比赛结束后,10名同学的得分各不相同,已知:(1)比赛第一名与第二名都是一局都没有输过;(2)前两名的得分总和比第三名多20分;(3)第四名的得分与最后四名的得分和相等。那么,排名第五名的同学的得分是?<br>A.8分 B,9分 C.10分 D.11分</p>
<p>Create: Sat Nov 24 2012 07:09:37 GMT+0800 (中国标准时间)Link<br>年度最爱电影。穆赫兰道影评是两个极端,抛去其他人的看法,自己坚持看完这部冗长的电影,而且还不知所云,只是强迫自己记住其中内容,等看完影评后用记忆串联起整部片子的时候,我深深地呼了一口气。</p>
<p>Create: Sat Nov 24 2012 07:09:37 GMT+0800 (中国标准时间)Link<br>【心理技巧:如何让人喜欢你】1、出门照照镜子,给自己一个自信的微笑;2、善于发现别人优点;3、赞美;4、主动、付出,别陪着人冷场;5、接受别人递过来的零食;6、多请人帮你小忙;7、用心倾听,不打断对方的话;8、说话有力,能感受到自己声音的感染力;9、说话之前,先考虑对方的感觉。</p>
<p class="article-more-link">
<a href="/2016-12-03-cloud-notes-2012.html#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-12-03-cloud-notes-2012.html" data-id="cixmol303000gewfuioaavtqt" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-12-03-cloud-notes-2012.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/云笔记/">云笔记</a></li></ul>
</footer>
</div>
</article>
<article id="post-oracle-auto-backup-and-restore" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-08-18-oracle-auto-backup-and-restore.html" class="article-date">
<time datetime="2016-08-18T10:41:36.000Z" itemprop="datePublished">2016-08-18</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/database/">database</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-08-18-oracle-auto-backup-and-restore.html">oracle自动备份同步</a>
</h1>
<div class="article-meta">
<a href="/2016-08-18-oracle-auto-backup-and-restore.html" class="article-date">
<time datetime="2016-08-18T10:41:36.000Z" itemprop="datePublished">2016-08-18</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/database/">database</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p>oracle的简单导入导出工具一般有 <code>exp/imp</code> 跟 <code>expdp/impdp</code>。</p>
<ul>
<li>exp无法导出空表结构</li>
<li>exp可以导出long类型的数据,expdp不可以。long类型现在在慢慢被淘汰中。</li>
<li>exp是客户端工具,expdp是服务器端工具,expdp还可以并发,exp不可以</li>
</ul>
<p>使用exp导出而不是expdp的情况是无法直接访问数据库主机,也无法在建立dblink,这个时候只能使用exp导出。大部分情况还是用 expdp/impdp。exp无法导出空表不注意的话是很麻烦的,曾经做同步就因为这个原因导致应用无法使用,虽然网上也有一些解决办法,但是都需要对源库做一些变更,这对生产服务器来说还是很麻烦的,毕竟操作了就有风险要负责任。下面是用expdp/impdp自动同步生产跟测试库的范例。</p>
<h2 id="环境">环境</h2><p>源库跟目的库的Oracle大版本要一致,并且数据库SID要一样。<br>本文测试环境:</p>
<ul>
<li>源库操作系统 <code>windows server 2008 R2 x64</code><br>源库数据库版本 <code>11g Enterprise Edition Release 11.2.0.1.0 - 64bit</code></li>
<li>目的库操作系统 <code>win7 x64</code> <code>win10 x64</code> <code>windows server 2008 R2 x64</code> 均测试成功<br>目的库数据库版本 <code>11g Enterprise Edition Release 11.2.0.1.0 - 64bit</code></li>
</ul>
<p>查看版本:</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">select</span> banner <span class="keyword">from</span> sys.v_$<span class="keyword">version</span>;</span></span><br></pre></td></tr></table></figure>
<p class="article-more-link">
<a href="/2016-08-18-oracle-auto-backup-and-restore.html#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-08-18-oracle-auto-backup-and-restore.html" data-id="cixmol30y000jewfufdv98b02" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-08-18-oracle-auto-backup-and-restore.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/backup/">backup</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/expdp/">expdp</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/impdp/">impdp</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/oracle/">oracle</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/oracle热备/">oracle热备</a></li></ul>
</footer>
</div>
</article>
<article id="post-python-zhengze-pachong-qiubai" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-08-06-python-zhengze-pachong-qiubai.html" class="article-date">
<time datetime="2016-08-06T08:25:54.000Z" itemprop="datePublished">2016-08-06</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/python/">python</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-08-06-python-zhengze-pachong-qiubai.html">Python爬虫正则表达式抓取糗百笑话</a>
</h1>
<div class="article-meta">
<a href="/2016-08-06-python-zhengze-pachong-qiubai.html" class="article-date">
<time datetime="2016-08-06T08:25:54.000Z" itemprop="datePublished">2016-08-06</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/python/">python</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p>很多人对正则表达式很头痛,其实写正则表达式是有套路的,看完这篇文章保证你会写任何html上的内容抓取的正则。<br>为确保代码的正确性,此文约定环境为python3,如果在python2运行,可能要做一些调整。</p>
<p class="article-more-link">
<a href="/2016-08-06-python-zhengze-pachong-qiubai.html#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-08-06-python-zhengze-pachong-qiubai.html" data-id="cixmol30y000vewfu27wemf1r" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-08-06-python-zhengze-pachong-qiubai.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/">python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/正则/">正则</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/爬虫/">爬虫</a></li></ul>
</footer>
</div>
</article>
<article id="post-ssh-upload-dir-to-linux-vps-by-scp" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-06-25-ssh-upload-dir-to-linux-vps-by-scp.html" class="article-date">
<time datetime="2016-06-25T06:34:51.000Z" itemprop="datePublished">2016-06-25</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/vps/">vps</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-06-25-ssh-upload-dir-to-linux-vps-by-scp.html">SSH通过SCP命令上传文件夹到linux系统的vps</a>
</h1>
<div class="article-meta">
<a href="/2016-06-25-ssh-upload-dir-to-linux-vps-by-scp.html" class="article-date">
<time datetime="2016-06-25T06:34:51.000Z" itemprop="datePublished">2016-06-25</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/vps/">vps</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<h2 id="环境">环境</h2><p>mingw2.0.3</p>
<figure class="highlight sh"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">$ scp -P <span class="number">26443</span> -r /E/OneDrive/GitRepository/ItChat_old root@<span class="number">23.105</span>.<span class="number">203</span>.**:~/ItChat</span><br><span class="line">root@<span class="number">23.105</span>.<span class="number">203</span>.**<span class="string">'s password:</span><br><span class="line">config 100% 397 0.4KB/s 00:00</span><br><span class="line">description 100% 73 0.1KB/s 00:00</span><br><span class="line">HEAD 100% 24 0.0KB/s 00:00</span><br><span class="line">applypatch-msg.sample 100% 478 0.5KB/s 00:00</span><br><span class="line">commit-msg.sample 100% 896 0.9KB/s 00:00</span><br><span class="line">post-update.sample 100% 189 0.2KB/s 00:00</span></span><br></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-06-25-ssh-upload-dir-to-linux-vps-by-scp.html" data-id="cixmol31e0014ewfuxx1746tm" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-06-25-ssh-upload-dir-to-linux-vps-by-scp.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/linux/">linux</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/ssh/">ssh</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/vps/">vps</a></li></ul>
</footer>
</div>
</article>
<article id="post-python-excel" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-05-31-python-excel.html" class="article-date">
<time datetime="2016-05-31T14:56:05.000Z" itemprop="datePublished">2016-05-31</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/python/">python</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-05-31-python-excel.html">Python调用dll动态链接库操作excel</a>
</h1>
<div class="article-meta">
<a href="/2016-05-31-python-excel.html" class="article-date">
<time datetime="2016-05-31T14:56:05.000Z" itemprop="datePublished">2016-05-31</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/python/">python</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p>这是一篇Python调用动态链接库的标准示范。</p>
<h2 id="原理">原理</h2><p>其实不管什么语言调用dll的流程都是一样的:先注册dll到操作系统,然后获取到初始化的dll对象,然后就可以调用dll的各种api接口了。</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br></pre></td><td class="code"><pre><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">register</span><span class="params">()</span>:</span></span><br><span class="line"> <span class="string">'''注册插件</span><br><span class="line"> '''</span></span><br><span class="line"> pythoncom.CoInitialize()</span><br><span class="line"> command = <span class="string">"regsvr32 /s atl.dll"</span></span><br><span class="line"> os.system(command)</span><br><span class="line"> <span class="keyword">try</span>:</span><br><span class="line"> lx = win32com.client.Dispatch(<span class="string">'Lazy.LxjExcel'</span>)</span><br><span class="line"> <span class="keyword">except</span> pywintypes.com_error:</span><br><span class="line"> command = <span class="string">'regsvr32 /s LazyOffice.dll'</span></span><br><span class="line"> <span class="keyword">if</span> os.system(command) == <span class="number">0</span>:</span><br><span class="line"> lx = win32com.client.Dispatch(<span class="string">'Lazy.LxjExcel'</span>)</span><br><span class="line"> <span class="keyword">return</span> lx</span><br><span class="line"> <span class="keyword">else</span>:</span><br><span class="line"> self.log.error(<span class="string">'regsver32 error'</span>)</span><br><span class="line"> <span class="keyword">else</span>:</span><br><span class="line"> <span class="keyword">return</span> lx</span><br></pre></td></tr></table></figure>
<p>这段代码是python调用dll的标准代码。别的dll也可以用这个调用。其中<code>LazyOffice.dll</code>是操作excel的dll文件,<code>Lazy.LxjExcel</code>是初始化的操作excel的对象,该对象由dll的编写作者提供。</p>
<p>然后就能通过返回的lx调用这个dll内部封装的接口啦:<code>lx.ExcelOpen(path, visual)</code></p>
<p class="article-more-link">
<a href="/2016-05-31-python-excel.html#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-05-31-python-excel.html" data-id="cixmol31e001dewfu9lx3k3sc" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-05-31-python-excel.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/excel/">excel</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/">python</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/动态链接库/">动态链接库</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/自动化/">自动化</a></li></ul>
</footer>
</div>
</article>
<article id="post-python-log" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-05-29-python-log.html" class="article-date">
<time datetime="2016-05-29T05:22:14.000Z" itemprop="datePublished">2016-05-29</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/python/">python</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-05-29-python-log.html">Python logging 模块封装</a>
</h1>
<div class="article-meta">
<a href="/2016-05-29-python-log.html" class="article-date">
<time datetime="2016-05-29T05:22:14.000Z" itemprop="datePublished">2016-05-29</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/python/">python</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p>python自带的记录日志模块 <a href="https://docs.python.org/3/library/logging.html#module-logging">logging</a> 非常强大,但是每次写程序都要写很多东西来配置使用,体验不怎么友好,花时间封装在一个文件里面,用的时候直接调用,并且提供配置接口保留其强大的功能还是非常有必要的。</p>
<h2 id="logging介绍">logging介绍</h2><p>Python的logging模块提供了通用的日志系统,可以方便第三方模块或者是应用使用。这个模块提供不同的日志级别,并可以采用不同的方式记录日志,比如文件,HTTP GET/POST,SMTP,Socket等,甚至可以自己实现具体的日志记录方式。</p>
<p>logging模块与log4j的机制是一样的,只是具体的实现细节不同。模块提供logger,handler,filter,formatter。</p>
<ul>
<li>logger:提供日志接口,供应用代码使用。</li>
<li>handler:将日志记录(log record)发送到合适的目的地(destination),比如文件,socket,cmd等。一个logger对象可以通过addHandler方法添加0到多个handler,每个handler又可以定义不同日志级别,以实现日志分级过滤显示。每个handler还可以单独设置自己的formatter格式。</li>
<li>filter:提供一种优雅的方式决定一个日志记录是否发送到handler。</li>
<li>formatter:指定日志记录输出的具体格式。</li>
</ul>
<p>与log4j类似,logger,handler和日志消息的调用可以有具体的日志级别(Level),只有在日志消息的级别大于logger和handler的级别才会呈现。</p>
<p>默认的日志级别设置为<code>WARNING</code>(日志级别等级<code>CRITICAL</code> > <code>ERROR</code> > <code>WARNING</code> > <code>INFO</code> > <code>DEBUG</code> > <code>NOTSET</code>), 小于WARNING级别的日志都不输出, 大于等于WARNING级别的日志都会输出。<br>
<p class="article-more-link">
<a href="/2016-05-29-python-log.html#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-05-29-python-log.html" data-id="cixmol31e001mewfu4hcuszrb" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-05-29-python-log.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/log/">log</a></li><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/python/">python</a></li></ul>
</footer>
</div>
</article>
<article id="post-oracle-rebuild-temp-tablespace" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-05-25-oracle-rebuild-temp-tablespace.html" class="article-date">
<time datetime="2016-05-25T06:42:57.000Z" itemprop="datePublished">2016-05-25</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/database/">database</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-05-25-oracle-rebuild-temp-tablespace.html">Oracle收缩临时表空间</a>
</h1>
<div class="article-meta">
<a href="/2016-05-25-oracle-rebuild-temp-tablespace.html" class="article-date">
<time datetime="2016-05-25T06:42:57.000Z" itemprop="datePublished">2016-05-25</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/database/">database</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">SQL> alter tablespace temp shrink space;</span><br><span class="line">表空间已更改。</span><br></pre></td></tr></table></figure>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-05-25-oracle-rebuild-temp-tablespace.html" data-id="cixmol31u001rewfukw01xnuf" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-05-25-oracle-rebuild-temp-tablespace.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/oracle/">oracle</a></li></ul>
</footer>
</div>
</article>
<article id="post-oracle-cold-backup" class="article article-type-post" itemscope itemprop="blogPost">
<!-- <div class="article-meta"> -->
<!-- <a href="/2016-05-21-oracle-cold-backup.html" class="article-date">
<time datetime="2016-05-21T12:41:46.000Z" itemprop="datePublished">2016-05-21</time>
</a> -->
<!--
<div class="article-category">
<a class="article-category-link" href="/categories/database/">database</a>
</div>
-->
<!-- </div> -->
<div class="article-inner">
<header class="article-header">
<h1 itemprop="name">
<a class="article-title" href="/2016-05-21-oracle-cold-backup.html">Oracle冷备与恢复</a>
</h1>
<div class="article-meta">
<a href="/2016-05-21-oracle-cold-backup.html" class="article-date">
<time datetime="2016-05-21T12:41:46.000Z" itemprop="datePublished">2016-05-21</time>
</a>
<div class="article-category">
<a class="article-category-link" href="/categories/database/">database</a>
</div>
</div>
</header>
<div class="article-entry" itemprop="articleBody">
<p>冷备恢复是oracle最快捷方便安全的恢复、拷贝方式。他只有一个缺点:冷备的时候要关闭源库。冷备特别适合搭建跟生产一致的测试环境。</p>
<h2 id="环境">环境</h2><p>源库跟目的库的Oracle大版本要一致,并且数据库SID要一样。<br>本文测试环境:</p>
<ul>
<li>源库操作系统 <code>windows server 2008 R2 x64</code><br>源库数据库版本 <code>11g Enterprise Edition Release 11.2.0.1.0 - 64bit</code></li>
<li>目的库操作系统 <code>win7 x64</code> <code>win10 x64</code> <code>windows server 2008 R2 x64</code> 均测试成功<br>目的库数据库版本 <code>11g Enterprise Edition Release 11.2.0.1.0 - 64bit</code></li>
</ul>
<p>查看版本:</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="operator"><span class="keyword">select</span> banner <span class="keyword">from</span> sys.v_$<span class="keyword">version</span>;</span></span><br></pre></td></tr></table></figure>
<p class="article-more-link">
<a href="/2016-05-21-oracle-cold-backup.html#more">Read More</a>
</p>
</div>
<footer class="article-footer">
<!-- <a data-url="http://huangming.github.io/2016-05-21-oracle-cold-backup.html" data-id="cixmol31u001uewfuqg9n0epk" class="article-share-link">Share</a> -->
<a href="http://huangming.github.io/2016-05-21-oracle-cold-backup.html#disqus_thread" class="article-comment-link">Comments</a>
<ul class="article-tag-list"><li class="article-tag-list-item"><a class="article-tag-list-link" href="/tags/oracle/">oracle</a></li></ul>
</footer>
</div>
</article>
<nav id="page-nav">
<span class="page-number current">1</span><a class="page-number" href="/page/2/">2</a><a class="page-number" href="/page/3/">3</a><span class="space">…</span><a class="page-number" href="/page/5/">5</a><a class="extend next" rel="next" href="/page/2/">Next »</a>
</nav>
</section>
</div>
<footer id="footer">
<aside id="sidebar" class="outer">
<div class="widget-wrap">
<h3 class="widget-title">Categories</h3>
<div class="widget">
<ul class="category-list"><li class="category-list-item"><a class="category-list-link" href="/categories/Vim/">Vim</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/blog/">blog</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/database/">database</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/diary/">diary</a><span class="category-list-count">33</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/other/">other</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/python/">python</a><span class="category-list-count">3</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/vps/">vps</a><span class="category-list-count">1</span></li><li class="category-list-item"><a class="category-list-link" href="/categories/www/">www</a><span class="category-list-count">1</span></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Tags</h3>
<div class="widget">
<ul class="tag-list"><li class="tag-list-item"><a class="tag-list-link" href="/tags/backup/">backup</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/dokuwiki/">dokuwiki</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/excel/">excel</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/expdp/">expdp</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/hexo/">hexo</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/impdp/">impdp</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/linux/">linux</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/log/">log</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/markdown/">markdown</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/nginx/">nginx</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/oracle/">oracle</a><span class="tag-list-count">4</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/oracle热备/">oracle热备</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/python/">python</a><span class="tag-list-count">3</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/ssh/">ssh</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/vps/">vps</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/wiki/">wiki</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/云笔记/">云笔记</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/动态链接库/">动态链接库</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/正则/">正则</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/爬虫/">爬虫</a><span class="tag-list-count">1</span></li><li class="tag-list-item"><a class="tag-list-link" href="/tags/自动化/">自动化</a><span class="tag-list-count">1</span></li></ul>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Tag Cloud</h3>
<div class="widget tagcloud">
<a href="/tags/backup/" style="font-size: 10px;">backup</a> <a href="/tags/dokuwiki/" style="font-size: 10px;">dokuwiki</a> <a href="/tags/excel/" style="font-size: 10px;">excel</a> <a href="/tags/expdp/" style="font-size: 10px;">expdp</a> <a href="/tags/hexo/" style="font-size: 10px;">hexo</a> <a href="/tags/impdp/" style="font-size: 10px;">impdp</a> <a href="/tags/linux/" style="font-size: 10px;">linux</a> <a href="/tags/log/" style="font-size: 10px;">log</a> <a href="/tags/markdown/" style="font-size: 10px;">markdown</a> <a href="/tags/nginx/" style="font-size: 10px;">nginx</a> <a href="/tags/oracle/" style="font-size: 20px;">oracle</a> <a href="/tags/oracle热备/" style="font-size: 10px;">oracle热备</a> <a href="/tags/python/" style="font-size: 15px;">python</a> <a href="/tags/ssh/" style="font-size: 10px;">ssh</a> <a href="/tags/vps/" style="font-size: 10px;">vps</a> <a href="/tags/wiki/" style="font-size: 10px;">wiki</a> <a href="/tags/云笔记/" style="font-size: 10px;">云笔记</a> <a href="/tags/动态链接库/" style="font-size: 10px;">动态链接库</a> <a href="/tags/正则/" style="font-size: 10px;">正则</a> <a href="/tags/爬虫/" style="font-size: 10px;">爬虫</a> <a href="/tags/自动化/" style="font-size: 10px;">自动化</a>
</div>
</div>
<div class="widget-wrap">
<h3 class="widget-title">Recents</h3>
<div class="widget">
<ul>
<li>
<a href="/2016-12-27-oracle-ora00020.html">Oracle无法登陆:ORA-00020</a>
</li>
<li>
<a href="/2016-12-17-dokuwiki-nginx.html">Windows下用Nginx部署DokuWiki</a>
</li>
<li>
<a href="/2016-12-03-cloud-notes-2012.html">无意翻到当年的云笔记</a>
</li>
<li>
<a href="/2016-08-18-oracle-auto-backup-and-restore.html">oracle自动备份同步</a>
</li>
<li>
<a href="/2016-08-06-python-zhengze-pachong-qiubai.html">Python爬虫正则表达式抓取糗百笑话</a>
</li>
</ul>
</div>
</div>
</aside>
<div class="outer">
<div id="footer-info" class="inner">
© 2017 Mingo<br>
Powered by <a href="http://hexo.io/" target="_blank">Hexo</a>
</div>
</div>
</footer>
</div>
<nav id="mobile-nav">
<a href="/" class="mobile-nav-link">Home</a>
<a href="/archives" class="mobile-nav-link">Archives</a>
<a href="/vimwiki" class="mobile-nav-link">Wiki</a>
</nav>
<script>
var disqus_shortname = 'huangming';
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = '//'+disqus_shortname + '.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.3/jquery.min.js"></script> -->
<script src="/js/script.js" type="text/javascript"></script>
<script type="text/javascript">
var myDate = new Date()
var m = myDate.getMinutes()
m = m % 10
document.body.style.background = '#333 url("/css/images/bgr'+m+'.jpg") top left'
document.getElementById('wrap').style.background='#333 url("/css/images/bgr'+m+'.jpg") top left'
</script>
</div>
<div id="spig" class="spig">
<div id="message">正在加载中……</div>
<div id="mumu" class="mumu"></div>
</div>
</body>
</html>