Oracle11g R2用EXP导出时报EXP-00011错误的解决方法 (转)

用定时器 + 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

posted @ 2014-10-24 10:40 youngturk 阅读(481) | 评论 (0)编辑 收藏

linux window共用方法路径分割

regex为\\\\,因为在java中\\表示一个\,而regex中\\也表示\,所以当\\\\解析成regex的时候为\\。 由于unix中file.separator为斜杠"/",下面这段代码可以处理windows和unix下的所有情况: String temp[] = name.replaceAll("\\\\","/").split("/"); if (temp.length > 1) { name = temp[temp.length - 1]; }

posted @ 2014-08-14 14:43 youngturk 阅读(243) | 评论 (0)编辑 收藏

java环境变量设置

版本验证:
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

posted @ 2014-04-23 10:17 youngturk 阅读(271) | 评论 (0)编辑 收藏

Java打包成windows下可运行的程序,我的管理文件中有

     摘要: Java Project 打包以及安装包制作 Java的桌面程序写好以后只能在eclipse下运行是不可以的,还需要将程序拷贝到其他电脑上运行才可以,所以需要制作成其他电脑可以运行的文件,当然在安装有jdk的电脑上只需要将程序导出为jar文件就可以运行了,但是除了开发java程序人员的电脑上会安装jdk,其他人的电脑上不会有这个环境,所以还需要将java可运行的环境一同打包到程序中去,这样,在用...  阅读全文

posted @ 2014-04-23 09:28 youngturk 阅读(1932) | 评论 (0)编辑 收藏

java 实体类转换 map类

public static Map ConvertObjToMap(Object obj){
          Map
<String,Object> reMap = new HashMap<String,Object>();
          
if (obj == null
           
return null;
          Field[] fields 
= obj.getClass().getDeclaredFields();
          
try {
           
for(int i=0;i<fields.length;i++){
            
try {
             Field f 
= obj.getClass().getDeclaredField(fields[i].getName());
             f.setAccessible(
true);
                   Object o 
= f.get(obj);
                   reMap.put(fields[i].getName(), o);
            }
 catch (NoSuchFieldException e) {
             
// TODO Auto-generated catch block
             e.printStackTrace();
            }
 catch (IllegalArgumentException e) {
             
// TODO Auto-generated catch block
             e.printStackTrace();
            }
 catch (IllegalAccessException e) {
             
// TODO Auto-generated catch block
             e.printStackTrace();
            }

           }

          }
 catch (SecurityException e) {
           
// TODO Auto-generated catch block
           e.printStackTrace();
          }
 
          
return reMap;
         }

Paynet paynet ;
            
            Map map;
            
for(int i = 0 ; i < rs.size();i++)
            
{
                map
= ConvertObjToMap((Paynet)(rs.get(i)));
                
for(int j=0; j<fieldnames.length; j++)
                
{
                    
//(String)map.get("p_id")!=null
                    if((String)map.get(fieldnames[j])!=null)
                    
{
                        
//String temp1 = rs.getString(fieldnames[j]);
                        String temp = new String(((String)map.get(fieldnames[j])).getBytes("ISO-8859-1"), "GBK");
                        sheet.addCell(
new Label(j, i+1, temp));
                    }

                    
else
                        sheet.addCell(
new Label(j, i+1""));
                }

            }

String[] fieldNames 
= {"szVessel""szVoyage""szBlNo""szCtnNo""szSealNo""szCtnType""szCargoName""fWeight""fVolume""szReceiver""szSender""szLoadPortCode""szDischargePortCode"};

posted @ 2014-01-16 14:46 youngturk 阅读(3187) | 评论 (2)编辑 收藏

log4j web.xml配置

a. web.xml
        add following code to web.xml
          
<servlet>
    
<servlet-name>log4j-init</servlet-name>
    
<servlet-class>com.legendinfo.log.Log4jInit</servlet-class>
    
<init-param>
      
<param-name>log4j-init-file</param-name>
      
<param-value>WEB-INF/classes/log4j.property</param-value>
    
</init-param>
    
<load-on-startup>1</load-on-startup>
  
</servlet>
b.create a special servlet 
for log4j initialazation
    save the file in the web
-info/classes folder
package com.legendinfo.log;
import org.apache.log4j.PropertyConfigurator;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
import java.io.IOException;
public class Log4jInit extends HttpServlet {
  
public void init() {
    String prefix 
=  getServletContext().getRealPath("/");
    String file 
= getInitParameter("log4j-init-file");
    
// if the log4j-init-file is not set, then no point in trying
    if(file != null{
      PropertyConfigurator.configure(prefix
+file);
      System.out.println(
"Init Log4j success!");
    }

  }

  
public void doGet(HttpServletRequest req, HttpServletResponse res) {
  }

}


 c.create a log4j.property file that define the log4j properties
    the property file is setting in web.xml
    a sample property file as following

log4j.rootLogger
=INFO, A1 ,R
log4j.appender.A1
=org.apache.log4j.ConsoleAppender 
log4j.appender.A1.layout
=org.apache.log4j.PatternLayout 
log4j.appender.A1.layout.ConversionPattern
=%-d{yyyy-MM-dd HH:mm:ss} [%c]-[%p] %m%
log4j.appender.R
=org.apache.log4j.RollingFileAppender 
log4j.appender.R.File
=../logs/log4j.log 
log4j.appender.R.MaxFileSize
=100KB 
log4j.appender.R.MaxBackupIndex
=1 
log4j.appender.R.layout
=org.apache.log4j.TTCCLayout


d.a test Jsp page
    testLog.jsp:
<%@ page import="org.apache.log4j.*"%>
<html>
<body>
<%
   
//log4j.appender.appenderName = WEB-INF/classes/log4j.log
   
   Logger  logger 
= Logger.getLogger("com.legendinfo");
   logger.setLevel(Level.INFO);
   Logger barlogger 
= Logger.getLogger("com.legendinfo.log");
   logger.warn(
"Low fuel level.");
   logger.debug(
"Starting search for nearest gas station.");
   barlogger.info(
"Located nearest gas station.");
   barlogger.debug(
"Exiting gas station search");
%>
</body>
</html>

结合AbcBankB2B项目具体

posted @ 2014-01-08 16:20 youngturk 阅读(288) | 评论 (0)编辑 收藏

log4j单独类信息插入新数据库

log4j.rootLogger=info, A1

log4j.appender.A1
=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout
=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern
= %d{yyyy-MM-dd HH:mm:ss,SSS} [%c] [%p] - %m%n


log4j.logger.freemarker 
= error
log4j.logger.com.opensymphony 
= error
log4j.logger.org.springframework 
= error
log4j.logger.org.hibernate 
= error

#配置数据库插入信息 start
log4j.logger.org.directwebremoting
=info
#log4j.logger.com.cenin.web.ajax.OnlinehallAjax属于org.directwebremoting类下新建,应用MDC取值
log4j.logger.com.cenin.web.ajax.OnlinehallAjax
=info,db
log4j.appender.db.Threshold
=info
log4j.appender.db 
= org.apache.log4j.jdbc.JDBCAppender
log4j.appender.db.BufferSize
=1
log4j.appender.db.driver
=oracle.jdbc.driver.OracleDriver
log4j.appender.db.URL
=jdbc:oracle:thin:@localhost:1521:TJGWL
log4j.appender.db.user
=cy
log4j.appender.db.password
=cy 

log4j.appender.db.sql
=insert into RESLOG(LogId,username,bankType,money,resultinfo,merchantno,Class,Method,createTime,LogLevel,MSG)values(S_RESLOG.Nextval,'%X{username}','%X{bankType}','%X{money}','%X{resultInfo}','%X{merchantNo}','%C','%M', to_date('%d{yyyy-MM-dd HH:mm:ss}','yyyy-MM-dd HH24:mi:ss'),'%p','%m'
log4j.appender.db.layout
=org.apache.log4j.PatternLayout 
# 这个配置是告诉当LOG4J吧日志存储数据库时用的SQL语句。SQ_RESLOG_LOGID.Nextval是我建的一个SEQUENCE;
# ‘
%C’是日志中的CLASS;‘%M’是打印日志是执行到类里的方法;‘%d’是打印的时间,它支持格式化;
#‘
%P’是日志级别,包括INFO、DEBUG、ERROR等;‘%m’是MSG,日志内容。注意这里的参数区分大小写。
#配置数据库插入信息 end

MDC取值:
MDC.put(
"username",username);

servelet引入:
    
<servlet>
      
<servlet-name>dwr-invoker</servlet-name>
      
<display-name>DWR Servlet</display-name>
      
<description>Direct Web Remoter Servlet</description>
      
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
    
<init-param>
      
<param-name>debug</param-name>
      
<param-value>true</param-value>
    
</init-param>
    
<init-param>
      
<param-name>activeReverseAjaxEnabled</param-name>
      
<param-value>true</param-value>
    
</init-param>
    
<init-param>
      
<param-name>initApplicationScopeCreatorsAtStartup</param-name>
      
<param-value>true</param-value>
    
</init-param>
    
<init-param>
      
<param-name>maxWaitAfterWrite</param-name>
      
<param-value>500</param-value>
    
</init-param>
    
<init-param>
        
<param-name>crossDomainSessionSecurity</param-name>
        
<param-value>false</param-value>
    
</init-param>
    
<load-on-startup>1</load-on-startup>
  
</servlet>

posted @ 2013-12-11 11:30 youngturk 阅读(414) | 评论 (0)编辑 收藏

xml应用主外键说明

<record table="CkypHead" totalFields="21" tableType="vessel">
        
<primaryKey field="lID" />
        
<!--关别代码-->
        
<property maxLength="6" sequence="1" field="CUSTOMS_ID" fileInfo="receiverCode"/>
        
<!--舱单进/出口标志-->
        
<property maxLength="1" sequence="2" field="I_E_FLAG" />
<record table="CkypContainer" totalFields="7" tableType="ctn">
        
<primaryKey field="lID" />--表主键ID
        
<foreignKey refTable="CkypHead" refField="lID" field="lHeadID" />外键链接外键名lHeadID,链接的外键表CkypHead lID

        
<!-- 序号 -->
        
<property maxLength="5" sequence="1" field="CONTA_SEQ_NO"/>
        
<!-- 提运单号 -->
        
<property maxLength="20" sequence="2" field="BILL_NO" fieldType="bill"/>
        
<!-- 集装箱号 -->
        
<property maxLength="11" sequence="3" field="CONTA_NO" fieldType="ctnno"/>
        
<!-- 标准箱标志 -->
        
<property maxLength="1" sequence="4" field="CONTA_SIZE" />
        
<!-- 铅封号 -->
        
<property maxLength="10" sequence="5" field="SEAL_NO" />
        
<!-- 规格类型 -->
        
<property maxLength="4" sequence="6" field="CONTA_TYPE" />
        
<!-- 集装箱重量(总重) -->
        
<property maxLength="11" sequence="7" field="CONTA_WT" type="float" precision="2" />
    
</record>

posted @ 2013-11-15 10:25 youngturk 阅读(215) | 评论 (0)编辑 收藏

js 控制 style 大全

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

posted @ 2013-09-29 15:26 youngturk 阅读(1583) | 评论 (0)编辑 收藏

创建连接DBlink

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. )'; 

posted @ 2013-09-26 11:20 youngturk 阅读(1404) | 评论 (0)编辑 收藏

仅列出标题
共33页: 上一页 1 2 3 4 5 6 7 8 9 下一页 Last 
<2024年11月>
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

导航

统计

公告

this year :
1 jQuery
2 freemarker
3 框架结构
4 口语英语

常用链接

留言簿(6)

随笔分类

随笔档案

文章分类

文章档案

相册

EJB学习

Flex学习

learn English

oracle

spring MVC web service

SQL

Struts

生活保健

解析文件

搜索

最新评论

阅读排行榜

评论排行榜