Oracle CREATE DATABASE and user methods _oracle

Source: Internet
Author: User

Everyone in the project development process to apply MySQL and SQL Server more, Oracle used less, MySQL and SQL Server to use more similar, MySQL and SQL Server directly through the CREATE DATABASE "name" You can create a database, and Oracle needs the database and the user to correspond when creating the database, the following is the steps to create an Oracle database:

Create a file for two databases
Create a mapping relationship between the user and the file created above
Adding permissions to Users
I. Creation of two database files (monitor.dbf and monitor_temp.dbf two files)

Copy Code code as follows:

CREATE tablespace monitor LOGGING datafile ' E:\app\owner\oradata\orcl\monitor.dbf '
SIZE 100M autoextend on NEXT 32M MAXSIZE 500M EXTENT MANAGEMENT Local;

Copy Code code as follows:

Create temporary tablespace monitor_temp tempfile ' E:\app\owner\oradata\orcl\monitor_temp.dbf '
Size 100m autoextend on next 32m maxsize 500m extent management local;

II. Create a mapping relationship between the user and the file created above (user name is monitor, password is monitor)

Copy Code code as follows:

CREATE USER Monitor identified by Monitor DEFAULT tablespace monitor temporary tablespace monitor_temp;

Third, add permissions

Copy Code code as follows:

Grant CONNECT,RESOURCE,DBA to monitor;
Grant create session to monitor;

Sometimes it is also used to delete the database and delete the user's operation, here also gives the deletion statement

Iv. Delete Database

Copy Code code as follows:

DROP tablespace Monitor including CONTENTS and datafiles;

V. Delete users

Copy Code code as follows:

Drop User monitor cascade;

Based on the above steps, you can successfully create Oracle databases and users, and hope to help.

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.