Oracle creates databases and users

Source: Internet
Author: User

Oracle creates databases and users

In the past, mysql and SQL server were mostly used during development, while Oracle was rarely used and unfamiliar. mysql and SQL server were used in a similar way, the usage of Oracle is different from that of Oracle. When creating a database, Oracle needs to correspond to one user. Generally, the database corresponds to one user, mysql and SQL server can directly create a database by using the create databse "Database Name", while creating a database in Oracle requires the following three steps:

1. Create two database files

2. Create a ing between the user and the file created above.

3. add permissions to users

1. Create two database files (monitor. dbf and monitor_temp.dbf)

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;

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)

Create user monitor identified by monitor default tablespace monitor temporary tablespace monitor_temp;

3. Add Permissions

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

Drop tablespace monitor including contents and datafiles;

5. delete a user

Drop user monitor cascade;

Hands-on test is available.

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.