ORACLE10G 在 LINUX环境下日志损坏后修复并重新处理数据(TEST5实例)

TEST5服务器由有一些原因 出现问题 启动不了数据库

ORA-00600 [2662]错误解决过程

数据库版本:7.3.2

 

背景:

客户那边数据库突然出现一个current日志文件坏了,导致数据库crash了,然后现场工程师使用_ALLOW_RESETLOGS_CORRUPTION = TRUE这个隐含参数,做了不完全恢复后强行将数据库打开。可是打开数据库后发现只能用internal用户连接进去,别的用户连接都报错,错误信息如下:

ORA-00600: internal error code, arguments: [2662], [0], [431267936], [0], [431273216], [0], [], []

查询不了任何应用的表,应用也没法使用,于是想尝试全库的exp出来然后重新imp进去建库,结果发现exp数据也不成功,也是报同样的ORA-600的错误,用户当时数据没有任何的备份过,只能想办法尽量打开数据库,导出数据了。

 

处理过程:

先检查了600错误产生的trace文件:

*** SESSION ID:(7.15) 2004.11.23.23.28.16.824

ksedmp: internal or fatal error

ORA-00600: internal error code, arguments: [2662], [0], [431267754], [0], [431272752], [0], [], []

Current SQL statement for this session:

SELECT * FROM "WHSB"."SB_BSBF"

得到的信息有限,只能看到是严重内部错误,剩下的都是内存堆栈的一堆信息,于是查找了一下这个错误的具体相关信息。

ORA-600 [2662] "Block SCN is ahead of Current SCN",说明当前数据库的数据块的SCN早于当前的SCN,主要是和存储在UGA变量中的dependent SCN进行比较,如果当前的SCN小于它,数据库就会产生这个ORA-600 [2662]的错误了。这个错误一共有五个参数,分别代表不同的含义,

ORA-600 [2662] [a] [b] [c] [d] [e]

Arg [a]  Current SCN WRAP

Arg [b]  Current SCN BASE

Arg [c]  dependent SCN WRAP

Arg [d]  dependent SCN BASE 

Arg [e]  Where present this is the DBA where the dependent SCN came from.

我们分析错误中的提示,它的参数b=431267754,d=431272752,表明当前的SCN确实是小于dependent SCN,所以产生了这个600的错误。

通过查阅文档,发现这个错误的产生原因主要有以下几条:

l         使用隐含参数_ALLOW_RESETLOGS_CORRUPTION后resetlogs打开数据库

l         硬件错误引起数据库没法写控制文件和重做日志文件

l         错误的部分恢复数据库

l         恢复了控制文件但是没有使用recover database using backup controlfile进行恢复

l         数据库crash后设置了_DISABLE_LOGGING隐含参数

l         在并行服务器环境中DLM存在问题

仔细对比了一下,发现问题可能是由于第一条产生的,由于设置了_ALLOW_RESETLOGS_CORRUPTION这个隐含参数后,虽然强制性的打开数据库,但是数据库本身存在了corruption,仍然存在严重的问题。

于是想到使用ADJUST_SCN事件来调整当前的SCN,使其大于dependent SCN,然后保证数据库可以全库的导出,然后重建数据库导入数据。

用internal用户登陆数据库后,连接别的用户,还是失败报错,执行:

alter session set events 'IMMEDIATE trace name ADJUST_SCN level 1';

然后尝试连接别的用户,连接成功。

最后exp整个数据库,重建数据库后导入数据,整个数据库恢复成功!

 

通过这个实例,我们可以看到,尽量的不要去使用那些隐含参数,这些参数是oracle所不推荐使用的,也不是万能的!如果使用了可能会存在一些遗留的问题,如果非要使用,建议使用后一定要exp/imp重建建立数据库。


SZ_DATA_oracle:/home3/backup> exp jxc/xjyjxc file=jxc owner=jxc indexes=n

Export: Release 10.2.0.1.0 - Production on Wed Feb 18 18:24:34 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.
Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
Note: indexes on tables will not be exported

About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user JXC
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user JXC
About to export JXC's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
EXP-00056: ORACLE error 25153 encountered
ORA-25153: Temporary Tablespace is Empty
EXP-00000: Export terminated unsuccessfully

系统导出 出差 提示临时表空间为空

select name from v$tempfile;

alter tablespace temp add tempfile '/home2/datafiles/jxc_data/temp01.dbf' size 500M


然后到处完毕

SZ_DATA_oracle:/home3/backup> exp jxc/xjyjxc file=jxc owner=jxc indexes=n

Export: Release 10.2.0.1.0 - Production on Wed Feb 18 18:29:01 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Export done in ZHS16GBK character set and AL16UTF16 NCHAR character set
Note: indexes on tables will not be exported

About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user JXC
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions for user JXC
About to export JXC's objects ...
. exporting database links
. exporting sequence numbers
. exporting cluster definitions
. about to export JXC's tables via Conventional Path ...
. . exporting table                       ART_DPCY        748 rows exported
. . exporting table                        ART_GRP        188 rows exported
. . exporting table               ART_GRP_20050918        232 rows exported
. . exporting table                    ART_GRP_SUB       1742 rows exported
. . exporting table           ART_GRP_SUB_20050918       2939 rows exported
. . exporting table                  ART_NO_INVENT        672 rows exported
. . exporting table                     ART_TMP10F        737 rows exported
. . exporting table                        BARCODE      24255 rows exported
. . exporting table                       BEST_CXP       5174 rows exported
. . exporting table                      BEST_SELL        735 rows exported
. . exporting table                          BUYER         66 rows exported
. . exporting table                    BUYTIMESALE     167542 rows exported
. . exporting table                       BUY_AREA         16 rows exported
. . exporting table                        CAIPIAO       1125 rows exported
. . exporting table                       CALENDAR       1095 rows exported
. . exporting table                   CHANGE_PRICE     135966 rows exported
. . exporting table               CHANGE_PRICE_BAK     657340 rows exported
. . exporting table                CJL_JLF_ARTICLE        810 rows exported
. . exporting table                   CON_CONTRACT    1532524 rows exported
. . exporting table                CON_CONTRACTTOS    6566572 rows exported
. . exporting table        CON_UNIT_RENT_PAYDETAIL      19716 rows exported
. . exporting table                     CORR_CODES         10 rows exported
. . exporting table                     DELIV_CORR         45 rows exported
. . exporting table                           DEPT         24 rows exported
. . exporting table                   DEPTTIMESALE      50863 rows exported
. . exporting table                          DIFF1       8316 rows exported
. . exporting table                          DIFF2      66556 rows exported
. . exporting table                           EMPL        259 rows exported
. . exporting table                    FRESH_STOCK       1820 rows exported
. . exporting table                       F_TMP09F         19 rows exported
. . exporting table                        F_TMP10         17 rows exported
. . exporting table                        F_TMP11          9 rows exported
. . exporting table                    GRPTIMESALE     823798 rows exported
. . exporting table                GRPTIMESALE_BAK     109478 rows exported
. . exporting table                     GRP_TMP10F         19 rows exported
. . exporting table                     HO_ARTICLE      17714 rows exported
. . exporting table              INVENT_CORRECTION        672 rows exported
. . exporting table                        INVOICE       3173 rows exported
. . exporting table                   INVOICE_LINE      12939 rows exported
. . exporting table                INVOICE_PAYMENT       4790 rows exported
. . exporting table                JLF_ARTICLE_DAY      32751 rows exported
. . exporting table                        JXC_ART
. . exporting partition                    YEAR2007_S1          0 rows exported
. . exporting partition                    YEAR2007_S2          0 rows exported
. . exporting partition                    YEAR2007_S3          0 rows exported
. . exporting partition                    YEAR2007_S4          0 rows exported
. . exporting partition                    YEAR2008_S1    1742659 rows exported
. . exporting partition                    YEAR2008_S2    2160765 rows exported
. . exporting partition                    YEAR2008_S3    2577668 rows exported
. . exporting partition                    YEAR2008_S4    2848062 rows exported
. . exporting partition                       YEAR_MAX    1444100 rows exported
. . exporting table                   JXC_ART_2006      31922 rows exported
. . exporting table                   JXC_ART_2007    6598984 rows exported
. . exporting table                 JXC_ART_TMP10F     666126 rows exported
. . exporting table                         JXC_BC          0 rows exported
. . exporting table                      JXC_BUYER      29780 rows exported
. . exporting table               JXC_BUYER_TARGET        708 rows exported
. . exporting table                        JXC_CXP        311 rows exported
. . exporting table                       JXC_DEPT       4729 rows exported
. . exporting table                JXC_DEPT_TARGET        108 rows exported
. . exporting table                        JXC_FML        222 rows exported
. . exporting table                        JXC_GRP     148213 rows exported
. . exporting table                   JXC_GRP_2005      47761 rows exported
. . exporting table                    JXC_GRP_SUB     765225 rows exported
. . exporting table                         JXC_QH          0 rows exported
. . exporting table                        JXC_QH1          6 rows exported
. . exporting table                        JXC_QH2          0 rows exported
. . exporting table                         JXC_QY        240 rows exported
. . exporting table                 JXC_SALEREPORT      14744 rows exported
. . exporting table                      JXC_STORE       1502 rows exported
. . exporting table                        JXC_SUP     754625 rows exported
. . exporting table                     JXC_TARGET        936 rows exported
. . exporting table                 JXC_TARGET_DAY          0 rows exported
. . exporting table                  JXC_TARGET_SZ        216 rows exported
. . exporting table                    JXC_THISPAY      38439 rows exported
. . exporting table                         JXC_WX        716 rows exported
. . exporting table                        JXC_ZXP       2983 rows exported
. . exporting table                       LY_KOULV         36 rows exported
. . exporting table                       MENU_SUB          2 rows exported
. . exporting table                          MMAIL        119 rows exported
. . exporting table                     MM_ARTICLE       7332 rows exported
. . exporting table                    MM_CALENDAR         99 rows exported
. . exporting table                 MM_ST_ART_EXCP          0 rows exported
. . exporting table                       MONTH_ST      13649 rows exported
. . exporting table                      NO_ART_NO        200 rows exported
. . exporting table                     ORDERS_TMP        357 rows exported
. . exporting table                 ORDER_LINE_TMP       2470 rows exported
. . exporting table                         ORIGIN        809 rows exported
. . exporting table                      PACK_TYPE         68 rows exported
. . exporting table                       PBCATCOL          0 rows exported
. . exporting table                       PBCATEDT         21 rows exported
. . exporting table                       PBCATFMT         20 rows exported
. . exporting table                       PBCATTBL          0 rows exported
. . exporting table                       PBCATVLD          0 rows exported
. . exporting table                       PL_ID_SZ          0 rows exported
. . exporting table                     PRICE_DIFF          0 rows exported
. . exporting table                             QY         81 rows exported
. . exporting table                         SHADOW        337 rows exported
. . exporting table                          SHIFT      30289 rows exported
. . exporting table                      SHIFT_BAK        248 rows exported
. . exporting table                     SH_ARTICLE        337 rows exported
. . exporting table                          STORE          6 rows exported
. . exporting table                  STORETIMESALE      17242 rows exported
. . exporting table                   STORE_TARGET         24 rows exported
. . exporting table                    ST_ART_EXCP        267 rows exported
. . exporting table                  ST_TIME_VISIT      23682 rows exported
. . exporting table              ST_TIME_VISIT_BAK      23682 rows exported
. . exporting table                       SUPPLIER       1942 rows exported
. . exporting table                     SUPPL_ADDR       1823 rows exported
. . exporting table                      SUPP_ADDR        806 rows exported
. . exporting table                     SUP_PINPAI        192 rows exported
. . exporting table                   SZ_ART_SALES       1129 rows exported
. . exporting table                 SZ_BUYER_SALES        190 rows exported
. . exporting table                    SZ_GRP_SALE          0 rows exported
. . exporting table                   SZ_GRP_SALES        248 rows exported
. . exporting table               SZ_GRP_SUB_SALES        100 rows exported
. . exporting table                   SZ_GRP_VISIT         11 rows exported
. . exporting table                   SZ_SUP_SALES        391 rows exported
. . exporting table                            TAX          7 rows exported
. . exporting table                        TB_DEPT         22 rows exported
. . exporting table                     TB_DEPT_NO          3 rows exported
. . exporting table                       TB_DIFF1          8 rows exported
. . exporting table                     TB_DIFF1_2        481 rows exported
. . exporting table                       TB_DIFF2         62 rows exported
. . exporting table                     TB_DIFF2_2      33141 rows exported
. . exporting table                 TB_FRESH_STOCK        362 rows exported
. . exporting table                     TB_JXC_ART      99429 rows exported
. . exporting table                   TB_JXC_BUYER        220 rows exported
. . exporting table                    TB_JXC_DEPT         33 rows exported
. . exporting table                     TB_JXC_GRP       1448 rows exported
. . exporting table                 TB_JXC_GRP_SUB       9557 rows exported
. . exporting table                   TB_JXC_STORE         11 rows exported
. . exporting table                     TB_JXC_SUP       6114 rows exported
. . exporting table                  TB_STOCK_CORR         31 rows exported
. . exporting table                   TMP_AGSS_DAY        273 rows exported
. . exporting table                  TMP_ART_DESCR       9660 rows exported
. . exporting table               TMP_ART_MON_SALE      30816 rows exported
. . exporting table                      TMP_DIFF2      61179 rows exported
. . exporting table                    TMP_GRP_BUY       2939 rows exported
. . exporting table                     TMP_JJ_ART        416 rows exported
. . exporting table                  TMP_SUP_SALES         48 rows exported
. . exporting table                     TMP_TB_FIN     520190 rows exported
. . exporting table                      TMP_VISIT      11178 rows exported
. . exporting table                      TMP_YB_TJ       1160 rows exported
. . exporting table                   TMP_ZBBJ_ART       1654 rows exported
. . exporting table                           UNIT          2 rows exported
. . exporting table                          USERS         56 rows exported
. . exporting table                       XJY_XB_1         84 rows exported
. . exporting table                        YJ_DEPT          9 rows exported
. . exporting table                YJ_MONTH_GUESTS        718 rows exported
. . exporting table                YJ_MON_DEPT_GUE        114 rows exported
. . exporting table                 YJ_MON_GRP_GUE       4739 rows exported
. . exporting table                     YJ_MON_GUE         36 rows exported
. exporting synonyms
. exporting views
. exporting stored procedures
. exporting operators
. exporting referential integrity constraints
. exporting triggers
. exporting indextypes
. exporting posttables actions
. exporting materialized views
. exporting snapshot logs
. exporting job queues
. exporting refresh groups and children
. exporting dimensions
. exporting dimensions
. exporting post-schema procedural objects and actions
. exporting statistics
Export terminated successfully without warnings.
SZ_DATA_oracle:/home3/backup> ls -ltr
总用量 4363364
-rw-r--r--  1 oracle oinstall     327680  2月 18 18:24 jxc_store.dmp
-rw-r--r--  1 oracle oinstall 4463370240  2月 18 19:29 jxc.dmp
SZ_DATA_oracle:/home3/backup> df -k


接下来看好表空间

  1  select '表空间大小',s.tablespace_name,to_char(sum(s.bytes), 'fm999g999g999g999g990') "空间(字节)", count(*)
  2  from sys.dba_data_files s
  3  group by s.tablespace_name
  4* order by s.tablespace_name
SQL> /

'表空间大  TABLESPACE_NAME                空间(字节)             COUNT(*)
---------- ------------------------------ -------------------- ----------
表空间大小 JXC_ART_DATA                   8,589,934,592                 2
表空间大小 JXC_ART_INDEX                  4,294,967,296                 1
表空间大小 JXC_DATA                       4,294,967,296                 2
表空间大小 SYSAUX                         524,288,000                   1
表空间大小 SYSTEM                         2,097,152,000                 1
表空间大小 UNDOTBS2                       3,957,325,824                 1
表空间大小 USERS                          251,658,240                   1

7 rows selected.

如下七个表空间

然后 看数据文件
/home/oracle/oradata/ora10/system01.dbf
/home/oracle/oradata/ora10/sysaux01.dbf
/home/oracle/oradata/ora10/users01.dbf
/home/oracle/oradata/ora10/jxc_data001
/home2/datafiles/jxc_data/jxc_data001
/home3/datafiles/jxc_art_data001
/home3/datafiles/jxc_art_data002
/home2/datafiles/jxc_data/jxc_art_INDEX
/home2/datafiles/jxc_data/UNDOTBS2.dbf

然后重新启动 服务器 启动到图形界面 修改 启动选项、、

不同的运行级定义如下:(可以参考Red Hat Linux 里面的/etc/inittab)

# 缺省的运行级,RHS 用到的级别如下:
# 0 - 停机(千万不要把initdefault 设置为0 )
# 1 - 单用户模式
# 2 - 多用户,但是没有 NFS
# 3 - 完全多用户模式
# 4 - 没有用到
# 5 - X11
# 6 - 重新启动 (千万不要把initdefault 设置为6 )

修改 重启到5  等5分钟 (机器太慢了 方正的破商祺360  E2180CPU 的那款 我fuck 要不是这个机器有问题 我会两天不睡觉 不会的 绝对不会的)

DBCA 重新创建 数据库

Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified

退回ROOT用户

xhost local:oracle

SU - ORACLE

执行重建数据库

先删除数据库

然后重新建立(按照上面的表空间建立)
 
中间设置密码等情节(暂且不表)

建立完毕

然后进入 http://148.20.40.5:1158/em/ 设置


CREATE SMALLFILE TABLESPACE "JXC_ART_INDEX" DATAFILE '/home2/datafiles/jxc_data/jxc_art_index001.dbf' SIZE 4096M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE 5000M NOLOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;
CREATE SMALLFILE TABLESPACE "JXC_DATA" DATAFILE '/home3/datafiles/jxc_data001.dbf' SIZE 4096M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE 10000M NOLOGGING EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO;


CREATE USER "JXC" PROFILE "DEFAULT" IDENTIFIED BY "xjyjxc" DEFAULT TABLESPACE "JXC_DATA" TEMPORARY TABLESPACE "TEMP" ACCOUNT UNLOCK;
GRANT "CONNECT" TO "JXC";
GRANT "DBA" TO "JXC";
GRANT "EXP_FULL_DATABASE" TO "JXC";
GRANT "IMP_FULL_DATABASE" TO "JXC";
GRANT "RESOURCE" TO "JXC";

ALTER TABLESPACE "TEMP" ADD TEMPFILE '/home2/datafiles/jxc_data/temp002.dbf' SIZE 2048M REUSE AUTOEXTEND ON NEXT 100M MAXSIZE 4096M;

imp jxc/xjyjxc fromuser=jxc touser=jxc file=jxc.dmp log=1.log

导入完毕 用时2小时

然后创建数据库链

修改 TNSNAMES.ORA
YU =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 148.20.40.51)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = yu)
    )
  )


create public database link yu connect to xjy identified by ***** using 'YU';

然后检查 TEST5 数据处理的日志  知道没有错误为止

 

 

然后 测试数据处理 奇慢无比 做一下操作

 

 

create unique index JXC_ART_I1 on JXC_ART (ART_NO, RUN_DATE, STORE_NO) TABLESPACE "JXC_ART_INDEX";
create index JXC_ART_I2 on JXC_ART (ART_GRP_NO, ART_GRP_SUB_NO, RUN_DATE, STORE_NO) TABLESPACE "JXC_ART_INDEX";
create index JXC_ART_I3 on JXC_ART (SUPPL_NO, STORE_NO, RUN_DATE) TABLESPACE "JXC_ART_INDEX";

create unique index JXC_DEPT_I1 on JXC_DEPT (STORE_NO, RUN_DATE, DEPT_NO) TABLESPACE "JXC_ART_INDEX";
create index JXC_DEPT_I2 on JXC_DEPT (STORE_NO, DEPT_NO, RUN_DATE) TABLESPACE "JXC_ART_INDEX";
create index JXC_DEPT_I3 on JXC_DEPT (RUN_DATE, STORE_NO, DEPT_NO) TABLESPACE "JXC_ART_INDEX";


create unique index JXC_STORE_I1 on JXC_STORE (STORE_NO, RUN_DATE) TABLESPACE "JXC_ART_INDEX";
create index JXC_STORE_I2 on JXC_STORE (RUN_DATE, STORE_NO) TABLESPACE "JXC_ART_INDEX";

create unique index JXC_SUP_I1 on JXC_SUP (RUN_DATE, STORE_NO, BUYER_UID, SUPPL_NO);
create index JXC_SUP_I2 on JXC_SUP (SUPPL_NO, BUYER_UID, RUN_DATE, STORE_NO);
create index JXC_SUP_I3 on JXC_SUP (RUN_DATE, SUPPL_NO, STORE_NO);


create unique index JXC_GRP_I1 on JXC_GRP (STORE_NO, RUN_DATE, ART_GRP_NO);
create index JXC_GRP_I2 on JXC_GRP (ART_GRP_NO, BUYER_UID, RUN_DATE, STORE_NO);
create index JXC_GRP_I3 on JXC_GRP (RUN_DATE, ART_GRP_NO, STORE_NO);

create unique index JXC_GRP_SUB_I1 on JXC_GRP_SUB (STORE_NO, RUN_DATE, ART_GRP_NO, ART_GRP_SUB_NO);
create index JXC_GRP_SUB_I3 on JXC_GRP_SUB (RUN_DATE, ART_GRP_NO, ART_GRP_SUB_NO, STORE_NO)

创建各个表的的索引

create index tb_jxc_art_i1 on tb_jxc_art( run_date,art_no);

CREATE INDEX TB_JXC_GRP_SUB_I1 ON TB_JXC_GRP_SUB (RUN_DATE,ART_GPR_NO,ART_GPR_SUB_NO);

CREATE INDEX TB_JXC_SUP_I1 ON TB_JXC_SUP (RUN_DATE,SUPPL_NO);

CREATE INDEX TB_DIFF2_2_I1 ON TB_DIFF2_2 (RUN_DATE,ART_NO);

CREATE INDEX TB_JXC_GRP_I1 ON TB_JXC_GRP (RUN_DATE,ART_GRP_NO);

归档 2008年的数据
create table jxc_art_2008 as select * from jxc_art where run_date to_date(20080101,'yyyymmdd')
and to_date(20081231,'yyyymmdd');

create table jxc_art_2009 as select * from jxc_art where run_date to_date(20090101,'yyyymmdd')
and to_date(20091231,'yyyymmdd');


truncate table jxc_art;


重新建立分区

将2007 2008 年的分区删除
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2007_S1" UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2007_S2" UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2007_S3" UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2007_S4" UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2008_S1" UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2008_S2" UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2008_S3" UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" DROP PARTITION "YEAR2008_S4" UPDATE INDEXES;


将最后一个分区 差分2009年12个月

ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "YEAR_MAX" AT (TO_DATE('1/31/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S1", PARTITION "YEAR_MAX_2") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "YEAR_MAX_2" AT (TO_DATE('2/28/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S2", PARTITION "MAX") UPDATE INDEXES;

ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('3/31/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S3", PARTITION "MAX") UPDATE INDEXES;

ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('4/30/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S4", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('5/31/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S5", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('6/30/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S6", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('7/31/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S7", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('8/31/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S8", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('9/30/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S9", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('10/31/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S10", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('11/30/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S11", PARTITION "MAX") UPDATE INDEXES;
ALTER TABLE "JXC"."JXC_ART" SPLIT PARTITION "MAX" AT (TO_DATE('12/31/2009','MM/DD/YYYY')) INTO (PARTITION "JXC_ART_09_S12", PARTITION "MAX") UPDATE INDEXES;

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值