Oracle 備份策略(create_schedule+)

來源:互聯網
上載者:User
參考文章http://blog.itpub.net/post/33454/395121錯誤解決http://www.adp-gmbh.ch/blog/2005/may/27.html

 

定義一個計劃 (每天執行)

  CALL dbms_scheduler.create_schedule  ('BACK_UP_INDONESIAPROD2',SYSDATE ,'FREQ=DAILY', to_date('2013-03-25 10:00:00', 'yyyy-mm-dd hh24:mi:ss'));  --刪除預存程序 call dbms_scheduler.drop_schedule('TEST');
--修改 call  DBMS_SCHEDULER.SET_ATTRIBUTE('BACK_UP_INDONESIAPROD2','repeat_interval','FREQ=MINUTELY');

定義一個任務(執行.bat檔案 目的備份書庫)

--建立 begindbms_scheduler.create_job(job_name => 'backup_03_15',schedule_name => 'BACK_UP_INDONESIAPROD2',job_type => 'EXECUTABLE',job_action => 'C:\backup_indonesiaprod2.bat',enabled => true,comments => 'BACK_UP_INDONESIAPROD2');end;/--刪除begindbms_scheduler.drop_job('backup_03_15' );end;/

 

 

 任務指令碼

exp indonesiaprod2/indonesiaprod2@localhost:1521/xe full=n  file='indonesiaprod2_%date:~0,4%%date:~5,2%%date:~8,2%.dmp' log=indonesiaprod2_%date:~0,4%%date:~5,2%%date:~8,2%.txt

查看目前使用者的計劃和任務

select job_name,program_name,schedule_name from user_scheduler_jobs ;

查看目前使用者計劃和任務運行情況

select * from user_scheduler_job_run_details order by log_id desc;

開啟如下服務

 

修改並查詢如下參數

 ALTER SYSTEM SET job_queue_processes = 10;

show parameter job_queue_process;

任務執行結果:產生如下檔案

 -----

資料匯入

#set nls_lang=AMERICAN_AMERICA.UTF8
#>imp system/cici123love@xe

Import: Release 11.2.0.2.0 - Production on Fri Mar 15 23:47:24 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Productio
n

Import data only (yes/no): no > C:\Users\Administrator.cici-THINK\indonesiaprod2
.dmp

IMP-00001: respond with either yes, no, RETURN or '.' to quit
Import data only (yes/no): no >

Import file: EXPDAT.DMP > C:\Users\Administrator.cici-THINK\indonesiaprod2.dmp

Enter insert buffer size (minimum is 8192) 30720>
Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by INDONESIAPROD2, not by you

import done in UTF8 character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
export client uses AL32UTF8 character set (possible charset conversion)^C
C:\Users\Administrator.cici-THINK>imp system/cici123love@xe

Import: Release 11.2.0.2.0 - Production on Fri Mar 15 23:48:15 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Express Edition Release 11.2.0.2.0 - Productio
n

Import data only (yes/no): no >

Import file: EXPDAT.DMP > C:\Users\Administrator.cici-THINK\indonesiaprod2.dmp

Enter insert buffer size (minimum is 8192) 30720>

Export file created by EXPORT:V11.02.00 via conventional path

Warning: the objects were exported by INDONESIAPROD2, not by you

import done in UTF8 character set and AL16UTF16 NCHAR character s

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.