中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

Oracle11G 在線重定義

發布時間:2020-06-16 04:21:46 來源:網絡 閱讀:582 作者:dbapower 欄目:關系型數據庫

create tablespace tbs1 datafile '/opt/oracle/oradata/haier/tbs1.dbf' size 500m autoextend on maxsize 2G;

 

create tablespace tbs2 datafile '/opt/oracle/oradata/haier/tbs2.dbf' size 500m autoextend on maxsize 2G;


create tablespace tbs3 datafile '/opt/oracle/oradata/haier/tbs3.dbf' size 500m autoextend on maxsize 2G;


SQL> desc HHHH
 Name        Null?    Type
 ----------------------------------------- -------- ----------------------------
 PNTMALL_PNT_ID         NUMBER
 PNTMALL_PNT_DT         DATE
.......
 PNTMALL_HRTYPE_DESC        VARCHAR2(2000)



SQL> selectcount(*) from HHHH;

 

  COUNT(*)

----------

  16713034


alter table HHHH add constraint HHHH_PKEY primary key(PNTMALL_PNT_ID);


create table HHHH_tmp

partition by range(PNTMALL_PNT_DT)

(

partition p1 values less than (to_date('2016-01-01','yyyy-mm-dd')) tablespace tbs1,

partition p2 values less than (to_date('2017-01-01','yyyy-mm-dd')) tablespace tbs2,

partition p3 values less than (maxvalue) tablespace tbs3

)

as

select * from HHHH where 1=2;


SQL> begin

  2 DBMS_REDEFINITION.START_REDEF_TABLE('BER','HHHH','HHHH_TMP');

  3  end;

  4  /

 

PL/SQL proceduresuccessfully completed

 

SQL> selectobject_id,object_name,object_type,status from user_objects where object_namelike '%HHH%';

 

 OBJECT_ID OBJECT_NAME                                                                     OBJECT_TYPE         STATUS

------------------------------------------------------------------------------------------------------------- -------

    115233 HHHH_PKEY                                                                       INDEX               VALID

    115232 HHHH                                                                            TABLE               VALID

    115341 HHHH_TMP                                                                        TABLE PARTITION     VALID

    115340 HHHH_TMP                                                                        TABLE PARTITION     VALID

    115339 HHHH_TMP                                                                        TABLE PARTITION     VALID

    115338 HHHH_TMP                                                                        TABLE               VALID

    115342 MLOG$_HHHH                                                                      TABLE               VALID

    115343 RUPD$_HHHH


SQL> selectcount(*) from HHHH;

 

  COUNT(*)

----------

  16713034

 

SQL> selectcount(*) from HHHH_TMP;

 

  COUNT(*)

----------

  16713034


SQL> exec DBMS_REDEFINITION.COPY_TABLE_DEPENDENTS('BER','HHHH','HHHH_TMP',NUM_ERRORS => :V_ERR);

 

 

PL/SQL procedure successfully completed.



SQL> print v_err

 

     V_ERR

----------

 0


SQL> selectobject_id,object_name,object_type,status from user_objects where object_namelike '%HHH%';

 

 OBJECT_ID OBJECT_NAME                                                                     OBJECT_TYPE         STATUS

------------------------------------------------------------------------------------------------------------- -------

    115344 TMP$$_HHHH_PKEY0                                                                INDEX               VALID

    115343 RUPD$_HHHH                                                                      TABLE               VALID

    115342 MLOG$_HHHH                                                                      TABLE               VALID

    115338 HHHH_TMP                                                                        TABLE               VALID

    115339 HHHH_TMP                                                                        TABLE PARTITION     VALID

    115340 HHHH_TMP                                                                        TABLE PARTITION     VALID

    115341 HHHH_TMP                                                                        TABLE PARTITION     VALID

    115232 HHHH                                                                            TABLE               VALID

    115233 HHHH_PKEY                                                                       INDEX               VALID

 

9 rows selected


SQL> selecttable_name,index_name,status from user_indexes where table_name='HHHH_TMP';

 

TABLE_NAME                     INDEX_NAME                     STATUS

------------------------------------------------------------ --------

HHHH_TMP                       TMP$$_HHHH_PKEY0               VALID



SQL> EXECDBMS_REDEFINITION.SYNC_INTERIM_TABLE('BER','HHHH','HHHH_TMP');

 

PL/SQL proceduresuccessfully completed


SQL> selectobject_id,object_name,object_type,status from user_objects where object_namelike '%HHH%';

 

 OBJECT_ID OBJECT_NAME                                                                     OBJECT_TYPE         STATUS

------------------------------------------------------------------------------------------------------------- -------

    115338 HHHH                                                                            TABLE               VALID

    115339 HHHH                                                                            TABLE PARTITION     VALID

    115340 HHHH                                                                            TABLE PARTITION     VALID

    115341 HHHH                                                                            TABLE PARTITION     VALID

    115232 HHHH_TMP                                                                        TABLE               VALID

    115344 HHHH_PKEY                                                                       INDEX               VALID

    115233 TMP$$_HHHH_PKEY0                                                                INDEX               VALID

 

7 rows selected


向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

伊宁县| 宁阳县| 阿坝| 平罗县| 永寿县| 临沂市| 宁城县| 达州市| 凤山市| 安吉县| 洪江市| 神木县| 施秉县| 新和县| 湟中县| 岢岚县| 昌黎县| 宁河县| 阿勒泰市| 罗城| 泗阳县| 霍州市| 武功县| 扬中市| 合水县| 万年县| 高清| 嘉禾县| 嵊泗县| 蕉岭县| 克拉玛依市| 长沙县| 肃宁县| 新昌县| 牡丹江市| 永济市| 昌黎县| 新巴尔虎左旗| 郑州市| 瓮安县| 平乡县|