国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

不同字符集倒庫的方法

2024-07-21 02:11:18
字體:
來源:轉載
供稿:網友
  • 本文來源于網頁設計愛好者web開發社區http://www.html.org.cn收集整理,歡迎訪問。

  • 第一步:exp 原 us7ascii數據庫中的scott用戶。
    第二步:exp 原us7ascii 數據庫中的zhaoboyi用戶。
    第三步:create new database(character set simplified chinese_china.zhs16gbk),
    所有的路徑與原
    數據庫相同。

    第四步:將zhs16gbk 中的init。ora copy init。ora。bak。
    第五步:將us7ascii 中的init。ora copy zhs16gbk 修改相應參數。
    第六步:生成zhs16gbk 中的scott 用戶,授權,exp zhs16gbk 中的scott 用戶。
    第七步:  生成zhs16gbk 中的zhaoboyi 用戶,exp zhs16gbk 中的zhaoboyi 用戶。
    第八步:用ultraedit 分別打開(us7ascii)以及(zhs16gbk)scott 用戶,將前5行中的u
    s7ascii 不同處改掉。
    第九步:相應的做zhaoboyi 用戶。
    第十步:在zhs16gbk中,執行sys 用戶的owaload。sql ,對htp。p授權。
    第十一步:做imp,把原有的數據庫倒入到新的數據庫。
    第十二步:解決大字段問題。
    首先在原數據庫中執行存儲過程 fwrite_clob_niu,將含有大字段的表生成到文件中,接著
    ,在新數據庫中編譯執行fupdate_clob_text,
    將大字段倒回到新數據庫中。
    附錄:
    1。存儲過程:fwrite——clob——niu
    procedure       fwrite_clob_niu as
        cursor c_lt is
        select c.text,c.info_id
        from info_ctext c
      where info_id <= 120
        --change7.16 where  info_id <=100
        order by info_id asc;
    /*
        1000-1100 f
        1100-1600 ok
        1600-1630 ok
        1629-1640 ok
        1640-1660 f
        1660-1668 ok
        1669 f
        1670-1750 ok
    */   
        str                 varchar2(32767) := null;
        position            integer         := 1;
        new_position        integer         := 1;
    pat varchar2(80) := 'd:/writeclob';
    --change716 pat varchar2(80) := '/export/home0/ora8i/doc/ch';
        save_file   utl_file.file_type;
        result      boolean             := false;
    dir_delimiter   varchar2(200) := '/';
    --change 7.16    dir_delimiter   varchar2(200) := '/';  -- note: use '/' for win
    dows nt
        p_filename varchar2(200);
        v_offset integer;
        v_amount integer;
        v_buffer varchar2(30240);
    begin
        v_amount := 30240;
        if substr( pat, length( pat ), 1 ) != dir_delimiter then
           pat := pat || dir_delimiter; end if;
        begin
          for r in c_lt
          loop
          if r.text is not null then
       p_filename := r.info_id ||'.dat';
       new_position:=1;
       position:=1;
          save_file := utl_file.fopen( pat, p_filename, 'w' );
            if dbms_lob.instr( r.text, chr(10), position ) = 0 then
             begin
                  v_offset := 1;
                  v_buffer := '';
             loop
     
                dbms_lob.read(r.text,v_amount,v_offset,v_buffer);
     
                v_offset := v_offset + v_amount;
               utl_file.put( save_file,  v_buffer );
              --    htp.p(v_buffer);
              -- htp.p('jjjj');
           end loop;
            exception
             when no_data_found then
              null; 
          end;
            
              -- htp.p('111');
              -- str := dbms_lob.substr( r.text,1)||chr(10);
              -- htp.p(str);
            end if;  
            while( new_position != 0 )
            loop
              new_position := dbms_lob.instr( r.text, chr(10), position );

              str := dbms_lob.substr( r.text, new_position - position, position );
             -- htp.p('str=');
             -- htp.p(str);
              position := new_position + 1;

              --change 7.17 if new_position != 0 then
                 utl_file.put_line( save_file, replace( str, chr(10), null ) );
             -- else
                
               --        utl_file.put_line( save_file,  str );
              -- change 7.17
              -- htp.p(new_position);
             -- end if;
             end loop;
      utl_file.fclose(save_file);
      htp.p('<center><h2>the file  '||p_filename||'    generated!</h2></center>');
      end if;
          end loop;
         
     exception
       when no_data_found then
         htp.p('<center><h2>the file  '||p_filename||'    failed!</h2></center>');
        end;
    end fwrite_clob_niu;
    附錄二:存儲過程fupdate_clob_text
    procedure       fupdate_clob_text as
        cursor c_lt is
        select c.text,c.info_id
        from info_ctext c
     -- where info_id = 112
       where ((info_id >= 1 and info_id <= 30) or
       (info_id >=30 and info_id <= 60) or
       (info_id >=60 and info_id <= 90) or
       (info_id >=90 and info_id <= 120))
       
      
       /* --change 716 where type not in ('b','c','v','a','e') and ((info_id >=10000
     and info_id <20000) or
        (info_id >=1100 and info_id <1601)  or
        (info_id >=1600 and info_id <1630)  or
        (info_id >=1660 and info_id <1668) or
        info_id >=1670  or
        (info_id >=0 and info_id <501))
        */
        order by info_id asc;
    /*
        1000-1100 f
        1100-1600 ok
        1600-1630 ok
        1629-1640 ok
        1640-1660 f
        1660-1668 ok
        1669 f
        1670-1750 ok
    */ 
        tmp             clob; 
        pat varchar2(80) := 'd:/writeclob';
      -- change 7.16 pat varchar2(80) := '/export/home0/ora8i/doc/ch';
        save_file   utl_file.file_type;
        result      boolean             := false;
        dir_delimiter   varchar2(200) := '/';
        -- change 7.16 dir_delimiter   varchar2(200) := '/';  -- note: use '/' for w
    indows nt
        p_filename varchar2(200);
    begin
        htp.p('我們');
       
        if substr( pat, length( pat ), 1 ) != dir_delimiter then
           pat := pat || dir_delimiter; end if;
          for r in c_lt
          loop      
      begin
         p_filename :=to_char(r.info_id)||'.dat';
              update info_ctext set text = ' '
               where info_id=r.info_id;
             commit;
                  
              select text into tmp from info_ctext
             where info_id = r.info_id  for update;


         -- dbms_lob.trim( tmp, 0 );

           result := load_file( pat, p_filename, tmp );

           if result then
              update info_ctext set text = tmp
               where info_id=r.info_id;
             commit;
           end if;
     
            end;
           end loop;   
     exception
       when no_data_found then
         htp.p('<center><h2>the file  '||p_filename||'    failed!</h2></center>');

           
    end fupdate_clob_text;
    附錄三:新數據庫字符集
    nls——lang
    simplified chinese_china.zhs16gbk
    原數據庫字符集
    american_america.us7ascii.


    ______________________________________

    ===================================================================
    新浪免費電子郵箱 (http://mail.sina.com.cn)
    訂閱手機短信頭條新聞,天天獎多款時尚手機! (http://dailynews.sina.com.cn/c/272235.html)
    訂閱手機短信頂級新聞每天得新款手機大獎! (http://dailynews.sina.com.cn/c/266499.html)

     
    發表評論 共有條評論
    用戶名: 密碼:
    驗證碼: 匿名發表
    主站蜘蛛池模板: 栾城县| 思南县| 乌鲁木齐县| 山阳县| 安庆市| 桃园县| 平湖市| 满城县| 泰宁县| 嘉禾县| 革吉县| 正蓝旗| 泰来县| 乐平市| 凤翔县| 陈巴尔虎旗| 弋阳县| 琼海市| 彰化市| 龙口市| 全椒县| 娱乐| 梁平县| 西充县| 无棣县| 台南市| 鲜城| 霍州市| 屯留县| 门头沟区| 文水县| 伊宁市| 阿克陶县| 城市| 三亚市| 嘉义市| 武清区| 斗六市| 斗六市| 黄陵县| 武威市|