home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / programming / oracle7 7.2 / DB / UTIL72 / CATSNAP.SQL < prev    next >
Encoding:
Text File  |  1995-05-09  |  20.9 KB  |  632 lines

  1. rem 
  2. rem $Header: catsnap.sql 7020200.1 95/02/15 18:32:03 cli Generic<base> $
  3. rem 
  4. Rem  Copyright (c) 1991 by Oracle Corporation 
  5. Rem    NAME
  6. Rem      catsnap.sql
  7. Rem    DESCRIPTION
  8. Rem      Creates data dictionary views for snapshots
  9. Rem    NOTES
  10. Rem      Must be run while connected to SYS or INTERNAL.
  11. Rem    MODIFIED   (MM/DD/YY)
  12. Rem     adowning   12/21/94 -  merge changes from branch 1.4.710.4
  13. Rem     adowning   12/05/94 -  fix all_snapshots
  14. Rem     adowning   11/11/94 -  merge changes from branch 1.4.710.3
  15. Rem     adowning   10/14/94 -  fix typo USER to DBA
  16. Rem     wmaimone   05/26/94 -  #186155 add public synoyms for dba_
  17. Rem     rjenkins   01/19/94 -  merge changes from branch 1.4.710.2
  18. Rem     jbellemo   12/17/93 -  merge changes from branch 1.4.710.1
  19. Rem     rjenkins   12/17/93 -  creating job queue
  20. Rem     jbellemo   11/09/93 -  #170173: change uid to userenv schemaid
  21. Rem     rjenkins   07/06/93 -  adding updatable snapshots
  22. Rem     wbridge    12/03/92 -  fix error handling for refresh all 
  23. Rem     tpystyne   11/08/92 -  use create or replace view 
  24. Rem     glumpkin   10/25/92 -  Renamed from SNAPVEW.SQL 
  25. Rem     mmoore     06/02/92 - #(96526) remove v$enabledroles 
  26. Rem     rjenkins   01/14/92 -  copying changes from catalog.sql 
  27. Rem     rjenkins   05/20/91 -         Creation 
  28.  
  29. remark
  30. remark    FAMILY "SNAPSHOTS"
  31. remark    Table replication definitions.
  32. remark
  33.  
  34. create or replace view DBA_SNAPSHOTS
  35. ( OWNER, NAME, TABLE_NAME, MASTER_VIEW, MASTER_OWNER, MASTER, MASTER_LINK,
  36.   CAN_USE_LOG, UPDATABLE, LAST_REFRESH, ERROR, TYPE, NEXT, START_WITH, 
  37.   REFRESH_GROUP, UPDATE_TRIG, UPDATE_LOG, QUERY)
  38. as
  39. select sowner, vname, tname, mview, mowner, master, mlink,
  40.        decode(mod(flag,2), 0, 'NO', 'YES'), 
  41.        decode(mod(trunc(flag/2),2), 0, 'NO', 'YES'), 
  42.        snaptime, error#, 
  43.        decode(auto_fast, 
  44.               'C', 'COMPLETE', 
  45.               'F', 'FAST', 
  46.               '?', 'FORCE', 
  47.               null, 'FORCE', 'ERROR'), 
  48.        auto_fun, auto_date, refgroup, ustrg, uslog, query_txt
  49. from sys.snap$
  50. /
  51. drop public synonym DBA_SNAPSHOTS
  52. /
  53. create public synonym DBA_SNAPSHOTS for DBA_SNAPSHOTS
  54. /
  55. comment on table DBA_SNAPSHOTS is
  56. 'All snapshots in the database'
  57. /
  58. comment on column DBA_SNAPSHOTS.OWNER is
  59. 'Owner of the snapshot'
  60. /
  61. comment on column DBA_SNAPSHOTS.NAME is
  62. 'The view used by users and applications for viewing the snapshot'
  63. /
  64. comment on column DBA_SNAPSHOTS.TABLE_NAME is
  65. 'Table the snapshot is stored in -- has an extra column for the master rowid'
  66. /
  67. comment on column DBA_SNAPSHOTS.MASTER_VIEW is
  68. 'View of the master table, owned by the snapshot owner, used for refreshes'
  69. /
  70. comment on column DBA_SNAPSHOTS.MASTER_OWNER is
  71. 'Owner of the master table'
  72. /
  73. comment on column DBA_SNAPSHOTS.MASTER is
  74. 'Name of the master table that this snapshot is a copy of'
  75. /
  76. comment on column DBA_SNAPSHOTS.MASTER_LINK is
  77. 'Database link name to the master site'
  78. /
  79. comment on column DBA_SNAPSHOTS.CAN_USE_LOG is
  80. 'If NO, this snapshot is complex and will never use a log'
  81. /
  82. comment on column DBA_SNAPSHOTS.UPDATABLE is
  83. 'If NO, the snapshot is read only.  Look up REPLICATION'
  84. /
  85. comment on column DBA_SNAPSHOTS.LAST_REFRESH is
  86. 'SYSDATE from the master site at the time of the last refresh'
  87. /
  88. comment on column DBA_SNAPSHOTS.ERROR is
  89. 'The number of failed automatic refreshes since last successful refresh'
  90. /
  91. comment on column DBA_SNAPSHOTS.TYPE is
  92. 'The type of refresh (complete,fast,force) for all automatic refreshes'
  93. /
  94. comment on column DBA_SNAPSHOTS.NEXT is
  95. 'The date function used to compute next refresh dates'
  96. /
  97. comment on column DBA_SNAPSHOTS.START_WITH is
  98. 'The date function used to compute next refresh dates'
  99. /
  100. comment on column DBA_SNAPSHOTS.REFRESH_GROUP is
  101. 'All snapshots in a given refresh group get refreshed in the same transaction'
  102. /
  103. comment on column DBA_SNAPSHOTS.UPDATE_TRIG is
  104. 'The name of the trigger which fills the UPDATE_LOG'
  105. /
  106. comment on column DBA_SNAPSHOTS.UPDATE_LOG is
  107. 'The table which logs changes made to an updatable snapshots'
  108. /
  109. comment on column DBA_SNAPSHOTS.QUERY is
  110. 'The original query that this snapshot is an instantiation of'
  111. /
  112. /*
  113.  * define the ability to "access a snapshot" as the ability to
  114.  * "access the snapshot's table_name (e.g., snap$_foo).
  115.  */
  116. create or replace view ALL_SNAPSHOTS
  117. as select s.* from dba_snapshots s, sys.obj$ o, sys.user$ u
  118. where o.owner#     = u.user#
  119.   and s.table_name = o.name
  120.   and u.name       = s.owner
  121.   and o.type       = 2                     /* table */
  122.   and ( u.user# in (userenv('SCHEMAID'), 1)
  123.         or
  124.         o.obj# in ( select obj#
  125.                     from sys.objauth$
  126.                     where grantee# in ( select kzsrorol
  127.                                         from x$kzsro
  128.                                       )
  129.                   )
  130.        or /* user has system privileges */
  131.          exists (select null from v$enabledprivs
  132.                  where priv_number in (-45 /* LOCK ANY TABLE */,
  133.                                        -47 /* SELECT ANY TABLE */,
  134.                                        -48 /* INSERT ANY TABLE */,
  135.                                        -49 /* UPDATE ANY TABLE */,
  136.                                        -50 /* DELETE ANY TABLE */)
  137.                  )
  138.       )
  139. /
  140. comment on table ALL_SNAPSHOTS is
  141. 'Snapshots the user can look at'
  142. /
  143. comment on column ALL_SNAPSHOTS.OWNER is
  144. 'Owner of the snapshot'
  145. /
  146. comment on column ALL_SNAPSHOTS.NAME is
  147. 'The view used by users and applications for viewing the snapshot'
  148. /
  149. comment on column ALL_SNAPSHOTS.TABLE_NAME is
  150. 'Table the snapshot is stored in -- has an extra column for the master rowid'
  151. /
  152. comment on column ALL_SNAPSHOTS.MASTER_VIEW is
  153. 'View of the master table, owned by the snapshot owner, used for refreshes'
  154. /
  155. comment on column ALL_SNAPSHOTS.MASTER_OWNER is
  156. 'Owner of the master table'
  157. /
  158. comment on column ALL_SNAPSHOTS.MASTER is
  159. 'Name of the master table that this snapshot is a copy of'
  160. /
  161. comment on column ALL_SNAPSHOTS.MASTER_LINK is
  162. 'Database link name to the master site'
  163. /
  164. comment on column ALL_SNAPSHOTS.CAN_USE_LOG is
  165. 'If NO, this snapshot is complex and will never use a log'
  166. /
  167. comment on column ALL_SNAPSHOTS.LAST_REFRESH is
  168. 'SYSDATE from the master site at the time of the last refresh'
  169. /
  170. comment on column ALL_SNAPSHOTS.ERROR is
  171. 'The error returned last time an automatic refresh was attempted'
  172. /
  173. comment on column ALL_SNAPSHOTS.TYPE is
  174. 'The type of refresh (complete,fast,force) for all automatic refreshes'
  175. /
  176. comment on column ALL_SNAPSHOTS.NEXT is
  177. 'The date function used to compute next refresh dates'
  178. /
  179. comment on column ALL_SNAPSHOTS.START_WITH is
  180. 'The date function used to compute next refresh dates'
  181. /
  182. comment on column ALL_SNAPSHOTS.REFRESH_GROUP is
  183. 'All snapshots in a given refresh group get refreshed in the same transaction'
  184. /
  185. comment on column ALL_SNAPSHOTS.UPDATE_TRIG is
  186. 'The name of the trigger which fills the UPDATE_LOG'
  187. /
  188. comment on column ALL_SNAPSHOTS.UPDATE_LOG is
  189. 'The table which logs changes made to an updatable snapshots'
  190. /
  191. comment on column ALL_SNAPSHOTS.QUERY is
  192. 'The original query that this snapshot is an instantiation of'
  193. /
  194. drop public synonym ALL_SNAPSHOTS
  195. /
  196. create public synonym ALL_SNAPSHOTS for ALL_SNAPSHOTS
  197. /
  198. grant select on ALL_SNAPSHOTS to public with grant option
  199. /
  200. create or replace view USER_SNAPSHOTS
  201. as select s.* from dba_snapshots s, sys.user$ u
  202. where u.user# = userenv('SCHEMAID')
  203.   and s.owner = u.name
  204. /
  205. comment on table USER_SNAPSHOTS is
  206. 'Snapshots the user can look at'
  207. /
  208. comment on column USER_SNAPSHOTS.OWNER is
  209. 'Owner of the snapshot'
  210. /
  211. comment on column USER_SNAPSHOTS.NAME is
  212. 'The view used by users and applications for viewing the snapshot'
  213. /
  214. comment on column USER_SNAPSHOTS.TABLE_NAME is
  215. 'Table the snapshot is stored in -- has an extra column for the master rowid'
  216. /
  217. comment on column USER_SNAPSHOTS.MASTER_VIEW is
  218. 'View of the master table, owned by the snapshot owner, used for refreshes'
  219. /
  220. comment on column USER_SNAPSHOTS.MASTER_OWNER is
  221. 'Owner of the master table'
  222. /
  223. comment on column USER_SNAPSHOTS.MASTER is
  224. 'Name of the master table that this snapshot is a copy of'
  225. /
  226. comment on column USER_SNAPSHOTS.MASTER_LINK is
  227. 'Database link name to the master site'
  228. /
  229. comment on column USER_SNAPSHOTS.CAN_USE_LOG is
  230. 'If NO, this snapshot is complex and will never use a log'
  231. /
  232. comment on column USER_SNAPSHOTS.LAST_REFRESH is
  233. 'SYSDATE from the master site at the time of the last refresh'
  234. /
  235. comment on column USER_SNAPSHOTS.ERROR is
  236. 'The error returned last time an automatic refresh was attempted'
  237. /
  238. comment on column USER_SNAPSHOTS.TYPE is
  239. 'The type of refresh (complete,fast,force) for all automatic refreshes'
  240. /
  241. comment on column USER_SNAPSHOTS.NEXT is
  242. 'The date function used to compute next refresh dates'
  243. /
  244. comment on column USER_SNAPSHOTS.START_WITH is
  245. 'The date function used to compute next refresh dates'
  246. /
  247. comment on column USER_SNAPSHOTS.REFRESH_GROUP is
  248. 'All snapshots in a given refresh group get refreshed in the same transaction'
  249. /
  250. comment on column USER_SNAPSHOTS.UPDATE_TRIG is
  251. 'The name of the trigger which fills the UPDATE_LOG'
  252. /
  253. comment on column USER_SNAPSHOTS.UPDATE_LOG is
  254. 'The table which logs changes made to an updatable snapshots'
  255. /
  256. comment on column USER_SNAPSHOTS.QUERY is
  257. 'The original query that this snapshot is an instantiation of'
  258. /
  259. drop public synonym USER_SNAPSHOTS
  260. /
  261. create public synonym USER_SNAPSHOTS for USER_SNAPSHOTS
  262. /
  263. grant select on USER_SNAPSHOTS to public with grant option
  264. /
  265.  
  266. create or replace view DBA_SNAPSHOT_LOGS
  267. ( LOG_OWNER, MASTER, LOG_TABLE, LOG_TRIGGER, CURRENT_SNAPSHOTS)
  268. as
  269. select m.mowner, m.master, m.log, m.trig, s.snaptime
  270. from sys.mlog$ m, sys.slog$ s
  271. where s.mowner (+) = m.mowner
  272.   and s.master (+) = m.master
  273. /
  274. drop public synonym DBA_SNAPSHOT_LOGS
  275. /
  276. create public synonym DBA_SNAPSHOT_LOGS for DBA_SNAPSHOT_LOGS
  277. /
  278. comment on table DBA_SNAPSHOT_LOGS is
  279. 'All snapshot logs in the database'
  280. /
  281. comment on column DBA_SNAPSHOT_LOGS.LOG_OWNER is
  282. 'Owner of the snapshot log'
  283. /
  284. comment on column DBA_SNAPSHOT_LOGS.MASTER is
  285. 'Name of the master table which the log logs changes of'
  286. /
  287. comment on column DBA_SNAPSHOT_LOGS.LOG_TABLE is
  288. 'Log table; holds rowids and timestamps of rows which changed in the master'
  289. /
  290. comment on column DBA_SNAPSHOT_LOGS.LOG_TRIGGER is
  291. 'An after-row trigger on the master which inserts rows into the log'
  292. /
  293. comment on column DBA_SNAPSHOT_LOGS.CURRENT_SNAPSHOTS is
  294. 'One date per snapshot -- the date the snapshot of the master last refreshed'
  295. /
  296.  
  297. create or replace view USER_SNAPSHOT_LOGS
  298. ( LOG_OWNER, MASTER, LOG_TABLE, LOG_TRIGGER, CURRENT_SNAPSHOTS)
  299. as
  300. select log_owner, master, log_table, log_trigger, current_snapshots
  301. from dba_snapshot_logs s, sys.user$ u
  302. where s.log_owner = u.name
  303.   and u.user# = userenv('SCHEMAID')
  304. /
  305. comment on table USER_SNAPSHOT_LOGS is
  306. 'All snapshot logs owned by the user'
  307. /
  308. comment on column USER_SNAPSHOT_LOGS.LOG_OWNER is
  309. 'Owner of the snapshot log'
  310. /
  311. comment on column USER_SNAPSHOT_LOGS.MASTER is
  312. 'Name of the master table which the log logs changes of'
  313. /
  314. comment on column USER_SNAPSHOT_LOGS.LOG_TABLE is
  315. 'Log table; holds rowids and timestamps of rows which changed in the
  316. master'
  317. /
  318. comment on column USER_SNAPSHOT_LOGS.LOG_TRIGGER is
  319. 'Trigger on master table; fills the snapshot log'
  320. /
  321. comment on column USER_SNAPSHOT_LOGS.CURRENT_SNAPSHOTS is
  322. 'Dates that all known simple snapshots last refreshed'
  323. /
  324. drop public synonym USER_SNAPSHOT_LOGS
  325. /
  326. create public synonym USER_SNAPSHOT_LOGS for USER_SNAPSHOT_LOGS
  327. /
  328. grant select on USER_SNAPSHOT_LOGS to public with grant option
  329. /
  330.  
  331.  
  332. create or replace view DBA_RCHILD 
  333. as select REFGROUP, OWNER, NAME, TYPE from rgchild$
  334. /
  335. comment on table DBA_RCHILD is
  336. 'All the children in any refresh group.  This view is not a join.'
  337. /
  338. drop public synonym DBA_RCHILD
  339. /
  340. create public synonym DBA_RCHILD for DBA_RCHILD
  341. /
  342.  
  343.  
  344. create or replace view DBA_RGROUP
  345. as select REFGROUP, OWNER, NAME,
  346.           decode(mod(flag,2),1,'Y',0,'N','?') IMPLICIT_DESTROY, JOB
  347.   from rgroup$
  348. /
  349. comment on table DBA_RGROUP is
  350. 'All refresh groups.  This view is not a join.'
  351. /
  352. drop public synonym DBA_RGROUP
  353. /
  354. create public synonym DBA_RGROUP for DBA_RGROUP
  355. /
  356.  
  357.  
  358. create or replace view DBA_REFRESH
  359. as select r.owner ROWNER, r.name RNAME, r.REFGROUP,
  360.           decode(mod(r.flag,2),1,'Y',0,'N','?') IMPLICIT_DESTROY,
  361.           j.JOB, j.NEXT_DATE, j.INTERVAL, 
  362.           decode(mod(j.flag,2),1,'Y',0,'N','?') BROKEN
  363.   from rgroup$ r, job$ j
  364.   where r.job = j.job(+)
  365. /
  366. comment on table DBA_REFRESH is
  367. 'All the refresh groups'
  368. /
  369. comment on column DBA_REFRESH.ROWNER is
  370. 'Name of the owner of the refresh group'
  371. /
  372. comment on column DBA_REFRESH.RNAME is
  373. 'Name of the refresh group'
  374. /
  375. comment on column DBA_REFRESH.REFGROUP is
  376. 'Internal identifier of refresh group'
  377. /
  378. comment on column DBA_REFRESH.IMPLICIT_DESTROY is
  379. 'Y or N, if Y then destroy the refresh group when its last item is subtracted'
  380. /
  381. comment on column DBA_REFRESH.JOB is
  382. 'Identifier of job used to automatically refresh the group'
  383. /
  384. comment on column DBA_REFRESH.NEXT_DATE is
  385. 'Date that this job will next be automatically refreshed, if not broken'
  386. /
  387. comment on column DBA_REFRESH.INTERVAL is
  388. 'A date function used to compute the next NEXT_DATE'
  389. /
  390. comment on column DBA_REFRESH.BROKEN is
  391. 'Y or N, Y is the job is broken and will never be run'
  392. /
  393. drop public synonym DBA_REFRESH
  394. /
  395. create public synonym DBA_REFRESH for DBA_REFRESH
  396. /
  397.  
  398.  
  399. create or replace view ALL_REFRESH
  400. as select * from dba_refresh where user = rowner
  401.   or userenv('SCHEMAID') = 0 or exists
  402.   (select kzsrorol
  403.      from x$kzsro x, sys.system_privilege_map m, sys.sysauth$ s
  404.      where x.kzsrorol = s.grantee# and
  405.            s.privilege# = m.privilege and
  406.            m.name = 'ALTER ANY SNAPSHOT')
  407. /
  408. comment on table ALL_REFRESH is
  409. 'All the refresh groups that the user can touch'
  410. /
  411. comment on column ALL_REFRESH.ROWNER is
  412. 'Name of the owner of the refresh group'
  413. /
  414. comment on column ALL_REFRESH.RNAME is
  415. 'Name of the refresh group'
  416. /
  417. comment on column ALL_REFRESH.REFGROUP is
  418. 'Internal identifier of refresh group'
  419. /
  420. comment on column ALL_REFRESH.IMPLICIT_DESTROY is
  421. 'Y or N, if Y then destroy the refresh group when its last item is subtracted'
  422. /
  423. comment on column ALL_REFRESH.JOB is
  424. 'Identifier of job used to automatically refresh the group'
  425. /
  426. comment on column ALL_REFRESH.NEXT_DATE is
  427. 'Date that this job will next be automatically refreshed, if not broken'
  428. /
  429. comment on column ALL_REFRESH.INTERVAL is
  430. 'A date function used to compute the next NEXT_DATE'
  431. /
  432. comment on column ALL_REFRESH.BROKEN is
  433. 'Y or N, Y is the job is broken and will never be run'
  434. /
  435. drop public synonym ALL_REFRESH
  436. /
  437. create public synonym ALL_REFRESH for ALL_REFRESH
  438. /
  439. grant select on ALL_REFRESH to public with grant option
  440. /
  441.  
  442.  
  443. create or replace view USER_REFRESH 
  444. as select * from dba_refresh where rowner = user
  445. /
  446. comment on table USER_REFRESH is
  447. 'All the refresh groups'
  448. /
  449. comment on column USER_REFRESH.ROWNER is
  450. 'Name of the owner of the refresh group'
  451. /
  452. comment on column USER_REFRESH.RNAME is
  453. 'Name of the refresh group'
  454. /
  455. comment on column USER_REFRESH.REFGROUP is
  456. 'Internal identifier of refresh group'
  457. /
  458. comment on column USER_REFRESH.IMPLICIT_DESTROY is
  459. 'Y or N, if Y then destroy the refresh group when its last item is subtracted'
  460. /
  461. comment on column USER_REFRESH.JOB is
  462. 'Identifier of job used to automatically refresh the group'
  463. /
  464. comment on column USER_REFRESH.NEXT_DATE is
  465. 'Date that this job will next be automatically refreshed, if not broken'
  466. /
  467. comment on column USER_REFRESH.INTERVAL is
  468. 'A date function used to compute the next NEXT_DATE'
  469. /
  470. comment on column USER_REFRESH.BROKEN is
  471. 'Y or N, Y is the job is broken and will never be run'
  472. /
  473. drop public synonym USER_REFRESH
  474. /
  475. create public synonym USER_REFRESH for USER_REFRESH
  476. /
  477. grant select on USER_REFRESH to public with grant option
  478. /
  479.  
  480.  
  481.  
  482. create or replace view DBA_REFRESH_CHILDREN
  483. as select rc.owner OWNER, rc.name NAME, rc.TYPE, 
  484.           r.owner ROWNER, r.name RNAME, r.REFGROUP,
  485.           decode(mod(r.flag,2),1,'Y',0,'N','?') IMPLICIT_DESTROY,
  486.           j.job, j.NEXT_DATE, j.INTERVAL,
  487.           decode(mod(j.flag,2),1,'Y',0,'N','?') BROKEN
  488.   from rgroup$ r, rgchild$ rc, job$ j
  489.   where r.refgroup = rc.refgroup
  490.     and r.job = j.job (+)
  491. /
  492. comment on table DBA_REFRESH_CHILDREN is
  493. 'All the objects in refresh groups'
  494. /
  495. comment on column DBA_REFRESH_CHILDREN.OWNER is
  496. 'Owner of the object in the refresh group'
  497. /
  498. comment on column DBA_REFRESH_CHILDREN.NAME is
  499. 'Name of the object in the refresh group'
  500. /
  501. comment on column DBA_REFRESH_CHILDREN.TYPE is
  502. 'Type of the object in the refresh group'
  503. /
  504. comment on column DBA_REFRESH_CHILDREN.ROWNER is
  505. 'Name of the owner of the refresh group'
  506. /
  507. comment on column DBA_REFRESH_CHILDREN.RNAME is
  508. 'Name of the refresh group'
  509. /
  510. comment on column DBA_REFRESH_CHILDREN.REFGROUP is
  511. 'Internal identifier of refresh group'
  512. /
  513. comment on column DBA_REFRESH_CHILDREN.IMPLICIT_DESTROY is
  514. 'Y or N, if Y then destroy the refresh group when its last item is subtracted'
  515. /
  516. comment on column DBA_REFRESH_CHILDREN.JOB is
  517. 'Identifier of job used to automatically refresh the group'
  518. /
  519. comment on column DBA_REFRESH_CHILDREN.NEXT_DATE is
  520. 'Date that this job will next be automatically refreshed, if not broken'
  521. /
  522. comment on column DBA_REFRESH_CHILDREN.INTERVAL is
  523. 'A date function used to compute the next NEXT_DATE'
  524. /
  525. comment on column DBA_REFRESH_CHILDREN.BROKEN is
  526. 'Y or N, Y is the job is broken and will never be run'
  527. /
  528. drop public synonym DBA_REFRESH_CHILDREN
  529. /
  530. create public synonym DBA_REFRESH_CHILDREN for DBA_REFRESH_CHILDREN
  531. /
  532.  
  533.  
  534. create or replace view ALL_REFRESH_CHILDREN
  535. as select * from dba_refresh_children where user = rowner 
  536.   or userenv('SCHEMAID') = 0 or exists
  537.   (select kzsrorol
  538.      from x$kzsro x, sys.system_privilege_map m, sys.sysauth$ s    
  539.      where x.kzsrorol = s.grantee# and
  540.            s.privilege# = m.privilege and
  541.            m.name = 'ALTER ANY SNAPSHOT')
  542. /
  543. comment on table ALL_REFRESH_CHILDREN is
  544. 'All the objects in refresh groups, where the user can touch the group'
  545. /
  546. comment on column ALL_REFRESH_CHILDREN.OWNER is
  547. 'Owner of the object in the refresh group'
  548. /
  549. comment on column ALL_REFRESH_CHILDREN.NAME is
  550. 'Name of the object in the refresh group'
  551. /
  552. comment on column ALL_REFRESH_CHILDREN.TYPE is
  553. 'Type of the object in the refresh group'
  554. /
  555. comment on column ALL_REFRESH_CHILDREN.ROWNER is
  556. 'Name of the owner of the refresh group'
  557. /
  558. comment on column ALL_REFRESH_CHILDREN.RNAME is
  559. 'Name of the refresh group'
  560. /
  561. comment on column ALL_REFRESH_CHILDREN.REFGROUP is
  562. 'Internal identifier of refresh group'
  563. /
  564. comment on column ALL_REFRESH_CHILDREN.IMPLICIT_DESTROY is
  565. 'Y or N, if Y then destroy the refresh group when its last item is subtracted'
  566. /
  567. comment on column ALL_REFRESH_CHILDREN.JOB is
  568. 'Identifier of job used to automatically refresh the group'
  569. /
  570. comment on column ALL_REFRESH_CHILDREN.NEXT_DATE is
  571. 'Date that this job will next be automatically refreshed, if not broken'
  572. /
  573. comment on column ALL_REFRESH_CHILDREN.INTERVAL is
  574. 'A date function used to compute the next NEXT_DATE'
  575. /
  576. comment on column ALL_REFRESH_CHILDREN.BROKEN is
  577. 'Y or N, Y is the job is broken and will never be run'
  578. /
  579. drop public synonym ALL_REFRESH_CHILDREN
  580. /
  581. create public synonym ALL_REFRESH_CHILDREN for ALL_REFRESH_CHILDREN
  582. /
  583. grant select on ALL_REFRESH_CHILDREN to public with grant option
  584. /
  585.  
  586.  
  587. create or replace view USER_REFRESH_CHILDREN
  588. as select * from dba_refresh_children where rowner = user
  589. /
  590. comment on table USER_REFRESH_CHILDREN is
  591. 'All the objects in refresh groups, where the user owns the refresh group'
  592. /
  593. comment on column USER_REFRESH_CHILDREN.OWNER is
  594. 'Owner of the object in the refresh group'
  595. /
  596. comment on column USER_REFRESH_CHILDREN.NAME is
  597. 'Name of the object in the refresh group'
  598. /
  599. comment on column USER_REFRESH_CHILDREN.TYPE is
  600. 'Type of the object in the refresh group'
  601. /
  602. comment on column USER_REFRESH_CHILDREN.ROWNER is
  603. 'Name of the owner of the refresh group'
  604. /
  605. comment on column USER_REFRESH_CHILDREN.RNAME is
  606. 'Name of the refresh group'
  607. /
  608. comment on column USER_REFRESH_CHILDREN.REFGROUP is
  609. 'Internal identifier of refresh group'
  610. /
  611. comment on column USER_REFRESH_CHILDREN.IMPLICIT_DESTROY is
  612. 'Y or N, if Y then destroy the refresh group when its last item is subtracted'
  613. /
  614. comment on column USER_REFRESH_CHILDREN.JOB is
  615. 'Identifier of job used to automatically refresh the group'
  616. /
  617. comment on column USER_REFRESH_CHILDREN.NEXT_DATE is
  618. 'Date that this job will next be automatically refreshed, if not broken'
  619. /
  620. comment on column USER_REFRESH_CHILDREN.INTERVAL is
  621. 'A date function used to compute the next NEXT_DATE'
  622. /
  623. comment on column USER_REFRESH_CHILDREN.BROKEN is
  624. 'Y or N, Y is the job is broken and will never be run'
  625. /
  626. drop public synonym USER_REFRESH_CHILDREN
  627. /
  628. create public synonym USER_REFRESH_CHILDREN for USER_REFRESH_CHILDREN
  629. /
  630. grant select on USER_REFRESH_CHILDREN to public with grant option
  631. /
  632.