用定時器 + bat腳本做oracle的備份,已經備份了幾個月了。這幾天突然發現備份出來的dmp數據完全沒法重新導入到新的數據庫中。
起初以為是版本問題,或者導出參數的問題,于是在網上不停的搜索、嘗試,最后還是沒發現問題原因。
算了還是研究一下導入日志中的錯誤,于是將日志中出錯誤的表嘗試單獨導出,居然出現EXP-00011::表不存在 錯誤,可是數據庫中明明有這個表呀。根據這個方向再上網一查,終于找到原因了,原來在11g中空表是默認是不占Segment的,導致備份導出的時候壓根就沒導出那些空表,這樣才出現備份的dmp沒法導入的問題,敢情我幾個月的備份工作都白做了。
可ORACLE 你媽X的,備份導出時沒導出空表這么大的事情你居然沒有任何提示,你他*媽的是為了創造客服賺錢的機會么?
哎,處理過程如下:
1.用system帳號進入:
1.1 查看是否為true
show parameter deferred_segment_creation;
1.2 修改為false
alter system set deferred_segment_creation=false;
2.用數據庫帳號登錄:
2.1 查找所有數據表為空的表
select table_name from user_tables where NUM_ROWS=0;
2.2 把這些表組成修改Segment的腳本:
select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0;
2.3 將2.2中查詢的結果導出來,或者復制出來,并執行修改所有空表。
這個時候就能把所有空表導出來了。
感謝以下兩位的帖子,給了我很大幫助
http://arthas-fang.iteye.com/blog/875258
http://wanwentao.blog.51cto.com/2406488/545154
regex為\\\\,因為在java中\\表示一個\,而regex中\\也表示\,所以當\\\\解析成regex的時候為\\。
由于unix中file.separator為斜杠"/",下面這段代碼可以處理windows和unix下的所有情況:
String temp[] = name.replaceAll("\\\\","/").split("/");
if (temp.length > 1) {
name = temp[temp.length - 1];
}
版本驗證:
java -version
2
環境變量安裝
JAVA_HOME D:\javaIDE\sunjdks\jdk1.5.0_04
Path %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin;
classpath .;%JAVA_HOME%\lib;%JAVA_HOME%\lib\tools.jar
java項目運行:cd到所在目錄下
java -jar testedi.jar
摘要: Java Project 打包以及安裝包制作
Java的桌面程序寫好以后只能在eclipse下運行是不可以的,還需要將程序拷貝到其他電腦上運行才可以,所以需要制作成其他電腦可以運行的文件,當然在安裝有jdk的電腦上只需要將程序導出為jar文件就可以運行了,但是除了開發java程序人員的電腦上會安裝jdk,其他人的電腦上不會有這個環境,所以還需要將java可運行的環境一同打包到程序中去,這樣,在用...
閱讀全文
document.getElementById("div01").style.height;
document.getElementById("div01").style.lineHeight;
document.getElementById("div01").style.backgroundColor;
CSS語法(不區分大小寫) JavaScript語法(區分大小寫)
border border
border-bottom borderBottom
border-bottom-color borderBottomColor
border-bottom-style borderBottomStyle
border-bottom-width borderBottomWidth
border-color borderColor
border-left borderLeft
border-left-color borderLeftColor
border-left-style borderLeftStyle
border-left-width borderLeftWidth
border-right borderRight
border-right-color borderRightColo
rborder-right-style borderRightStyle
border-right-width borderRightWidth
border-style borderStyle
border-top borderTop
border-top-color borderTopColor
border-top-style borderTopStyle
border-top-width borderTopWidth
border-width borderWidth
clear clear
float floatStyle
margin margin
margin-bottom marginBottom
margin-left marginLeft
margin-right marginRight
margin-top marginTop
padding padding
padding-bottom paddingBottom
padding-left paddingLeft
padding-right paddingRight
padding-top paddingTop
CSS 語法(不區分大小寫) JavaScript 語法(區分大小寫)
background background
background-attachment backgroundAttachment
background-color backgroundColor
background-image backgroundImage
background-position backgroundPosition
background-repeat backgroundRepeat
color color
CSS語法(不區分大小寫) JavaScript 語法(區分大小寫)
display display
list-style-type listStyleType
list-style-image listStyleImage
list-style-position listStylePosition
list-style listStyle
white-space whiteSpace
CSS 語法(不區分大小寫) JavaScript 語法(區分大小寫)
font font
font-family fontFamily
font-size fontSize
font-style fontStyle
font-variant fontVariant
font-weight fontWeight
CSS 語法(不區分大小寫 ) JavaScript 語法(區分大小寫)
letter-spacing letterSpacing
line-break lineBreak
line-height lineHeight
text-align textAlign
text-decoration textDecoration
text-indent textIndent
text-justify textJustify
text-transform textTransform
vertical-align verticalAlign
1.在本機oracle系統配串
HYORCLNEW =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.128.4.35)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 10.128.4.36)(PORT = 1521))
(LOAD_BALANCE = yes)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = hyorcl)
(FAILOVER_MODE =
(TYPE = select)
(METHOD = basic)
(RETRIES = 20)
(DELAY = 1)
)
)
)
2.
一 、創建dblink
Sql代碼
create database link <DBLink名稱> connect to <被連接庫的用戶名> identified by <被連接庫的密碼> using '<Oracle客戶端工具建立的指向被連接庫服務名>';
例如:
Sql代碼
1.create database link XMDS_KF connect to XMDS identified by XMDS using 'HYORCLNEW ;
但這種方式有個缺點就是必須要在服務器建立一個被連接庫的服務名,如果不建則會報錯:
ORA-12154: TNS: 無法處理服務名
,但如果直接使用地址來建DBLink,就可以省去配置服務名的麻煩了:
Sql代碼
1.create public database link XMDS_KF connect to XMDS identified by XNDS using '(DESCRIPTION =
2. (ADDRESS_LIST =
3. (ADDRESS = (PROTOCOL = TCP)(HOST = 145.24.16.182)(PORT = 1521))
4. )
5. (CONNECT_DATA =
6. (SERVICE_NAME = XMDS)
7. )
8. )';