Oracle Database learning starts from scratch

Source: Internet
Author: User

These two days I learned how to use Oracle databases:

 

First, let's talk about the relationship among three concepts in Oracle: tablespace, user, and table. Only tables> databases are supported in sqlserver. However, Oracle has the following relationship:

Field Value --> record value --> table data --> User --> tablespace --> oracle. Oracle may not be familiar with this. My current understanding is that the tablespace is a logical abstraction of Oracle's data storage, that is, you can use the tablespace to define the location where data is stored on the hard disk and how much space is allocated. A user represents an Oracle service object. All data operations must be performed by a user. A user can bind to a specified tablespace or access multiple tablespaces. You can also have multiple users in a tablespace.

 

Oracle installation:

Download oracle11g Installation

Create a database in Oracle:

There are two methods: one is to manually create a folder, It is troublesome to create a lot of folders. The other is to use odca in Oracle configuration and porting tools. Select create a database. Most of the options are default. I only changed the password part and character set to utf8. The SID is the unique identifier of the database you created.

 

The following work is completed in SQL plus:

Create a tablespace: the default tablespace is system, which is not recommended on the Internet. First, create your own tablespace:

Temporary tablespace

Create temporary tablespace zfmi_temp tempfile 'd:/Oracle/oradata/zfmi/zfmi_temp.dbf 'size 100 m autoextend on next 32 m maxsize 2048 M extent management local;

Create a data table space

Create tablespace zfmi logging datafile 'd:/Oracle/oradata/zfmi. dbf' size 100 m autoextend on next 32 m maxsize unlimited;

 

Then create a user and specify the tablespace. I created two users to specify the same tablespace.

Create a user and specify a tablespace
Create user zfmi identified by password default tablespace zfmi temporary tablespace zfmi_temp;

Zfmi is the user name

Password is the password
Grant permissions to users

Grant connect, resource, DBA to zfmi; (DBA: Specify all permissions)

This step completes the creation of a user.

You can log on to the database by using the username and password you just created. It is easy to create a database table by yourself. You can create and modify tables by using SQL statements or in SQL developer.

 

The creation of the constraint relationships between data tables has not been thoroughly studied and is to be continued.

 

By default, the Oracle password expires on the seventh day. The system (Administrator) logon and alter user identified by password are prompted during logon; after changing the password, you can continue to use it.

Reference pages:

Http://zhidao.baidu.com/question/143948884.html

Http://wenku.baidu.com/view/3d244950f01dc281e53af0fa.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.