Mehran Khan
Mehran Khan

Reputation: 3

How to connect to newly created database on oracle ?

I am using oracle on my local machine. i was using predefined databases and schema like scott of sysdba. yesterday i have created a database through database configuration assistant, now i am trying to connect to that new database by putting username and password through sysdba like;

SQL> connect username/password

but it gives

ERROR: ORA-01017: invalid username/password; logon denied;

WARNING: you are no longer connected to ORACLE.

i have tried searching on google and there are many answers but nothing is relevant and didn't solve my problem.

please do tell me if i'm missing something as i am a noob on oracle. i need to connect to that database because i have to make tablespaces and users in that database.

PS: I have investigated, and the newly created database exist in sysdba databases.

Upvotes: 0

Views: 1546

Answers (1)

Barbaros Özhan
Barbaros Özhan

Reputation: 65228

firstly, connect to SYS schema through command from your OS through

$> sqlplus / as sysdba

( this means to connect to SYS schema, implicitly)

and, then query for if your schema exists through

SQL>select * from dba_users where user_name = 'MYSCHEMA'

if not create one with this command SQL>create user myschema identified by mypasswd; and grant this newly created schema through with this privileges,

SQL>grant connect to myschema;
SQL>grant resource to myschema;
SQL>grant unlimited tablespace to myschema;

Now, you are ready to connect your schema with

SQL> connect myschema/mypasswd@db_sid;

By the way case-sensitivity is not important in oracle provided that you use your names without quotation marks(""). I mean myschema and MYSCHEMA are both same.

Upvotes: 1

Related Questions