- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: scripts to create a user copying from an exist...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 01:15 AM
тАО06-22-2004 01:15 AM
I'm looking for a script to allow me to create a new Oracle user copying it from an already existing one? (hpUX11.00 Oracle 8.1.7.4)
TIA.
Art
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 01:33 AM
тАО06-22-2004 01:33 AM
Re: scripts to create a user copying from an existing one
user_uid=`grep -i "oracle_user" /etc/passwd|awk -F : '{print $3}'`
group=`grep -i "oracle_user" /etc/passwd|awk -F : '{print $4}'
comment=`grep -i "oracle_user" /etc/passwd|awk -F : '{print $5}'`
home_dir=`grep -i "oracle_user" /etc/passwd|awk -F : '{print $6}'`
user_shell=`grep -i "oracle_user" /etc/passwd|awk -F : '{print $7}'`
useradd -u "$((user_uid+1)) -g $group -G "secondary_groups" -m -k /home_dir -s $user_shell "user_name_you_want"
But why all this??
vipw and cut paste business.
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 01:35 AM
тАО06-22-2004 01:35 AM
Re: scripts to create a user copying from an existing one
try spooling the following sql to a script and in turn running the script on the other database.
select 'create user '||username||' identified by values '''||password||'''
temporary_tablespace '||temporary_tablespace||' default_tablespace '||default_tablespace||';'
from dba_users;
hope this helps!
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 01:36 AM
тАО06-22-2004 01:36 AM
Re: scripts to create a user copying from an existing one
Is it not at the database level??
Anil gave you the commands to be executed at the OS level...
let us know.
regards
Yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 12:16 PM
тАО06-22-2004 12:16 PM
Re: scripts to create a user copying from an existing one
If you were asking to create a user in a database same as defined in the other database then as Yaoggeraj gave the script will help you to create the user.
And if you want the user data (if any) to be copied to the other database then export from the source database as owner = and then import to the target database as fromuser= and touser=....parameters.
Indira A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 07:49 PM
тАО06-22-2004 07:49 PM
Re: scripts to create a user copying from an existing one
I'm looking for a SQL script to create a new user copying it from another one that alkready exists.
i.e.: copyuser.sql newuser olduser
The script by Yogi it's ok but it only the first step. I need to copy also the roles/priviledges which from old user to the new user.
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 08:38 PM
тАО06-22-2004 08:38 PM
SolutionCheck the following two links:
http://www.orafaq.com/scripts/sql/cre8like.txt
http://mylxhq.com/clubs/o/html/modules.php?name=News&file=article&sid=107
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-22-2004 09:00 PM
тАО06-22-2004 09:00 PM
Re: scripts to create a user copying from an existing one
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-11-2005 11:21 PM
тАО07-11-2005 11:21 PM