Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: login to SQL* Plus in Oracle 9i database

Re: login to SQL* Plus in Oracle 9i database

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sun, 11 Jan 2004 11:58:47 -0800
Message-ID: <1073851049.319498@yasure>


Matt wrote:

> I just downloaded Oracle 9i database from Oracle's site, and I want to
> login SQL * Plus, but dont know the username, password, and host
> string?? any ideas??
>
> thanks

Many of them and all start with reading the documentation. If you approach Oracle like it is MS Access you are going to have a very unpleasant experience.

You need to log on as SYS or SYSTEM and create a user. Then grant that user CREATE SESSION privilege to allow for a connection and then such other privileges as that user may need to create a schema. The following is an example.

connect as SYS
/ AS SYSDBA
do not fill out password or host name in dialog box.

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

you'll probably see something like USERS or DATA create the user

SQL> CREATE USER myuser
IDENTIFIED BY mypassword
DEFAULT TABLESPACE name_from_above_query TEMPORARY TABLESPACE temp
QUOTA 0 ON system
QUOTA UNLIMITED ON name_of_default_tablespace_above;

then grant privileges

SQL> GRANT create session TO myuser;

SQL> GRANT create table TO myuser;

SQL> GRANT create view TO myuser;

SQL> GRANT create synonym TO myuser;

SQL> GRANT create trigger TO myuser;

SQL> GRANT create procedure TO myuser;

You could of course grant the roles CONNECT, RESOURCE, and/or DBA to myuser but that would just be starting out with a bad habit so resist the temptation.

Then connect as your new user:

SQL> CONN myuser/mypassword

And you are in and ready to work.

The above is from memory so please allow for a typor or two.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Jan 11 2004 - 13:58:47 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US