Failed script [message #644075] |
Tue, 27 October 2015 16:23 |
|
gbernas
Messages: 4 Registered: October 2015
|
Junior Member |
|
|
Why knows why this script fail when I try to execute it through an OEM job. I"m trying to determine which users will expire within the next 14 days.
If anyone knows how I can get this information through BI publisher - Management Repository Views - that would be event better.
column name format a30
set linesize 300
select
name,
TO_CHAR(ctime,'DD-MM-YYYY HH:MI') Create_Date,
TO_CHAR(ptime,'DD-MM-YYYY HH:MI') Last_Changed,
TO_CHAR(EXPTIME,'DD-MM-YYYY HH:MI') Expire_Date
from
sys.user$
where
EXPTIME <= sysdate + 14
and
Name not in ('RCU_INSTALL')
and
ASTATUS = 0
order by name
|
|
|
|
|
|
|
|
Re: Failed script [message #644143 is a reply to message #644141] |
Wed, 28 October 2015 08:57 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
There's no terminator at the end of your script. Try to put a semi-colon (or a slash) there, such asor
(Note that I don't use OEM so this is a pure SQL*Plus advice).
[Updated on: Wed, 28 October 2015 08:57] Report message to a moderator
|
|
|
Re: Failed script [message #644145 is a reply to message #644075] |
Wed, 28 October 2015 09:07 |
gazzag
Messages: 1119 Registered: November 2010 Location: Bedwas, UK
|
Senior Member |
|
|
This works for me:
SQL> column name format a30
SQL> set linesize 300
SQL> select
2 name,
3 TO_CHAR(ctime,'DD-MM-YYYY HH:MI') Create_Date,
4 TO_CHAR(ptime,'DD-MM-YYYY HH:MI') Last_Changed,
5 TO_CHAR(EXPTIME,'DD-MM-YYYY HH:MI') Expire_Date
6 from
7 sys.user$
8 where
9 EXPTIME <= sysdate + 14
10 and
11 Name not in ('RCU_INSTALL')
12 and
13 ASTATUS = 0
14 order by name
15 /
NAME CREATE_DATE LAST_CHANGED EXPIRE_DATE
------------------------------ ---------------- ---------------- ----------------
USER01 27-02-2015 11:05 16-09-2015 12:59 11-09-2015 03:20
USER02 29-05-2014 01:10 16-09-2015 01:02 11-09-2015 12:31
SQL>
Post your entire SQL*Plus session, like I did.
|
|
|