首页 > 其他分享 >创建分区表在交换分区时报警ORA-14097的处理记录

创建分区表在交换分区时报警ORA-14097的处理记录

时间:2023-01-17 23:00:14浏览次数:57  
标签:orcl150 HR partition NUMBER 14097 分区表 emp table ORA

问题描述:创建分区表在交换分区时报警ORA-14097的处理记录.
数据库:oracle 11.2.0.4
1、问题重现
HR@orcl150> create table p_emp
2 (sal number(7,2))
3 partition by range(sal)
4 (partition emp_p1 values less than (10000),
5 partition emp_p2 values less than (25000));

Table created.

HR@orcl150> create table exchtab1 as select salary from employees where salary<10000;

Table created.

HR@orcl150> create table exchtab2 as select salary from employees where salary between 10000 and 25000;

Table created.

HR@orcl150> alter table p_emp exchange partition emp_p1 with table exchtab1;
alter table p_emp exchange partition emp_p1 with table exchtab1
*
ERROR at line 1:
ORA-14097: column type or size mismatch in ALTER TABLE EXCHANGE PARTITION
2、解决方案
说明:根据告警提示,查字段类型,发现salary字段类型为NUMBER(8,2).
HR@orcl150> set line 100
HR@orcl150> desc employees
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
EMPLOYEE_ID NOT NULL NUMBER(6)
FIRST_NAME VARCHAR2(20)
LAST_NAME NOT NULL VARCHAR2(25)
EMAIL NOT NULL VARCHAR2(25)
PHONE_NUMBER VARCHAR2(20)
HIRE_DATE NOT NULL DATE
JOB_ID NOT NULL VARCHAR2(10)
SALARY NUMBER(8,2)
COMMISSION_PCT NUMBER(2,2)
MANAGER_ID NUMBER(6)
DEPARTMENT_ID NUMBER(4)
HR@orcl150> desc exchtab1
Name Null? Type
----------------------------------------------------- -------- ------------------------------------
SALARY NUMBER(8,2)
HR@orcl150> drop table p_emp purge;

Table dropped.
--修改表p_emp的salary字段类型.
HR@orcl150> create table p_emp
2 (sal number(8,2))
3 partition by range(sal)
4 (partition emp_p1 values less than (10000),
5 partition emp_p2 values less than (25000));

Table created.
--此后成功交换分区
HR@orcl150> alter table p_emp exchange partition emp_p1 with table exchtab1;

Table altered.

标签:orcl150,HR,partition,NUMBER,14097,分区表,emp,table,ORA
From: https://blog.51cto.com/u_12991611/6017845

相关文章

  • 执行explain plan语句时报错ora-12838
    问题描述:执行explainplan语句时报错ora-12838,如下所示:HR@orcl150>insert/*+APPENDPARALLEL*/intot_hr_20230117_new(id,time)select*fromt_hr_20230117;86396ro......
  • typora配置图床教程
    typora配置阿里云图床教程typora的前期准备在文件菜单下,点击选择[偏好设置]点击左侧的图像按照以下配置,然后点击[下载与更新]配置阿里云图床点击控制台......
  • SQL优化案例10(ORACLE SQL语句逻辑读高优化案例)
    川川找我优化SQL,逻辑读达到398,000,安排一下。SQL和执行计划:SELECTt1.*,t3.bed_number,t3.patient_name,t4.nameFROModw_checkrecipe_resultt1leftjoinle......
  • Fedora无法上网,ping不通百度。
    解决办法:dhclient-v问题:ifconfig出现这种情况,pingbaidu.com也不通解决:用了dhclient-v命令后就ping通了。百度了一下,好像是动态获取ip地址。谷咕咕觉得这个应该是临时......
  • Docker下部署oracle10g
    1.拉取oracle10g镜像文件dockerpullvkanjilal/oracle10g2.创建挂载目录mkdir-p/data/oracle1og3.创建oracle容器dockerrun-d-p1521:1521-v/data/oracle10g:/......
  • Oracle创建定时任务调用存储过程
    1.创建一个测试表testcreatetabletest(timedate);2.创建一个存储过程createorreplaceproceduretestasbegininsertintotestvalues(sysdate);end;3.定时任......
  • typora 标题计数
    /**initializecsscounter*/#write{counter-reset:h1}h1{counter-reset:h2}h2{counter-reset:h3}h3{counter-reset:h4}h4{......
  • typescript封装LocalStorage并支持过期时间
    思考在我们使用​​cookie​​​的时候是可以设置有效期的,但是​​localStorage​​​本身是没有该机制的,只能人为的手动删除,否则会一直存放在浏览器当中,可不可以跟cookie一......
  • Vue 使用localStorage报错:_LocalStorage2.default.getItem is not a function
    问题在mounted中使用localStorage获取数据,没想到报错如下:打断点看过localStorage中存在getItem()方法。这个问题类似之前遇到的canvas2image的那个问题(canvasToImage报......
  • Typora软件与Markdown语法
    Typora软件与Markdown语法Typora软件的安装​ Typora是什么软件:​ Typora是一款很火的轻量级支持Markdown语法的文本编辑器​ Typora下载:​ mac:https://mac.qdr......