====== pears.TextIndexesReBuild ======
Generated schema reference. Regenerate this page from the SQL unload; keep hand-maintained business notes in the narrative namespace.
===== Description =====
Forces the rebuilding of all manual and auto refresh text indexes
===== Original SQL =====
create procedure "pears"."TextIndexesReBuild"()
begin
for "IndexLoop" as "IndexCursor" no scroll cursor for
select "user_name","index_name","table_name","refresh_type"
from "SYS"."SYSIDX" as "i"
join "sys"."SYSTEXTIDX" as "e" on "e"."index_id" = "i"."object_id" and "e"."sequence" = 1
join "sys"."SYSTAB" as "t" on "t"."table_id" = "i"."table_id"
join "sys"."SYSTEXTCONFIG" as "f" on "f"."object_id" = "e"."text_config"
join "sys"."SYSUSER" as "u" on "u"."user_id" = "t"."creator"
where "refresh_type" in( 1,2 ) for read only
do
execute immediate("string"('refresh text index [',"index_name",'] on [',"user_name",'].[',"table_name",'] force build'))
end for
end
go
COMMENT ON PROCEDURE "pears"."TextIndexesReBuild" IS
'Forces the rebuilding of all manual and auto refresh text indexes'
go
COMMENT TO PRESERVE FORMAT ON PROCEDURE "pears"."TextIndexesReBuild" IS
{create procedure TextIndexesReBuild
/* Application Maintained Function / Procedure - DO NOT EDIT*/
()
BEGIN
for IndexLoop as IndexCursor no scroll cursor for
select
user_name, index_name, table_name, refresh_type
from
SYS.SYSIDX as i
join sys.SYSTEXTIDX as e on e.index_id = i.object_id and e.[sequence] = 1
join sys.SYSTAB as t on t.table_id = i.table_id
join sys.SYSTEXTCONFIG as f on f.object_id = e.text_config
join sys.SYSUSER as u on u.user_id = t.creator
where refresh_type in (1,2)
for read only
do
execute immediate (string('refresh text index [', index_name, '] on [', user_name, '].[', table_name, '] force build'));
end for
END
}