How to Create a database and a user in oracle

Source: Internet
Author: User

How to Create a database and a user in oracle

Mysql and SQL server are widely used in the project development process, while oracle is rarely used. mysql and SQL server are similar in use, mysql and sqlserver can directly create a database by using the create database "database Name", while oracle requires the database to correspond to the user's meaning when creating a database, follow these steps to create an oracle database:

Create two database files
Create a ing between the user and the file created above
Add permissions to users
1. Create two database files (monitor. dbf and monitor_temp.dbf) 

Copy codeThe Code is as follows:
Create tablespace monitor logging datafile 'e: \ app \ owner \ oradata \ orcl \ monitor. dbf'
SIZE 100 m autoextend on next 32 m maxsize 500 m extent management local;

Copy codeThe Code is as follows:
Create temporary tablespace monitor_temp tempfile 'e: \ app \ owner \ oradata \ orcl \ monitor_temp.dbf'
Size 100 m autoextend on next 32 m maxsize 500 m extent management local;

2. Create a ing between the user and the file created above (the user name is monitor and the password is monitor)

Copy codeThe Code is as follows:
Create user monitor identified by monitor default tablespace monitor temporary tablespace monitor_temp;

3. Add Permissions

Copy codeThe Code is as follows:
Grant connect, resource, dba to monitor;
Grant create session to monitor;

Sometimes database deletion and user deletion are also used. The delete statement is also provided here.

4. delete a database

Copy codeThe Code is as follows:
Drop tablespace monitor including contents and datafiles;

5. delete a user

Copy codeThe Code is as follows:
Drop user monitor cascade;

 

You can create an oracle database and a user based on the preceding steps.

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.