partition table update partition-key result in changing tablespace
partition by list (deptno)
(
partition p1 values ('10') tablespace ts_1,
partition p2 values ('20') tablespace ts_2,
partition p3 values ('30') tablespace ts_3,
partition p4 values ('40') tablespace ts_4
)
as select * from emp ;[@more@]
SQL> select * from pt1 partition (p1) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- --------- --------- ------
7782 CLARK MANAGER 7839 1981-06-09 2450.00 10
7934 MILLER CLERK 7782 1982-01-23 1300.00 10
7839 KING PRESIDENT 1981-11-17 5000.00 10
SQL> alter tablespace ts_1 offline ;
Tablespace altered
SQL> select * from pt1 partition (p1) ;
select * from pt1 partition (p1)
ORA-00376: file 10 cannot be read at this time
ORA-01110: data file 10: '/u01/app/oracle/oradata/BYMIS/datafile/o1_mf_ts_1_6197cj0l_.dbf'
SQL> select * from pt1 ;
select * from pt1
ORA-00376: file 10 cannot be read at this time
ORA-01110: data file 10: '/u01/app/oracle/oradata/BYMIS/datafile/o1_mf_ts_1_6197cj0l_.dbf'
SQL> select * from pt1 partition (p2) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- --------- --------- ------
7369 SMITH CLERK 7902 1980-12-17 800.00 20
7566 JONES MANAGER 7839 1981-04-02 2975.00 20
7788 SCOTT ANALYST 7566 1987-04-19 3000.00 20
7876 ADAMS CLERK 7788 1987-05-23 1100.00 20
7902 FORD ANALYST 7566 1981-12-03 3000.00 20
SQL> select * from pt1 partition (p3) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- --------- --------- ------
7499 ALLEN SALESMAN 7698 1981-02-20 1600.00 300.00 30
7521 WARD SALESMAN 7698 1981-02-22 1250.00 500.00 30
7654 MARTIN SALESMAN 7698 1981-09-28 1250.00 1400.00 30
7698 BLAKE MANAGER 7839 1981-05-01 2850.00 30
7844 TURNER SALESMAN 7698 1981-09-08 1500.00 0.00 30
7900 JAMES CLERK 7698 1981-12-03 950.00 30
6 rows selected
SQL> select * from pt1 partition (p4) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- --------- --------- ------
SQL> alter tablespace ts_1 online ;
Tablespace altered
SQL> select * from pt1 partition (p1) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- --------- --------- ------
7782 CLARK MANAGER 7839 1981-06-09 2450.00 10
7934 MILLER CLERK 7782 1982-01-23 1300.00 10
7839 KING PRESIDENT 1981-11-17 5000.00 10
SQL> update pt1 set deptno=40 where deptno=10 ;
update pt1 set deptno=40 where deptno=10
ORA-14402: updating partition key column would cause a partition change
SQL> update pt1 set deptno=40 where deptno=10 ;
update pt1 set deptno=40 where deptno=10
ORA-14402: updating partition key column would cause a partition change
SQL>
SQL> alter table pt1 enable row movement ;
Table altered
SQL> update pt1 set deptno=40 where deptno=10 ;
3 rows updated
SQL> commit ;
Commit complete
SQL> select * from pt1 partition (p1) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- --------- --------- ------
SQL> select * from pt1 partition (p4) ;
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
----- ---------- --------- ----- ----------- --------- --------- ------
7782 CLARK MANAGER 7839 1981-06-09 2450.00 40
7934 MILLER CLERK 7782 1982-01-23 1300.00 40
7839 KING PRESIDENT 1981-11-17 5000.00 40
SQL>
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/350519/viewspace-1034420/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- add hash partition , default tablespace for patitioned table
- partition table and partition indexIndex
- 今天測試了一下update partition table的part key
- 拆分Table 為Partition Table
- partition table test
- partition table(1)
- partition table(2)
- When to Partition a Table
- [Oracle] Partition table exchange Heap tableOracle
- best practice of rebuild your partition table local index online by using: "update indexes"RebuildIndex
- Oracle Table and tablespace CompressOracle
- Oracle 普通table 轉換為partition tableOracle
- create a partition table using a exsit table
- 分割槽表PARTITION table
- db2 partition table testDB2
- Interval Partition table 11G
- Oracle分割槽表(Partition Table)Oracle
- How to partition a non-partitioned table
- 分割槽表PARTITION table(轉)
- partition table中truncate應用
- mysql partition table use to_days bugMySql
- 關於partition table import的問題Import
- doesn't contain a valid partition tableAI
- Table is specified twice, both as a target for 'UPDATE' and as a separate source
- 【DB】Direct Path EXP Corrupts The Dump If An Empty Table Partition Exists
- Applying “Incremental Statistic” for Oracle Big Partition TableAPPREMOracle
- 資料庫審計(create/alter/drop table、user、tablespace)資料庫
- Data Warehouse Guide閱讀筆記(七):partition tableGUIIDE筆記
- You can‘t specify target table ‘Person‘ for update in FROM clause
- 【MySQL】select for update 的Row Lock 與Table LockMySql
- ext4 lvreduce報錯superblock or the partition table is likely to be corruptVRBloC
- TiDB 原始碼閱讀系列文章(二十)Table PartitionTiDB原始碼
- 修改MySQL資料型別報 Changing columns for table XXX 錯的問題MySql資料型別
- 我眼中的 Nginx(二):HTTP/2 dynamic table size updateNginxHTTP
- mysql中You can’t specify target table for update in FROM clMySql
- ESP32 編譯報錯 57) boot: no bootable app partitions in the partition table編譯bootAPP
- Mysql update in報錯 [Err] 1093 - You can't specify target table 'company_info' for update in FROM clauseMySql
- PARTITION partition01