Creating a user in Oracle 10g through command line

Assuming Oracle is installed and running…

1. Log into a command console with the oracle user.

> su - oracle

2. Creat a file and place the text below.

drop user npn6 cascade;
create user npn6 identified by npn6;
grant resource, connect, create view to npn6;
commit;

3. log into sqlplus to run the file you created

>sqlplus / as sysdba

4. from the sqlplus console, you may run the file you created, assuming the file name is user.sql

SQL>@user.sql

5. you should get an output like

User created.

Grant succeeded.

Commit complete.

SQL>

5. then you may exit. You have created a user npn6

I tried finding this over google, but i guess i’m not good at hunting :(

Thanks to Ken del Rosario our “Oracle Main Man”.

COMMENTS / ONE COMMENT

[…] « Creating a user in Oracle 10g through command line […]

jcutaran » Blog Archive » Dumping data to Oracle 10g via command line added these pithy words on Feb 18 08 at 1:34 am

SPEAK / ADD YOUR COMMENT
Comments are moderated.

You must be logged in to post a comment.

Return to Top