Oracle Full-text index-related commands

Source: Internet
Author: User

--Log in with sys user, unlock Ctxsys user
Alter user Ctxsys account unlock;
--Authorization to the corresponding user
Grant execute on CTX_DDL to yw;

--Log in with YW user

--Create a word breaker named My_lexer
exec ctx_ddl.create_preference (' my_lexer ', ' chinese_lexer ');

--Create an index
Create INDEX Idx_addr_view on M_addr_view2 (ADDR) Indextype is Ctxsys. CONTEXT parameters (' lexer my_lexer ');

--Rebuilding the index
ALTER INDEX idx_addr_view REBUILD PARAMETERS (' Replace lexer my_lexer ');

--Synchronous index
Begin
Ctx_ddl.sync_index (' Idx_addr_view ');
End

--Optimized indexing
Begin
Ctx_ddl.optimize_index (' Idx_addr_view ', ' full ');
End


--Create a synchronous stored procedure to synchronize the information in a table field
Create or replace procedure Proc_sync_addr_view as
Begin
Ctx_ddl.sync_index (' Idx_addr_view ');
End

--Create a task, perform a synchronous index
VARIABLE jobno number;
BEGIN
Dbms_job. SUBMIT (: Jobno, ' Proc_sync_addr_view (); ', Sysdate, ' sysdate + 7 ');
Commit
END;

--Create an optimized stored procedure
Create or replace procedure Proc_opti_addr_view as
Begin
Ctx_ddl.optimize_index (' Idx_addr_view ', ' full ');
End

--Create a task, perform a synchronous index
VARIABLE jobno number;
BEGIN
Dbms_job. SUBMIT (: Jobno, ' Proc_opti_addr_view (); ', Sysdate, ' sysdate + 7 ');
Commit
END; --View all Jobselect Job,what,failures,broken from User_jobs in the database--View the running job
SELECT * FROM dba_jobs_running--delete Jobbegin
Dbms_job.broken (4,true); --true = stop false means pause
Dbms_job.remove (4);
Commit
END;

Oracle Full-text index-related commands

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.