Re: Can't log on to SQL Plus

From: DA Morgan <damorgan_at_exesolutions.com>
Date: Wed, 12 Mar 2003 08:50:12 -0800
Message-ID: <3E6F6543.69E320A5_at_exesolutions.com>


Ken Charles wrote:

> I have never used Oracle before. I just installed Oracle 9i on Windows XP
> Pro.
>
> How do I log on to SQL Plus?
> User Name: ?
> Password: ?
> Host string: ?
>
> Is there documentation out there for beginners that's not too technical? I
> just want to start using the product without getting too deep in the
> details.
>
> Thanks for your help!
>
> Ken

First log on as SYS and create a new user.

SQL> / AS SYSDBA
do not put in a password or host name

Create a new user as you should never do any work as SYS.

SELECT tablespace_name
FROM dba_tablespaces
WHERE tablespace_name NOT IN ('SYSTEM', 'TEMP', 'RBS', 'UNDOTBS1');

make a note of available tablespace names with names like USER or DATA.

Then create a new user for your work:

CREATE USER <user_name>
IDENTIFIED BY <password>
DEFAULT TABLESPACE <name_from_above_query> TEMPORARY TABLESPACE temp
QUOTA UNLIMITED ON <name_from_above_query_again>;

Then grant some basic privileges to your new user

GRANT create session to <user_name>;
GRANT create table to <user_name>;
GRANT create view to <user_name>;
GRANT create synonym to <user_name>;
GRANT create procedure to <user_name>;
GRANT create sequence to <user_name>;
GRANT create trigger to <user_name>;
GRANT select any table to <user_name>;

Then connect as the new user

SQL> conn <user_name>/<password>_at_<instance_name>

And for all of you wondering why I didn't suggest granting connect and resource ... why teach bad habits?

Daniel Morgan Received on Wed Mar 12 2003 - 17:50:12 CET

Original text of this message