1、在需要分片的表(CUSTOMER)中建立相关字段,如SGRANT_NUM number(20)及所属部门 SUNIT_ID varchar(10), 2、对该表创建动态视图 CUSTOMER_PV select * from CUSTOMER A where CD_WAREHOUSE.SUNIT_ID is null or exists ( select * from CUSTOMER B where A.SUNIT_ID = B.SUNIT_ID and ( B.SGRANT_NUM >= TO_NUMBER(SUBSTR(USERENV('CLIENT_INFO'), 1, 10)) and ( B.SGRANT_NUM <= TO_NUMBER(SUBSTR(USERENV('CLIENT_INFO'), 11, 10)) ) )