Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- spo load.log
- prompt '**** load data ****'
- set termout off
- @@inserts.sql
- commit;
- set termout on
- prompt '**** done ****'
- spo off
- exit;
- set serveroutput on
- variable n number
- exec :n := dbms_utility.get_time
- exec :n := (dbms_utility.get_time - :n)/100
- exec dbms_output.put_line(:n)
- timing start timing_name
- timing stop
- SQL> set timing on
- SQL> select 1 from dual;
- 1
- ----------
- 1
- 1 row selected.
- Elapsed: 00:00:00.00
- SQL>
- time sqlplus @inserts.sql
- real 0m9.34s
- user 0m2.03s
- sys 0m1.02s
- --Beginning of all SQL scripts:
- set serveroutput on feedback on echo on verify on sqlblanklines on timing on define on
- col time new_v v_time
- col name new_v v_name
- col user new_v v_user
- select name, USER, to_char(sysdate, 'YYYYMMDD-HH24MISS') time from v$database;
- --Creates a new log file every time the script is run, and it's immediately
- --obvious when it was run, which environment it ran in, and who ran it.
- spool &v_time._&v_name._&v_user..log
- --Run the select again so it appears in the log file itself
- select name, USER, to_char(sysdate, 'YYYYMMDD-HH24MISS') time from v$database;
- --End of all SQL scripts:
- select name, USER, to_char(sysdate, 'YYYYMMDD-HH24MISS') time from v$database;
- spool off
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement