【EXP】在備份檔案上留下“時間烙印”
使用EXP工具備份備份使用者資料時,在備份檔案上打上時間標記是一個非常好的習慣,簡單記錄一下如何在不同的作業系統平臺上完成這個任務,供參考。
1.UNIX或Linux作業系統
1)可以使用date作業系統命令輔助完成這個小任務
secooler@secDB /exp$ exp sec/sec file=`date +"%Y%m%d"`_sec.dmp log=`date +"%Y%m%d"`_sec.log
Export: Release 11.2.0.1.0 - Production on Thu Mar 25 22:51:12 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing option
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SEC
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SEC
About to export SEC's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SEC's tables via Conventional Path ...
. . exporting table T 1155520 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
2)檢視生成的備份檔案
secooler@secDB /exp$ ls -ltr
total 128M
-rw-r--r-- 1 oracle oinstall 1.4K Mar 25 22:51 20100325_sec.log
-rw-r--r-- 1 oracle oinstall 128M Mar 25 22:51 20100325_sec.dmp
OK,生成的備份檔案和日誌檔案均打上了時間的烙印!
2.Windows作業系統
1)看一下在Windows系統中date命令的使用方法
(1)date命令顯示格式
D:\>echo %date%
2010-03-25 週四
(2)只選擇前10位的日期內容
D:\>echo %date:~0,10%
2010-03-25
注意,我們需要選擇日期形式以中橫槓為分隔的形式(如果是“/”分隔的話在生成備份檔案時會報錯)。
修改日期顯示格式的步驟如下:
控制皮膚 --> “Clock, Language, and Region”--> “Set the time and date” --> “Change calendar settings” --> “Date formats” --> 在“Short date”右側下拉框中選擇“yyyy-M-d”格式。
2)使用Windows作業系統的date命令達到我們的“時間烙印”目的
D:\>exp sec/sec@sec file=%date:~0,10%_sec.dmp log=%date:~0,10%_sec.log
Export: Release 10.2.0.3.0 - Production on Thu Mar 25 23:23:44 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing option
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SEC
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SEC
About to export SEC's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SEC's tables via Conventional Path ...
. . exporting table T 1155520 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
3)確認在Windows上生成的備份檔案和日誌檔案的格式
D:\>dir %date:~0,10%_sec*
Volume in drive D has no label.
Volume Serial Number is 4CC5-8E99
Directory of D:\
2010-03-25 23:24 133,310,464 2010-03-25_sec.dmp
2010-03-25 23:24 1,378 2010-03-25_sec.log
2 File(s) 133,311,842 bytes
0 Dir(s) 11,578,949,632 bytes free
OK,任務完成。
3.小結
備份命令EXP和作業系統命令date相結合可以很好的實現留下“時間烙印”的目的,當然也可以編寫一段指令碼實現同樣的效果,不過我們最求的是一種簡便易行的方法。
Good luck.
secooler
10.03.25
-- The End --
1.UNIX或Linux作業系統
1)可以使用date作業系統命令輔助完成這個小任務
secooler@secDB /exp$ exp sec/sec file=`date +"%Y%m%d"`_sec.dmp log=`date +"%Y%m%d"`_sec.log
Export: Release 11.2.0.1.0 - Production on Thu Mar 25 22:51:12 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing option
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SEC
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SEC
About to export SEC's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SEC's tables via Conventional Path ...
. . exporting table T 1155520 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
2)檢視生成的備份檔案
secooler@secDB /exp$ ls -ltr
total 128M
-rw-r--r-- 1 oracle oinstall 1.4K Mar 25 22:51 20100325_sec.log
-rw-r--r-- 1 oracle oinstall 128M Mar 25 22:51 20100325_sec.dmp
OK,生成的備份檔案和日誌檔案均打上了時間的烙印!
2.Windows作業系統
1)看一下在Windows系統中date命令的使用方法
(1)date命令顯示格式
D:\>echo %date%
2010-03-25 週四
(2)只選擇前10位的日期內容
D:\>echo %date:~0,10%
2010-03-25
注意,我們需要選擇日期形式以中橫槓為分隔的形式(如果是“/”分隔的話在生成備份檔案時會報錯)。
修改日期顯示格式的步驟如下:
控制皮膚 --> “Clock, Language, and Region”--> “Set the time and date” --> “Change calendar settings” --> “Date formats” --> 在“Short date”右側下拉框中選擇“yyyy-M-d”格式。
2)使用Windows作業系統的date命令達到我們的“時間烙印”目的
D:\>exp sec/sec@sec file=%date:~0,10%_sec.dmp log=%date:~0,10%_sec.log
Export: Release 10.2.0.3.0 - Production on Thu Mar 25 23:23:44 2010
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing option
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user SEC
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user SEC
About to export SEC's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export SEC's tables via Conventional Path ...
. . exporting table T 1155520 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
3)確認在Windows上生成的備份檔案和日誌檔案的格式
D:\>dir %date:~0,10%_sec*
Volume in drive D has no label.
Volume Serial Number is 4CC5-8E99
Directory of D:\
2010-03-25 23:24 133,310,464 2010-03-25_sec.dmp
2010-03-25 23:24 1,378 2010-03-25_sec.log
2 File(s) 133,311,842 bytes
0 Dir(s) 11,578,949,632 bytes free
OK,任務完成。
3.小結
備份命令EXP和作業系統命令date相結合可以很好的實現留下“時間烙印”的目的,當然也可以編寫一段指令碼實現同樣的效果,不過我們最求的是一種簡便易行的方法。
Good luck.
secooler
10.03.25
-- The End --
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/519536/viewspace-630420/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 基於時間戳的檔案備份指令碼時間戳指令碼
- RMAN相容性、控制檔案自動備份、儲存時間、備份策略、備份指令碼(二)指令碼
- exp 匯出時帶時間格式的檔案設定
- rsync + lsyncd 檔案實時同步/備份
- 備份之控制檔案備份
- 不完全恢復(資料檔案備份--新建表空間--控制檔案備份--日誌歸檔檔案)
- 【EXP/IMP】從exp工具生成的不完整備份檔案中快速獲取資料庫表空間建立語句資料庫
- exp備份和rman備份的區別
- rman給歸檔指定備份位置;庫先備份盤同時到帶庫;更改控制檔案自備路徑;時間點的恢復
- windows建exp備份指令碼時的小插曲Windows指令碼
- Java實現定時備份檔案教程Java
- EXP的備份指令碼指令碼
- 備份控制檔案
- sql檔案備份SQL
- 使用logmnr,在RMAN備份檔案中恢復備份的歸檔日誌檔案進行分析
- oracle資料庫備份之exp增量備份Oracle資料庫
- 揭祕ORACLE備份之--邏輯備份(EXP)Oracle
- oracle 控制檔案及引數檔案何時自動備份Oracle
- VC備份時可以刪除的檔案 (轉)
- rman全庫備份備份歸檔日誌檔案
- ORACLE備份和恢復 - 邏輯備份 exp/impOracle
- 搭建Oracle的exp備份機Oracle
- gitlab自動定時備份檔案,備份失敗傳送郵件Gitlab
- RMAN備份檔案格式
- ManagerDB 備份檔案管理與異地備份
- RMAN說,我能備份(5)--RMAN備份歸檔檔案
- dump備份並定時刪除過去檔案
- 電腦送去維修時應備份好重要檔案
- RMAN備份時候檔案壞塊的處理
- 備份歸檔日誌檔案
- Windows 備份oracle按時間命名WindowsOracle
- Oracle rman 備份與恢復 臨時表空間的檔案問題解決Oracle
- iturns備份的檔案在win10的什麼位置_iturns備份的檔案在win10哪個資料夾Win10
- 表空間不完全恢復(全備--備份控制檔案--刪除表空間andy--日誌檔案)
- 不完全恢復(全備--備份控制檔案--新建表空間andy--日誌檔案)
- Linux ftp 自動上傳備份檔案指令碼LinuxFTP指令碼
- 定時備份windows機器上的檔案到linux伺服器上的操作梳理(rsync)WindowsLinux伺服器
- rman備份-(1) 利用備份級恢復資料檔案和控制檔案