Help in Shell scripting to modify the User Creation script in oracle database.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help in Shell scripting to modify the User Creation script in oracle database.
# 1  
Old 12-29-2008
Java Help in Shell scripting to modify the User Creation script in oracle database.

Hi,

I have several users to create on my test Oracle database taking the scripts from the Production Oracle database. I have a separate text file where I have user-id and passwords maintained. I need help in writing a shell script to go thru the user creation scripts and replace VALUES '(redacted)' with the passwords maintained in the file based on the user-id. The password is encrypted when the script is extracted from the production database.


My passwords.txt will contain the following entry:

(redacted)


The extracted script from the production database is as follows:

Code:
CREATE USER "(redacted)" IDENTIFIED BY VALUES '(redacted)'
DEFAULT TABLESPACE "(redacted)"
TEMPORARY TABLESPACE "TEMP"
 PROFILE  "APPLICATION" 
/

After running the shell script the new file should contain the following:

Code:
CREATE USER "(redacted)" IDENTIFIED BY (redacted)
DEFAULT TABLESPACE "(redacted)"
TEMPORARY TABLESPACE "TEMP"
 PROFILE  "APPLICATION" 
/

Thanks a lot in advance

Ram.

Last edited by Corona688; 10-16-2015 at 03:40 PM..
# 2  
Old 01-08-2009
Since you are using SQL I guess that you can do it using PL/SQL (or whatever SQL programming language you have there).
If not then you need to parse some files => thus learn about shell,awk,grep,etc.
You might use ANT as well...
There are many ways of getting this done. Do not expect that someone would give you a solution (at least without money). Anyway - this is a simple thing to do.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script for user account Creation

Hi Folks, I had a request to create the user request. Between, I just write a script a create, Update Geos, and update the password. My script as below: The error message, what I am getting is all the users are updated with the same Goes value.. #!/bin/bash for i in `cat users.txt`;do... (2 Replies)
Discussion started by: gsiva
2 Replies

2. UNIX for Dummies Questions & Answers

How to fix connection to Oracle database through shell script?

I have a question regarding how to connect to Oracle Database through shell script. 1. If I want call a stored procedure on Linux server as this, it works. $sqlplus /nolog SQL*Plus: Release 12.1.0.2.0 Production on Fri Jun 12 14:49:49 2015 Copyright (c) 1982, 2014, Oracle. All rights... (2 Replies)
Discussion started by: duke0001
2 Replies

3. Forum Support Area for Unregistered Users & Account Problems

Creation of Oracle table through shell scripting

Hi, I am trying to create a table through shell scripting . I used a command sqlplus -s to connect to sqlplus and user as sysdba. but there is a problem in it. can anyone please solve this . #!/bin/bash $(`sqlplus -s / as sysdba <<eof create table sample (id,int); insert into sample... (1 Reply)
Discussion started by: Unregistered
1 Replies

4. Shell Programming and Scripting

How to connect to Oracle database using shell script?

Hi All, I am newbie to unix shell scripting. I want to connect to oracle database using shell script. I know how to connect DB using user name and password but my question is if my password is having '@' sign then how to connect. I have tried like below, cnt=`sqlplus -s /nolog << EOFSQL ... (3 Replies)
Discussion started by: pmotewar
3 Replies

5. Shell Programming and Scripting

Shell Script to connect to the oracle database

Hi Unix Gurus, I have a requirement to write a script, Oracle DB gets referesh every 6hrs, hence we need write a script to connect to the database , if it connects it should generate a file to proceed the next job application or when an error when connectiong to DB it should not generate any... (8 Replies)
Discussion started by: bshivali
8 Replies

6. UNIX and Linux Applications

Really simple shell script to create oracle database

Hello , I am new in this forum and need your help as I am totally confused :confused: I read a lot of threads and tried to search a lot but did not get the exact answer to my question. I just want a simple (content wise may be long) shell script to create oracle database. In detail:... (5 Replies)
Discussion started by: rahoolm
5 Replies

7. Shell Programming and Scripting

Connecting to oracle database from shell script

Hi all, I am satyakiran , i am new to the forum. i never done shell scripts for connecting to the data base (oracle) and fetching the data from the database( thru sql select statements ) i want to know 1. how to connect to the data base(oracle) using shell script 2. how to retrieve data... (8 Replies)
Discussion started by: satyakiran
8 Replies

8. UNIX for Dummies Questions & Answers

Shell scripting+connect to oracle database+spooling

Hi! Everyone I am new to the shell scripting basically.I have been asked to create a shell script that connect to a oracle database to read data from a particular schema then spool it into a csv file then email to customer. Can anybody let me know how to go about that. I have create... (14 Replies)
Discussion started by: Mr Mo
14 Replies

9. Shell Programming and Scripting

Need shell script to extract data from oracle database

shell script (4 Replies)
Discussion started by: frns5
4 Replies

10. Shell Programming and Scripting

user creation using shell script for JSP

hello friends, I have problem. We want to create user from jsp(browser based) on our linux server. How we can do that ? or How do we create a user with shell programming by taking arguments and checking with the existing users and if the user exist it should display the message the user exists... (1 Reply)
Discussion started by: jarkvarma
1 Replies
Login or Register to Ask a Question