内射老阿姨1区2区3区4区_久久精品人人做人人爽电影蜜月_久久国产精品亚洲77777_99精品又大又爽又粗少妇毛片

分區(qū)交換altertableexchangepartition在線表歷史表交換

創(chuàng)建表test_part_1 默認(rèn)為users表空間:

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:域名注冊(cè)、雅安服務(wù)器托管、營(yíng)銷(xiāo)軟件、網(wǎng)站建設(shè)、南雄網(wǎng)站維護(hù)、網(wǎng)站推廣。

create table test_part_1(a number, b number)

partition by range(a)

(

  partition p1 values less than (10),

  partition p2 values less than (20),

  partition p3 values less than (30),

  partition p4 values less than (40)

);

創(chuàng)建test_part_1 本地索引

create index idx_id on test_part_1(a) local tablespace TS_KSZIP_BASE;

--插入記錄

insert into test_part_1 values(1,2);

insert into test_part_1 values(11,2);

insert into test_part_1 values(21,2);

insert into test_part_1 values(31,2);

commit;

--查看記錄

select rowid from test_part_1 where a=1;--AAAlz4AAEAAFTUEAAA  查詢(xún)1

--創(chuàng)建中間表

create table test_part_3(a number, b number);

create index idx_id3 on test_part_3(a);--默認(rèn)表空間users

--test_part_1 與中間表交換

alter table test_part_1 exchange partition p1 with table test_part_3 including indexes with validation; --目標(biāo)表有數(shù)據(jù)不能交換,交換只能是分區(qū)和非分區(qū)表交換

--驗(yàn)證

select * from dba_ind_partitions where index_name=upper('idx_id');--p1的表空間變成了users,并且狀態(tài)為usable,不用rebuild

select * from dba_indexes where index_name=upper('idx_id3');--表空間變成了TS_KSZIP_BASE.

select rowid from test_part_3;--AAAlz4AAEAAFTUEAAA 跟查詢(xún)1對(duì)比可見(jiàn) 只是改了數(shù)據(jù)字典

--創(chuàng)建 目標(biāo)分區(qū)表test_part_2

create table test_part_2(a number, b number)

partition by range(a)

(

  partition p1 values less than (10),

  partition p2 values less than (20),

  partition p3 values less than (30),

  partition p4 values less than (40),

  partition p5 values less than (50)

);

create index idx_id2 on test_part_2(a) local tablespace TS_KSZIP_BASE;

alter table test_part_2 exchange partition p1 with table test_part_3 including indexes with validation; --目標(biāo)表有數(shù)據(jù)不能交換,交換只能是分區(qū)非分區(qū)交換

select * from dba_ind_partitions where index_name=upper('idx_id2');--索引p1可用,表空間依然是TS_KSZIP_BASE(因?yàn)榇藭r(shí) idx_id3表空間為T(mén)S_KSZIP_BASE)

select * from dba_indexes where index_name=upper('idx_id3');--表空間為T(mén)S_KSZIP_BASE,狀態(tài)也是usable

網(wǎng)頁(yè)標(biāo)題:分區(qū)交換altertableexchangepartition在線表歷史表交換
轉(zhuǎn)載源于:http://www.rwnh.cn/article38/jsddpp.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供App設(shè)計(jì)、商城網(wǎng)站網(wǎng)站內(nèi)鏈、ChatGPT域名注冊(cè)、網(wǎng)站維護(hù)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)

微信小程序開(kāi)發(fā)
普兰县| 孟村| 临猗县| 奉化市| 闸北区| 永清县| 高州市| 太康县| 泰州市| 巴青县| 凯里市| 桐梓县| 建宁县| 石狮市| 四川省| 平江县| 调兵山市| 泽州县| 连南| 城步| 通州区| 明水县| 营山县| 彩票| 青神县| 海原县| 泾川县| 德钦县| 衡阳市| 濮阳县| 定陶县| 衡水市| 宣城市| 水城县| 南京市| 青冈县| 饶河县| 大渡口区| 房产| 万山特区| 天全县|