I have many tables that are in an empty tablespace and I want to move the tables to another tablespace.
I have created the tables with this script
-- Create table
create table GSIB_BC_SUB_IDEN
(
sub_iden_id NUMBER(20) not null,
sub_id NUMBER(20) not null,
cust_id NUMBER(20) not null,
network_type VARCHAR2(1),
sub_iden_type VARCHAR2(4) not null,
sub_identity VARCHAR2(64) not null,
primary_flag VARCHAR2(1) not null,
eff_date DATE not null,
exp_date DATE not null,
create_oper_id NUMBER(20),
create_dept_id NUMBER(20),
create_time DATE,
modify_oper_id NUMBER(20),
modify_dept_id NUMBER(20),
modify_time DATE,
upload_date DATE,
file_name VARCHAR2(200)
)
partition by range (EFF_DATE)
(
partition GSIB_BC_SUB_IDEN_PAR_202101 values less than (TO_DATE(' 2021-02-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition GSIB_BC_SUB_IDEN_PAR_202102 values less than (TO_DATE(' 2021-03-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition GSIB_BC_SUB_IDEN_PAR_202103 values less than (TO_DATE(' 2021-04-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition GSIB_BC_SUB_IDEN_PAR_202104 values less than (TO_DATE(' 2021-05-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition GSIB_BC_SUB_IDEN_PAR_202105 values less than (TO_DATE(' 2021-06-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
partition GSIB_BC_SUB_IDEN_PAR_202106 values less than (TO_DATE(' 2021-07-01 00:00:00', 'SYYYY-MM-DD HH24:MI:SS', 'NLS_CALENDAR=GREGORIAN')),
);
-- Create/Recreate primary, unique and foreign key constraints
alter table GSIB_BC_SUB_IDEN
add constraint PK_GSIB_BC_SUBIDEN primary key (SUB_IDEN_ID, EFF_DATE);
How can I move the tables and their partitions to the TB_DAT tablespace
Run this script but it returns this error
ALTER TABLE CBSPROD.GSIB_BC_SUB_IDEN MOVE TABLESPACE TB_DAT;
ORA-14511: cannot perform operation on a partitioned object