MySQL Forums
Forum List  »  Oracle

Re: Creating an Oracle schema/database
Posted by: David Royle
Date: June 18, 2007 09:55AM

Stephane,

The Oracle installation will have a created an Oracle instance and database if you
followed the prompts.

Oracle will have installed a Windows service named OracleService{NNNNN} {yourname}
and a listener service called Oracle{NNNNN}TNSListener, plus some others you may not require.
If you haven't got these in the Windows services, then you need to run the Database Configuration Assistant from the menu and create an instance and database.
Once you have these, you then need to connect as system or sys to the database using SQLPLUS from the command line or the GUI or other third-party tool.
From the command line "SQLPLUS system/password@{yourDBname}" this should give you
a SQL> prompt if successful.

From that point on you can now create a user, grant this user required privleges, connect in SQLPLUS as that user and then run SQL scripts to create user/schema objects such as tables, views and stored procedures.

Example:

SQL> create user FRED identifed by FREDPASSWORD;
SQL> grant connect, resource to FRED;
SQL> connect fred/fredpassword@myDB;
SQL> create table test ( col1 number, col2 varchar2(20)); ~ example table
SQL> Run your SQL scripts to create further objects.....

It is important to connect as the user FRED before running any scripts, this in
essence will create the schema, otherwise you may create objects under the system schema and this could cause problems.


Hope this helps
David

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Creating an Oracle schema/database
12629
June 18, 2007 09:55AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.