instant000
4th November 2009, 01:05
Good afternoon.

Today while troubleshooting an issue with baan support, they showed me the "ora_users" file.

After discovering the simplicity of this, it spurred me to think that I might be able to automate the creation and deletion of the user accounts.

Namely, if I had the input of username and password, I could possibly automate the following steps:
(1) create the OS user
(2) create the DB user
(3) associate the OS user with the DB user
(I saw what the technician did during the webex for this step,
edited the "ora_users" file, then inserted a new line with
%os-username%:%db-username%:%encrypteddbpassword%:%baan_group_name%
example:
instant000:instant000:dlks283!!#d99d0:baan
(4) copy user authorizations within baan (from a template user)
(i am not sure of how to do this one, but I suspect that there has to be a command line way to do this.)

Does anyone know how to automate step (3)? In our case, the database server is remote, so the technician said that there was no integrated way to associate the os users to the db users using "ora8_admin6.1", as that feature was designed for local databases ... (I don't like it, but it is what it is, I guess.) ... this is why he showed me how to edit the "ora_users" file.

OK, that out of the way, I additionally would want to automate the copying of the user authorizations within baan. (I know how to do this within the application, but was hoping there was a way to do this from the command line.)

Thanks!

Currently, it takes about 50 seconds for me to create baan users, but I would prefer to be quicker, more like 5 seconds. Heck, I would prefer eventually creating a form, where the requestor inputs all the data, and I just check over it and then click a button to have the user automatically created. ... but that's a future state. Right now, I just want to automate the creation of the user, provided minimal input. And eventually, I want to automate the input, to the point that the creation of the user is something I can do at the click of a button. (and thus, delegate to someone lower, and give me more time to work on more important things such as our pending Win 7 migration).
I know that including the time to look over the form is important, but by the time it gets to me, its more about validating that I have enough information to create the user, whereas if I can get all of that validated beforehand via an entry form, I can just hit the button to create the user, so computerizing the form entry would take care of the validation steps. (could be secured simply by making sure that only those in the "managers" group could submit the requests).

Thanks for your help!

instant000
4th November 2009, 01:10
I had a thought ... (funny how you can think after you type things out)

I could append to the file (to do step 3)

example:

%os_username%:%db_username%:%encrypteddb_password%:%baan_group_name% >> ora_users

I think I could tinker with that, and get that to work.

NOw, I'm left with automating step 4.

How can I automate step 4?

instant000
4th November 2009, 01:25
I don't know what executable was called to encrypt the password, and generate the encrypted password string.

It was called "en..." something like that.

I guess I could grep for it, but if someone already knew, that would be easiest, LOL.

(Not at work right now.)

Thanks for your help!

NPRao
4th November 2009, 03:44
It was called "en..." something like that.
$BSE/bin/encrypt6.1 in your version

Also, refer to the thread - Change Password baandb (http://www.baanboard.com/baanboard/showthread.php?t=15817&highlight=crypt)

instant000
4th November 2009, 18:04
Thank you for your help.

I believe that I can automate most of my intentions, I just have a couple looose-ends.

I wanted to address the issue of the user's database password changing, and being able to automatically update that.

i think the solution is the following:

(1) regular old "alter user %db_username% identified by %db_password%
in sqlplus"
(2) run the executable that generates the encrypted password
(3) store that into a variable
(4) get the correct vi command to search the "ora_users" file for the line bearing the user's information
(5) delete that line using vi commands
(6) close the file using vi commands
(7) append the similar string to the ora_users file as before.


What I'm having problems with right now is setting "variables" inside unix.

I could do this in Windows DOS, using the set something=variable, then use that %variable% elsewhere, but I don't know how to do this in Unix. I will resort to posting to the HP forums.

thanks!