473,485 Members | 1,393 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Running Batch Jobs without Exposing User ID/Passwords or Source of SQL statements?!

Hi.

I have a number of batch jobs that are ran nightly on our Windows 2000 based
Oracle 8.1.7 (soon to be 9i) server. I have these designed just right, so
the Windows Scheduled Tasks runs them and then a parser goes through the
output and, in case of errors, sends me a page...

The database is our financial system which requires users to login using
Oracle based user ID / Password.

Here are two concerns:

1. Right now, the batch files used to schedule the processes, parse the
output and generate Emails, have a set of Oracle User ID/Password hardcoded
in them. Ideally, I would want to use Windows authentication to schedule the
jobs so that passwords are not visible to others.

2. Of course, the source of the batch process is visible in SQL format and
can be viewed and, worse yet, modified by malicious hackers... Ideally, I
guess, most of the SQL processing could move to stored procedures...

Dare I mention SQLServer 2000?! I had to recently pick that up to help
manage several other projects and am quite impressed by the way one creates
Jobs and processes that remain pretty much secure from these kind of issues.
I know Oracle must have similar features, but I am not familiar enough with
them and hope you can make appropriate suggestions... How do others
approach these problems?

Thanks.
Jun 27 '08 #1
3 6692
John wrote:
Hi.

I have a number of batch jobs that are ran nightly on our Windows 2000
based
Oracle 8.1.7 (soon to be 9i) server. I have these designed just right, so
the Windows Scheduled Tasks runs them and then a parser goes through the
output and, in case of errors, sends me a page...

The database is our financial system which requires users to login using
Oracle based user ID / Password.

Here are two concerns:

1. Right now, the batch files used to schedule the processes, parse the
output and generate Emails, have a set of Oracle User ID/Password
hardcoded in them. Ideally, I would want to use Windows authentication to
schedule the jobs so that passwords are not visible to others.

2. Of course, the source of the batch process is visible in SQL format and
can be viewed and, worse yet, modified by malicious hackers... Ideally, I
guess, most of the SQL processing could move to stored procedures...

Dare I mention SQLServer 2000?! I had to recently pick that up to help
manage several other projects and am quite impressed by the way one
creates Jobs and processes that remain pretty much secure from these kind
of issues. I know Oracle must have similar features, but I am not familiar
enough with
them and hope you can make appropriate suggestions... How do others
approach these problems?

Thanks.
Not knowing how bound you are to your code, or what kind of coding style you
used, here are a few thoughts ...

1) Oracle database comes with a built-in job scheduler, DBMS_JOBS, that can
submit any PL/SQL procedure as a job.

2) Oracle database has ability to call DLLs using 'External Procedures', so
if you scheduled jobs are DLLs, you can run them under DB control.

3) Oracle database has native ability to send email using UTL_SMTP package.
The contents can, of course, be generated dynamically.
All of the above are fairly easy to use and documented at
http://docs.oracle.com. In particular, the DBMS_JOBS and UTL_SMTP are
documeted in the "Supplied PL/SQL Packages" docco.

4) Oracle database comes with a WORKFLOW package that has ability to send
out emails, and receive & parse emails as a response. (See Workflow docco)

5) Oracle database comes with a mesage queue mechanism called Advanced
QUeueing which could receive the async request from an unqualifies batch
job, through subscription, and use that to trigger a job or a workflow.
(See Advanced QUeue docco)

These are a bit more involved but not terribly difficult to use either.

HTH
/Hans
Jun 27 '08 #2
Hi.

The scripts are simply a list of SQL / PL/SQL statements. I run them using
sqlplus and redirect their output to log files that I can parse for errors.

To keep the code secure from manipulation, should I encapsulate each script
in a stored procedure and then call the stored procedure from a Windows
account that has no right but execute that procedure? Is there any way to
turn on trace on stored procedures to get equivalent of a log for parsing
purposes?

Thanks.

"Hans Forbrich" <fo******@yahoo.netwrote in message
news:_9KFc.86983$HS3.28374@edtnps84...
John wrote:
Hi.

I have a number of batch jobs that are ran nightly on our Windows 2000
based
Oracle 8.1.7 (soon to be 9i) server. I have these designed just right,
so
the Windows Scheduled Tasks runs them and then a parser goes through the
output and, in case of errors, sends me a page...

The database is our financial system which requires users to login using
Oracle based user ID / Password.

Here are two concerns:

1. Right now, the batch files used to schedule the processes, parse the
output and generate Emails, have a set of Oracle User ID/Password
hardcoded in them. Ideally, I would want to use Windows authentication
to
schedule the jobs so that passwords are not visible to others.

2. Of course, the source of the batch process is visible in SQL format
and
can be viewed and, worse yet, modified by malicious hackers... Ideally,
I
guess, most of the SQL processing could move to stored procedures...

Dare I mention SQLServer 2000?! I had to recently pick that up to help
manage several other projects and am quite impressed by the way one
creates Jobs and processes that remain pretty much secure from these
kind
of issues. I know Oracle must have similar features, but I am not
familiar
enough with
them and hope you can make appropriate suggestions... How do others
approach these problems?

Thanks.

Not knowing how bound you are to your code, or what kind of coding style
you
used, here are a few thoughts ...

1) Oracle database comes with a built-in job scheduler, DBMS_JOBS, that
can
submit any PL/SQL procedure as a job.

2) Oracle database has ability to call DLLs using 'External Procedures',
so
if you scheduled jobs are DLLs, you can run them under DB control.

3) Oracle database has native ability to send email using UTL_SMTP
package.
The contents can, of course, be generated dynamically.
All of the above are fairly easy to use and documented at
http://docs.oracle.com. In particular, the DBMS_JOBS and UTL_SMTP are
documeted in the "Supplied PL/SQL Packages" docco.

4) Oracle database comes with a WORKFLOW package that has ability to send
out emails, and receive & parse emails as a response. (See Workflow
docco)
>
5) Oracle database comes with a mesage queue mechanism called Advanced
QUeueing which could receive the async request from an unqualifies batch
job, through subscription, and use that to trigger a job or a workflow.
(See Advanced QUeue docco)

These are a bit more involved but not terribly difficult to use either.

HTH
/Hans

Jun 27 '08 #3
"John" <Jo**@nospam.comwrote in message news:<44aGc.6867$pY2.6190@lakeread01>...
Hi.

The scripts are simply a list of SQL / PL/SQL statements. I run them using
sqlplus and redirect their output to log files that I can parse for errors.

To keep the code secure from manipulation, should I encapsulate each script
in a stored procedure and then call the stored procedure from a Windows
account that has no right but execute that procedure? Is there any way to
turn on trace on stored procedures to get equivalent of a log for parsing
purposes?

Thanks.
That could work. You need to grant EXECUTE on the procs and CREATE
SESSION to the user, of course.

Oracle also comes with the "wrap" utility. You can use this to turn
your plain text source code into encrypted gibberish -- at least as
far as the average user is concerned. The database can of course read
this just fine. This is the utility that Oracle uses for its supplied
packages.

========
You can enable tracing in an SQL script by adding your alter session
statement. In PL/SQL, you can use
"dbms_session.set_sql_trace(TRUE);".

You could also add an autonomous transaction to simply write to a log
table whenever a procedure is executed. Using autonomous transaction
ensures the record remains whether or not the procedure or session
issues a ROLLBACK.

========
BTW, I use a simplier technique in UNIX: the "HEREFILE" format. Here
is an example:
sqlplus /nolog <<-HEREFILE
connect batch_oper/secret_passwd@ORCL_8a

@script1.sql
@script2.sql

exit
HEREFILE

The "HEREFILE" strings act as labels only and can be anything.
Everything between them is passed as standard input (i.e. as if you
were typing). Thus the internal commands are hidden from the process
list.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1644
by: Neil Davidson | last post by:
We have a component without a user interface which we want to license at design time. If someone has a design-time license then they should be able to compile applications using the component,...
3
2119
by: bill | last post by:
I need to open a asp.net web form from a classic asp page, and pass a username and password to the asp.net page. The username and password exist as session variables in the classic asp...
2
1639
by: Stephen | last post by:
Hi all, I want to create an app that runs a batch file which inturn runs applications. question: if I start the batch file from app1, how can app1 know that the batch file ran successfully...
4
6412
by: Shiraz | last post by:
Hi I'm using Visual Studio Installer to make my installer, and have not as yet figured out a straightforward way to use it to set environmental variables. Amongst the various things I tried, I'm...
0
1992
by: sandyschiru | last post by:
Hi, I just started learning DB2. I need to write Batch Jobs in DB2. Aby one let me know how to start with and any materials to refer. Please let me know the materials to refer.
3
2133
by: psbasha | last post by:
Hi, I would like to call the same aplication executable with and without Graphical User Interface. Requirement: With Tkinter User interface,user can give the inputs to run the application (...
3
1091
by: mista852003 | last post by:
Help?!!! How to delete the row in datagrid without delete from data source?
3
3271
by: =?Utf-8?B?QmlsbHkgWmhhbmc=?= | last post by:
I have a asp.net page, it uses js to print in IE. It always has the prompting user window appear. I have tried: <input onclick="document.all.WebBrowser.ExecWB(6,6)" type="button"...
0
6960
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6825
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7275
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5418
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4551
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.