pl_sql
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| pl_sql [2018/12/08 12:49] – created 0.0.0.0 | pl_sql [2020/04/28 15:20] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== PL/SQL ====== | ||
| - | |||
| [[http:// | [[http:// | ||
| - | =====Write directly to the alert log===== | + | ==== Write directly to the alert log ==== |
| - | < | + | < |
| + | procedure write_alert(p_text in varchar2) is | ||
| + | begin | ||
| + | sys.write_log(2, | ||
| + | end write_alert; | ||
| + | </ | ||
| + | |||
| + | ==== Get default host name and PL/SQL program unit ==== | ||
| + | < | ||
| + | procedure log_text ( p_text | ||
| + | , p_server | ||
| + | , p_database | ||
| + | , p_last_check | ||
| + | , p_severity | ||
| + | , p_script_name | ||
| + | ); | ||
| + | </ | ||
| + | ==== Rebuild unusable indexes ==== | ||
| + | < | ||
| + | set serveroutput on size unlimited | ||
| + | begin | ||
| + | for indexes in | ||
| + | ( | ||
| + | select 'alter index ' | ||
| + | from dba_indexes | ||
| + | where | ||
| + | union all | ||
| + | select 'alter index ' | ||
| + | from dba_ind_partitions | ||
| + | where | ||
| + | union all | ||
| + | select 'alter index ' | ||
| + | from dba_ind_subpartitions | ||
| + | where | ||
| + | ) | ||
| + | loop | ||
| + | dbms_output.put_line(indexes.cmd); | ||
| + | execute immediate indexes.cmd; | ||
| + | end loop; | ||
| + | end; | ||
| + | / | ||
| + | </ | ||
| - | =====Get default host name and PL/SQL program unit===== | ||
| - | < | ||
pl_sql.1544273361.txt.gz · Last modified: 2018/12/08 12:49 by 0.0.0.0
