-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2016-08-18-oracle-auto-backup-and-restore.html
346 lines (245 loc) · 51.4 KB
/
2016-08-18-oracle-auto-backup-and-restore.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>oracle自动备份同步 | Hm's Blog</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="description" content="oracle的简单导入导出工具一般有 exp/imp 跟 expdp/impdp。
exp无法导出空表结构
exp可以导出long类型的数据,expdp不可以。long类型现在在慢慢被淘汰中。
exp是客户端工具,expdp是服务器端工具,expdp还可以并发,exp不可以
使用exp导出而不是expdp的情况是无法直接访问数据库主机,也无法在建立dblink,这个时候只能使用exp导出。大部">
<meta property="og:type" content="article">
<meta property="og:title" content="oracle自动备份同步">
<meta property="og:url" content="http://huangming.github.io/2016-08-18-oracle-auto-backup-and-restore.html">
<meta property="og:site_name" content="Hm's Blog">
<meta property="og:description" content="oracle的简单导入导出工具一般有 exp/imp 跟 expdp/impdp。
exp无法导出空表结构
exp可以导出long类型的数据,expdp不可以。long类型现在在慢慢被淘汰中。
exp是客户端工具,expdp是服务器端工具,expdp还可以并发,exp不可以
使用exp导出而不是expdp的情况是无法直接访问数据库主机,也无法在建立dblink,这个时候只能使用exp导出。大部">
<meta property="og:updated_time" content="2016-12-20T01:14:12.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="oracle自动备份同步">
<meta name="twitter:description" content="oracle的简单导入导出工具一般有 exp/imp 跟 expdp/impdp。
exp无法导出空表结构
exp可以导出long类型的数据,expdp不可以。long类型现在在慢慢被淘汰中。
exp是客户端工具,expdp是服务器端工具,expdp还可以并发,exp不可以
使用exp导出而不是expdp的情况是无法直接访问数据库主机,也无法在建立dblink,这个时候只能使用exp导出。大部">
<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-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 class="article-title" itemprop="name">
oracle自动备份同步
</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>
<a id="more"></a>
<h2 id="源库导出">源库导出</h2><p>在源库机器(假定SID名为ORCL)执行以下操作:</p>
<h3 id="1-_打开CMD,用sysdba登录数据库。">1. 打开CMD,用sysdba登录数据库。</h3><p>有些操作系统安装了不止一个数据库实例,为了确保操作的是源库,在CMD命令行中先执行一次<code>set ORACLE_SID=ORCL</code>:<br> <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"><span class="built_in">set</span> ORACLE_SID=ORCL</span><br><span class="line">sqlplus / as sysdba</span><br></pre></td></tr></table></figure></p>
<p>先检查一下登录的数据库:<br> <figure class="highlight bash"><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></pre></td><td class="code"><pre><span class="line">SQL> select instance_name from v<span class="variable">$instance</span>;</span><br><span class="line">INSTANCE_NAME</span><br><span class="line">----------------</span><br><span class="line">orcl</span><br></pre></td></tr></table></figure></p>
<h3 id="2-_新建directory(首次导出才要)。">2. 新建directory(首次导出才要)。</h3><pre><code><span class="comment"><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">SQL> create directory dump_dir as <span class="string">'D:\dump'</span>; </span><br><span class="line">SQL> grant all on directory dump_dir to <span class="built_in">test</span>; </span><br><span class="line">SQL> select * from dba_directories;</span><br></pre></td></tr></table></figure></span>
</code></pre><h3 id="3-_执行导出操作。">3. 执行导出操作。</h3><p>此操作再CMD中执行,不是登录到SQLPLUS里面。可用<code>Ctrl+C</code>退出SQLPLUS。<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">expdp system/manager@ORCL directory=dump_dir dumpfile=expdp_orcl_full.dmp logfile=expdp_orcl_full.log FULL=y;</span><br></pre></td></tr></table></figure></p>
<p>导出完成后,在<code>D:\dump</code>里面就能看到文件了,然后拷贝到目标机器的<code>director</code>路径里面。</p>
<h2 id="目的库导入">目的库导入</h2><p>首次导入同源库导出1、2步骤操作,这里省略。<br>因为目的库已经有各种用户对象了,不确定这些已存在对象会不会影响导入结果,所以这边先进行删除对象操作,然后再进行导入操作,最后重新编译一下一些存储过程等。</p>
<h3 id="1-删除对象">1.删除对象</h3><p>先创建删除对象的脚本,CMD下执行:<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlplus system/manager@ORCL @d:\orcl_build_drop_sql.sql</span><br></pre></td></tr></table></figure></p>
<p>其中,<code>orcl_build_drop_sql.sql</code> 如下:<br> <figure class="highlight bash"><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><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line">-- d:\orcl_build_drop_sql.sql</span><br><span class="line"><span class="built_in">set</span> feedback off heading off verify off trimspool off </span><br><span class="line"><span class="built_in">set</span> pagesize <span class="number">0</span> linesize <span class="number">100</span> </span><br><span class="line">define v_spool =<span class="string">'d:\orcl_drop_objects.sql'</span> </span><br><span class="line">spool &v_spool </span><br><span class="line"> SELECT <span class="string">'DROP PACKAGE BODY '</span>|| OWNER ||<span class="string">'.'</span>|| OBJECT_NAME ||<span class="string">';'</span> FROM ALL_OBJECTS WHERE OBJECT_TYPE=<span class="string">'PACKAGE BODY'</span> AND OWNER IN ((<span class="string">'DBUSER1'</span>,<span class="string">'DBUSER2'</span>))</span><br><span class="line"> union all</span><br><span class="line"> SELECT <span class="string">'DROP PACKAGE '</span>|| OWNER ||<span class="string">'.'</span>|| OBJECT_NAME ||<span class="string">';'</span> FROM ALL_OBJECTS WHERE OBJECT_TYPE=<span class="string">'PACKAGE'</span> AND OWNER IN ((<span class="string">'DBUSER1'</span>,<span class="string">'DBUSER2'</span>))</span><br><span class="line"> union all</span><br><span class="line"> SELECT <span class="string">'DROP PROCEDURE '</span>|| OWNER ||<span class="string">'.'</span>|| OBJECT_NAME ||<span class="string">';'</span> FROM ALL_OBJECTS WHERE OBJECT_TYPE=<span class="string">'PROCEDURE'</span> AND OWNER IN ((<span class="string">'DBUSER1'</span>,<span class="string">'DBUSER2'</span>))</span><br><span class="line"> union all</span><br><span class="line"> SELECT <span class="string">'DROP FUNCTION '</span>|| OWNER ||<span class="string">'.'</span>|| OBJECT_NAME ||<span class="string">';'</span> FROM ALL_OBJECTS WHERE OBJECT_TYPE=<span class="string">'FUNCTION'</span> AND OWNER IN ((<span class="string">'DBUSER1'</span>,<span class="string">'DBUSER2'</span>))</span><br><span class="line"> union all</span><br><span class="line"> SELECT <span class="string">'DROP SEQUENCE '</span>|| SEQUENCE_OWNER ||<span class="string">'.'</span>|| SEQUENCE_NAME ||<span class="string">';'</span> FROM ALL_SEQUENCES WHERE SEQUENCE_OWNER IN ((<span class="string">'DBUSER1'</span>,<span class="string">'DBUSER2'</span>))</span><br><span class="line"> union all</span><br><span class="line"> SELECT <span class="string">'DROP VIEW '</span>|| OWNER ||<span class="string">'.'</span>|| VIEW_NAME ||<span class="string">';'</span> FROM ALL_VIEWS WHERE OWNER IN ((<span class="string">'DBUSER1'</span>,<span class="string">'DBUSER2'</span>))</span><br><span class="line"> union all</span><br><span class="line"> SELECT <span class="string">'DROP TABLE '</span>|| OWNER ||<span class="string">'.'</span>|| TABLE_NAME ||<span class="string">' CASCADE CONSTRAINTS PURGE;'</span> FROM ALL_TABLES WHERE OWNER IN ((<span class="string">'DBUSER1'</span>,<span class="string">'DBUSER2'</span>))</span><br><span class="line"> union all</span><br><span class="line"> SELECT <span class="string">'exit '</span> from dual;</span><br><span class="line"></span><br><span class="line">spool off </span><br><span class="line"></span><br><span class="line"><span class="built_in">exit</span></span><br></pre></td></tr></table></figure></p>
<p>创建的删除脚本在 <code>d:\orcl_build_drop_sql.sql</code>,在CMD中执行脚本删除对象:<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlplus system/krcs@KRCS @d:\krcs_drop_objects.sql</span><br></pre></td></tr></table></figure></p>
<h3 id="2-导入操作">2.导入操作</h3><p>执行导入操作:<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">impdp system/manager@ORCL directory=dump_dir dumpfile=expdp_orcl_full.dmp logfile=impdp_orcl_full.log FULL=y;</span><br></pre></td></tr></table></figure></p>
<h3 id="3-重新编译无效对象">3.重新编译无效对象</h3><p>oracle自带脚本<code>$ORACLE_HOME/rdbms/admin/utlrp.sql</code>可重新编译无效对象。<br> <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">sqlplus system/krcs@KRCS @D:\app\Administrator\product\<span class="number">11.2</span>.<span class="number">0</span>\dbhome_1\RDBMS\ADMIN\utlrp.sql</span><br></pre></td></tr></table></figure></p>
<h2 id="汇总所有操作写成批处理自动执行">汇总所有操作写成批处理自动执行</h2><h3 id="1-源库定时导出并发送">1.源库定时导出并发送</h3><p>在源库机器新建一个任务计划,每天执行以下批处理。</p>
<figure class="highlight bash"><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><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off </span><br><span class="line">color <span class="number">0</span>b & cls </span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 设置备份文件存放文件夹... </span><br><span class="line">echo.</span><br><span class="line"><span class="built_in">set</span> <span class="string">"localexpdpdir=d:\dump"</span> </span><br><span class="line">:: 备份服务器</span><br><span class="line"><span class="built_in">set</span> <span class="string">"bk_server=\\192.168.1.1\g$"</span> </span><br><span class="line"><span class="built_in">set</span> <span class="string">"bk_server_full=\\192.168.1.1\g$\数据"</span></span><br><span class="line">:: 测试服务器<span class="number">1</span></span><br><span class="line"><span class="built_in">set</span> <span class="string">"bk_server2=\\192.168.1.2\e$\data"</span></span><br><span class="line">:: 测试服务器<span class="number">2</span></span><br><span class="line"><span class="built_in">set</span> <span class="string">"bk_server3=\\192.168.1.3\c$\temp"</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 是否存在<span class="number">2</span>天前备份文件,若存在则删除... </span><br><span class="line">echo.</span><br><span class="line">forfiles /p %localexpdpdir% /d -<span class="number">2</span> /c <span class="string">"cmd /c echo deleting @file ... && del /f /q /a @path"</span></span><br><span class="line"> </span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 设置备份文件名</span><br><span class="line">echo.</span><br><span class="line"><span class="built_in">set</span> name=%date:~<span class="number">0</span>,<span class="number">4</span>%%date:~<span class="number">5</span>,<span class="number">2</span>%%date:~<span class="number">8</span>,<span class="number">2</span>%</span><br><span class="line"><span class="built_in">set</span> name=%name%</span><br><span class="line">::<span class="built_in">set</span> name=<span class="number">20161210</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 是否存在同名文件,若存在则删除同名文件... </span><br><span class="line">echo.</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] ===========================================================</span><br><span class="line">echo.</span><br><span class="line"><span class="keyword">if</span> exist %localexpdpdir%\orcl_full_%name%.dmp del %localexpdpdir%\orcl_full_%name%.dmp</span><br><span class="line"><span class="keyword">if</span> exist %localexpdpdir%\orcl_%name%.dmp del %localexpdpdir%\orcl_%name%.dmp</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 开始备份..... </span><br><span class="line">echo.</span><br><span class="line">::select * from dba_directories;</span><br><span class="line">:: 备份两种,一种全库,一种按部分用户</span><br><span class="line">expdp system/manager@orcl directory=dump_dir dumpfile=orcl_%name%.dmp logfile=orcl_%name%.log schemas=dbuser1,dbuser2</span><br><span class="line">expdp system/manager@orcl directory=dump_dir dumpfile=orcl_full_%name%.dmp logfile=orcl_full_%name%.log FULL=y</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 备份完毕!</span><br><span class="line">echo.</span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] ===========================================================</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 拷贝备份到<span class="number">192.168</span>.<span class="number">1.1</span></span><br><span class="line">echo.</span><br><span class="line">net use O: /del</span><br><span class="line">net use O: \\<span class="number">192.168</span>.<span class="number">1.1</span>\g$ <span class="string">"psw****"</span> /user:<span class="string">"Administrator"</span></span><br><span class="line"></span><br><span class="line">:: 每周二拷贝全量备份,其余日期拷贝选定用户的备份,减少备份服务器的空间压力</span><br><span class="line"><span class="keyword">if</span> <span class="string">"%date:~13%"</span>==<span class="string">"二"</span> (</span><br><span class="line">copy %localexpdpdir%\orcl_full_%name%.dmp %bk_server_full%\orcl_full_%name%.dmp /y</span><br><span class="line">) <span class="keyword">else</span> (</span><br><span class="line">copy %localexpdpdir%\orcl_%name%.dmp %bk_server%\orcl_%name%.dmp /y</span><br><span class="line">)</span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 删除备份服务器上<span class="number">31</span>天前的全量备份</span><br><span class="line">echo.</span><br><span class="line">forfiles /p <span class="string">"o:"</span> /d -<span class="number">31</span> /c <span class="string">"cmd /c echo deleting @file ... && del /f /q /a @path"</span></span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 删除备份服务器上<span class="number">7</span>天前的选定用户数据的备份</span><br><span class="line">echo.</span><br><span class="line">forfiles /p <span class="string">"o:\数据"</span> /d -<span class="number">7</span> /c <span class="string">"cmd /c echo deleting @file ... && del /f /q /a @path"</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] ===========================================================</span><br><span class="line"></span><br><span class="line">::<span class="built_in">echo</span> 拷贝备份到<span class="number">192.168</span>.<span class="number">1.2</span></span><br><span class="line">::net use O: /del</span><br><span class="line">::net use O: \\<span class="number">192.101</span>.<span class="number">1.2</span>\e$\data <span class="string">"psw****"</span> /user:<span class="string">"Administrator"</span></span><br><span class="line">::</span><br><span class="line">::copy %localexpdpdir%\orcl_full_%name%.dmp %bk_server2%\orcl_full_%name%.dmp /y</span><br><span class="line">::<span class="built_in">echo</span> 删除备份服务器上<span class="number">2</span>天前的备份</span><br><span class="line">::forfiles /p <span class="string">"o:\" /d -2 /c "</span>cmd /c <span class="built_in">echo</span> deleting @file ... && del /f /q /a @path<span class="string">"</span><br><span class="line"></span><br><span class="line">echo [%date:~0,10% %time%] ===========================================================</span><br><span class="line"></span><br><span class="line">echo [%date:~0,10% %time%] 拷贝备份到192.168.1.3</span><br><span class="line">echo.</span><br><span class="line">net use O: /del</span><br><span class="line">net use O: \\192.168.1.3\c$\temp "</span>psw****<span class="string">" /user:"</span>Administrator<span class="string">"</span><br><span class="line"></span><br><span class="line">echo [%date:~0,10% %time%] 删除备份服务器192.168.1.3上2天前的备份</span><br><span class="line">echo.</span><br><span class="line">forfiles /p "</span>o:\<span class="string">" /d -2 /c "</span>cmd /c <span class="built_in">echo</span> deleting @file ... && del /f /q /a @path<span class="string">"</span><br><span class="line">copy %localexpdpdir%\orcl_full_%name%.dmp %bk_server3%\orcl_full_%name%.dmp /y</span><br><span class="line">echo [%date:~0,10% %time%] 拷贝备份到192.168.1.3完成</span><br><span class="line">echo.</span><br><span class="line">echo [%date:~0,10% %time%] ===========================================================</span><br><span class="line">echo [%date:~0,10% %time%] 结束</span><br><span class="line"></span><br><span class="line">goto :eof</span><br><span class="line"></span><br><span class="line">::rem 计算指定天数之前的日期</span><br><span class="line">::set DaysAgo=5</span><br><span class="line">::rem 假设系统日期的格式为yyyy-mm-dd</span><br><span class="line">::call :DateToDays %date:~0,4% %date:~5,2% %date:~8,2% PassDays</span><br><span class="line">::set /a PassDays-=%DaysAgo%</span><br><span class="line">::call :DaysToDate %PassDays% DstYear DstMonth DstDay</span><br><span class="line">::set DstDate=%DstYear%%DstMonth%%DstDay%</span><br><span class="line">::echo %DaysAgo%天的日期是%DstDate%</span><br><span class="line">::pause</span><br><span class="line">::goto :eof</span><br><span class="line"></span><br><span class="line">:DateToDays %yy% %mm% %dd% days</span><br><span class="line">setlocal ENABLEEXTENSIONS</span><br><span class="line">set yy=%1&set mm=%2&set dd=%3</span><br><span class="line">if 1%yy% LSS 200 if 1%yy% LSS 170 (set yy=20%yy%) else (set yy=19%yy%)</span><br><span class="line">set /a dd=100%dd%%%100,mm=100%mm%%%100</span><br><span class="line">set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2</span><br><span class="line">set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633</span><br><span class="line">endlocal&set %4=%j%&goto :EOF</span><br><span class="line"></span><br><span class="line">:DaysToDate %days% yy mm dd</span><br><span class="line">setlocal ENABLEEXTENSIONS</span><br><span class="line">set /a a=%1+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a</span><br><span class="line">set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2,dd/=5</span><br><span class="line">set /a dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10</span><br><span class="line">(if %mm% LSS 10 set mm=0%mm%)&(if %dd% LSS 10 set dd=0%dd%)</span><br><span class="line">endlocal&set %2=%yy%&set %3=%mm%&set %4=%dd%&goto :EOF</span></span><br></pre></td></tr></table></figure>
<h3 id="2-目的库定时导入">2.目的库定时导入</h3><p>在目的库机器新建一个任务计划,每天执行以下批处理(执行时间在源库的定时时间延后2小时)。</p>
<figure class="highlight bash"><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><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br></pre></td><td class="code"><pre><span class="line">@<span class="built_in">echo</span> off </span><br><span class="line">color <span class="number">0</span>b & cls </span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 设置导入路径... </span><br><span class="line">echo.</span><br><span class="line"><span class="built_in">set</span> <span class="string">"localexpdpdir=c:\temp"</span></span><br><span class="line"><span class="built_in">echo</span> %localexpdpdir%</span><br><span class="line">echo.</span><br><span class="line"></span><br><span class="line">::<span class="built_in">set</span> <span class="string">"localexpdpdir=Z:\orcl系统备份\data"</span></span><br><span class="line">::<span class="built_in">set</span> <span class="string">"localexpdpdir=Y:"</span></span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 设置导入文件名</span><br><span class="line">echo.</span><br><span class="line"><span class="built_in">set</span> name=%date:~<span class="number">0</span>,<span class="number">4</span>%%date:~<span class="number">5</span>,<span class="number">2</span>%%date:~<span class="number">8</span>,<span class="number">2</span>%</span><br><span class="line"><span class="built_in">set</span> name=%name%</span><br><span class="line">::<span class="built_in">set</span> name=<span class="number">20161215</span></span><br><span class="line"></span><br><span class="line">:: 前一日</span><br><span class="line">::call :DateToDays %date:~<span class="number">0</span>,<span class="number">4</span>% %date:~<span class="number">5</span>,<span class="number">2</span>% %date:~<span class="number">8</span>,<span class="number">2</span>% PassDays</span><br><span class="line">::<span class="built_in">set</span> /a PassDays-=<span class="number">1</span></span><br><span class="line">::call :DaysToDate %PassDays% DstYear DstMonth DstDay</span><br><span class="line">::<span class="built_in">set</span> name=%DstYear%%DstMonth%%DstDay%</span><br><span class="line"></span><br><span class="line"><span class="built_in">echo</span> %name%</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] work begin......</span><br><span class="line">echo.</span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> exist %localexpdpdir%\orcl_full_%name%.dmp (</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 存在%localexpdpdir%\orcl_full_%name%.dmp</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 创建删除对象脚本.....</span><br><span class="line">echo.</span><br><span class="line">sqlplus system/manager@orcl @d:\orcl_build_drop_sql.sql</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 开始删除对象.....</span><br><span class="line">echo.</span><br><span class="line">sqlplus system/manager@orcl @d:\orcl_drop_objects.sql</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 开始导入.....</span><br><span class="line">impdp system/manager@orcl directory=dump_dir dumpfile=<span class="string">'orcl_full_%name%.dmp'</span> logfile=<span class="string">'orcl_full_%name%.log'</span> TABLE_EXISTS_ACTION=SKIP schemas=dbuser1,dbuser2</span><br><span class="line">echo.</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 重新编译无效对象.....</span><br><span class="line">echo.</span><br><span class="line">sqlplus system/manager@orcl @D:\app\Administrator\product\<span class="number">11.2</span>.<span class="number">0</span>\dbhome_1\RDBMS\ADMIN\utlrp.sql</span><br><span class="line">)</span><br><span class="line">::del %localexpdpdir%\sipfbak%name%.dmp)</span><br><span class="line"><span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 导入结束。</span><br><span class="line">echo.</span><br><span class="line"></span><br><span class="line">::pause</span><br><span class="line"></span><br><span class="line">:: 删除T-<span class="number">2</span>日备份</span><br><span class="line">call :DateToDays %date:~<span class="number">0</span>,<span class="number">4</span>% %date:~<span class="number">5</span>,<span class="number">2</span>% %date:~<span class="number">8</span>,<span class="number">2</span>% PassDays</span><br><span class="line"><span class="built_in">set</span> /a PassDays-=<span class="number">2</span></span><br><span class="line">call :DaysToDate %PassDays% DstYear DstMonth DstDay</span><br><span class="line"><span class="built_in">set</span> aYesDate=%DstYear%%DstMonth%%DstDay%</span><br><span class="line"><span class="keyword">if</span> exist %localexpdpdir%\orcl_full_%aYesDate%.dmp (</span><br><span class="line"> <span class="built_in">echo</span> [%date:~<span class="number">0</span>,<span class="number">10</span>% %time%] 删除过期文件orcl_full_%aYesDate%.dmp</span><br><span class="line"> del %localexpdpdir%\orcl_full_%aYesDate%.dmp</span><br><span class="line">)</span><br><span class="line"></span><br><span class="line">:DateToDays %yy% %mm% %dd% days</span><br><span class="line">setlocal ENABLEEXTENSIONS</span><br><span class="line"><span class="built_in">set</span> yy=%<span class="number">1</span>&<span class="built_in">set</span> mm=%<span class="number">2</span>&<span class="built_in">set</span> dd=%<span class="number">3</span></span><br><span class="line"><span class="keyword">if</span> <span class="number">1</span>%yy% LSS <span class="number">200</span> <span class="keyword">if</span> <span class="number">1</span>%yy% LSS <span class="number">170</span> (<span class="built_in">set</span> yy=<span class="number">20</span>%yy%) <span class="keyword">else</span> (<span class="built_in">set</span> yy=<span class="number">19</span>%yy%)</span><br><span class="line"><span class="built_in">set</span> /a dd=<span class="number">100</span>%dd%%%<span class="number">100</span>,mm=<span class="number">100</span>%mm%%%<span class="number">100</span></span><br><span class="line"><span class="built_in">set</span> /a z=<span class="number">14</span>-mm,z/=<span class="number">12</span>,y=yy+<span class="number">4800</span>-z,m=mm+<span class="number">12</span>*z-<span class="number">3</span>,j=<span class="number">153</span>*m+<span class="number">2</span></span><br><span class="line"><span class="built_in">set</span> /a j=j/<span class="number">5</span>+dd+y*<span class="number">365</span>+y/<span class="number">4</span>-y/<span class="number">100</span>+y/<span class="number">400</span>-<span class="number">2472633</span></span><br><span class="line">endlocal&<span class="built_in">set</span> %<span class="number">4</span>=%j%&goto :EOF</span><br><span class="line"> </span><br><span class="line">:DaysToDate %days% yy mm dd</span><br><span class="line">setlocal ENABLEEXTENSIONS</span><br><span class="line"><span class="built_in">set</span> /a a=%<span class="number">1</span>+<span class="number">2472632</span>,b=<span class="number">4</span>*a+<span class="number">3</span>,b/=<span class="number">146097</span>,c=-b*<span class="number">146097</span>,c/=<span class="number">4</span>,c+=a</span><br><span class="line"><span class="built_in">set</span> /a d=<span class="number">4</span>*c+<span class="number">3</span>,d/=<span class="number">1461</span>,e=-<span class="number">1461</span>*d,e/=<span class="number">4</span>,e+=c,m=<span class="number">5</span>*e+<span class="number">2</span>,m/=<span class="number">153</span>,dd=<span class="number">153</span>*m+<span class="number">2</span>,dd/=<span class="number">5</span></span><br><span class="line"><span class="built_in">set</span> /a dd=-dd+e+<span class="number">1</span>,mm=-m/<span class="number">10</span>,mm*=<span class="number">12</span>,mm+=m+<span class="number">3</span>,yy=b*<span class="number">100</span>+d-<span class="number">4800</span>+m/<span class="number">10</span></span><br><span class="line">(<span class="keyword">if</span> %mm% LSS <span class="number">10</span> <span class="built_in">set</span> mm=<span class="number">0</span>%mm%)&(<span class="keyword">if</span> %dd% LSS <span class="number">10</span> <span class="built_in">set</span> dd=<span class="number">0</span>%dd%)</span><br><span class="line">endlocal&<span class="built_in">set</span> %<span class="number">2</span>=%yy%&<span class="built_in">set</span> %<span class="number">3</span>=%mm%&<span class="built_in">set</span> %<span class="number">4</span>=%dd%&goto :EOF</span><br></pre></td></tr></table></figure>
</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> -->
<nav id="article-nav">
<a href="/2016-12-03-cloud-notes-2012.html" id="article-nav-newer" class="article-nav-link-wrap">
<!-- <strong class="article-nav-caption">Newer</strong> -->
<div class="article-nav-title">
«无意翻到当年的云笔记
</div>
</a>
<a href="/2016-08-06-python-zhengze-pachong-qiubai.html" id="article-nav-older" class="article-nav-link-wrap">
<!-- <strong class="article-nav-caption">Older</strong> -->
<div class="article-nav-title">Python爬虫正则表达式抓取糗百笑话»</div>
</a>
</nav>
<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>
<section id="comments">
<div id="disqus_thread">
<noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</section>
</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_url = 'http://huangming.github.io/2016-08-18-oracle-auto-backup-and-restore.html';
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>