[20190920]Asynchronous Global Index Maintenance and Recycle Bin.txt
[20190920]Asynchronous Global Index Maintenance and Recycle Bin.txt
--//oracle 12c刪除分割槽時,索引可以延後清理.如果整個分別表刪除了後臺SYS.PMO_DEFERRED_GIDX_MAINT_JOB排程會報ORA-38301錯誤!!
--//做一個例子演示看看:
1.環境:
SCOTT@test01p> @ ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.2.0.1.0 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
create table t
partition by range (d)
(
partition t_q1_2019 values less than (to_date('2019-04-01','yyyy-mm-dd')),
partition t_q2_2019 values less than (to_date('2019-07-01','yyyy-mm-dd')),
partition t_q3_2019 values less than (to_date('2019-10-01','yyyy-mm-dd')),
partition t_q4_2019 values less than (to_date('2020-01-01','yyyy-mm-dd'))
)
as
select rownum as n, to_date('2019-01-01','yyyy-mm-dd') + rownum/(1e5/364) as d, rpad('*',10,'*') as p
from dual
connect by level <= 1e5;
create index i_t_n on t (n) ;
alter table t drop partition t_q1_2019 update indexes;
2.測試:
SCOTT@test01p> select status, orphaned_entries from dba_indexes where index_name = 'I_T_N';
STATUS ORP
------ ---
VALID YES
--//orphaned_entries=YES.
SCOTT@test01p> drop table t;
Table dropped.
--//oracle會定時呼叫job SYS.PMO_DEFERRED_GIDX_MAINT_JOB維護索引,手工執行看看.
--//以sys使用者登入執行:
SYS@test01p> select run_count, failure_count, state from user_scheduler_jobs where job_name='PMO_DEFERRED_GIDX_MAINT_JOB';
RUN_COUNT FAILURE_COUNT STATE
---------- ------------- --------------------
113 0 SCHEDULED
SYS@test01p> exec dbms_scheduler.run_job( 'PMO_DEFERRED_GIDX_MAINT_JOB', false)
PL/SQL procedure successfully completed.
SYS@test01p> select run_count, failure_count, state from user_scheduler_jobs where job_name='PMO_DEFERRED_GIDX_MAINT_JOB';
RUN_COUNT FAILURE_COUNT STATE
---------- ------------- --------------------
114 1 SCHEDULED
--//呼叫失敗.檢視alert.log檔案出現:
2019-09-20T20:38:50.807047+08:00
TEST01P(3):performing DML/DDL operation over object in bin.
2019-09-20T20:38:50.903052+08:00
TEST01P(3):Errors in file D:\APP\ORACLE\diag\rdbms\test\test\trace\test_j000_2224.trc:
ORA-12012: error on auto execute of job "SYS"."PMO_DEFERRED_GIDX_MAINT_JOB"
ORA-38301: can not perform DDL/DML over objects in Recycle Bin
ORA-06512: at "SYS.DBMS_PART", line 131
ORA-06512: at "SYS.DBMS_PART", line 131
ORA-06512: at "SYS.DBMS_PART", line 120
ORA-06512: at line 1
2019-09-20T20:41:42.462865+08:00
TEST01P(3):performing DML/DDL operation over object in bin.
2019-09-20T20:47:02.836189+08:00
--//D:\APP\ORACLE\diag\rdbms\test\test\trace\test_j000_2224.trc:
ORA-12012: error on auto execute of job "SYS"."PMO_DEFERRED_GIDX_MAINT_JOB"
ORA-38301: can not perform DDL/DML over objects in Recycle Bin
ORA-06512: at "SYS.DBMS_PART", line 131
ORA-06512: at "SYS.DBMS_PART", line 131
ORA-06512: at "SYS.DBMS_PART", line 120
ORA-06512: at line 1
--//手工執行DBMS_PART.CLEANUP_GIDX ('SCOTT')看看:
SYS@test01p> exec DBMS_PART.CLEANUP_GIDX ('SCOTT');
BEGIN DBMS_PART.CLEANUP_GIDX ('SCOTT'); END;
*
ERROR at line 1:
ORA-38301: can not perform DDL/DML over objects in Recycle Bin
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ORA-06512: at "SYS.DBMS_PART", line 131
ORA-06512: at "SYS.DBMS_PART", line 131
ORA-06512: at "SYS.DBMS_PART", line 120
ORA-06512: at "SYS.DBMS_PART", line 193
ORA-06512: at line 1
SYS@test01p> host oerr ora 38301
38301, 00000, "can not perform DDL/DML over objects in Recycle Bin"
// *Cause: Tried to perform DDL or DML operation on Recycle Bin object.
// *Action: DDL or DML operations are not permitted on Recycle Bin objects.
3.總結:
--//這個應該算是bug,只能說明oracle軟體的複雜性.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2657798/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20130815]12c Asynchronous Global Index Maintenance Part II.txtIndexAINaN
- [20130815]12c Asynchronous Global Index Maintenance Part III.txtIndexAINaN
- Maintenance of Global Partitioned IndexesAINaNIndex
- [20130813]Global Index Maintenance 11G.txtIndexAINaN
- global index & local index的區別Index
- 【Oracle】global index & local index的區別OracleIndex
- PostgreSQL DBA(170) - pgAdmin(Queries For Index Maintenance)SQLIndexAINaN
- 建立檢視和淺析LOCAL INDEX和GLOBAL INDEXIndex
- partition_global index補疑(一)Index
- 那上邊的到底是 global index還是partition indexIndex
- 分割槽索引之本地(local index)索引和全域性索引(global index)索引Index
- Asynchronous CommitMIT
- oracle recycle bin 研究Oracle
- 非同步模式(Asynchronous)非同步模式
- 4、關於global nopartition index和普通index的概念區別,我認為是global nopartition index是它的底層表必須是分割槽,此時它才有這個概念意思,而普通indIndex
- Simple FSM 3(asynchronous reset)
- 2.3.3 Application MaintenanceAPPAINaN
- ALLOCATE CHANNEL FOR MAINTENANCE 命令AINaN
- Give root password for maintenanceAINaN
- SQL Database Maintenance WizardSQLDatabaseAINaN
- How to purge the Oracle Database Recycle BinOracleDatabase
- ID3d11asynchronous3D
- 非同步提交(Asynchronous COMMIT)非同步MIT
- Simple FSM1(asynchronous reset)
- Simple FSM2(asynchronous reset)
- 2.3.3.1 About Application MaintenanceAPPAINaN
- 11g auto maintenanceAINaN
- Cannot find folder "Maintenance Plans".AINaN
- Three commands for OCR maintenanceAINaN
- Android去掉SrollView、GrdiView、RecycleAndroidView
- asynchronous i/o (aio) on HP-UXAIUX
- Dynamics CRM Asynchronous Service Performance: Code ManiaORM
- Taming the asynchronous beast with ES7AST
- SCSS !globalCSS
- three predefined automated maintenance tasksAINaN
- 上海:International Release and Maintenance EngineerAINaN
- Recovery Catalog creation and MaintenanceAINaN
- Oracle 10 Recycle Bin回收站(轉)Oracle