How to create databases and user interfaces and SQL statements in Oracle

Source: Internet
Author: User

I just got started with Oracle. Below are some simple configurations. I hope it will be helpful for beginners. I hope you can give some comments.

1. Create a database

1) start-ProgramNext, find Database Configuration assistant to enter the database creation wizard.

2) follow the Wizard to continue the next step until the creation is complete. Note the following: the database name/Sid must be set to the two places,

Next, select character set. Here, select zhs16gbk. Select Unicode.

There is also the database creation option, which should be saved as a database template.

2. Create a user

In the program menu, select the Enterprise Manager Console to start the management platform and select start independently. Select sysdba as the first login connection identity.

After entering, select the database you just created, expand -- Security -- Right-click the user and choose create to enter the create user interface.

In this example, the general information is the default one. In the tablespace, the default and temporary options are user and temp respectively.

Then select the permissions you grant to the user in the role and assign permissions as needed. You can grant DBA permissions without special requirements.

You can use other default options.

Below are some SQL commands

It168 College

0: create a user space first. That is, all operations of the user use the space.
Create tablespace datafile "/opt/Oracle/oradata/MySpace. DBF "size 7000 m;
This statement creates a 7 GB tablespace in the/opt/Oracle/oradat directory, the file name is MySpace. DBF.
1. Create a new user
create user cydba identified by cydbapwd defalut tablespace MySpace;
This SQL statement is used to create a new military user named cydba and set its password to cydbapwd. The default tablespace used is MySpace.
2. Create a role to control various resources.
grant
Create session, create any table, create any view, create any index, create any procedure,
alter any table, alter any procedure,
drop any table, drop any view, drop any index, drop any procedure,
select any table, insert any table, update any table, delete any table,
to cyrole;
This statement grants various permissions to the cyrole role.
3. Assign the cyrole role to cydba, that is, enable the cydba user to manage and use resources owned by cyrole.
grant cyrole to cydba;
so far, we have created a new user for ourselves, which uses a specified space, it also specifies the operations that can be performed in the tablespace. :)

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.