Some useful DBA statements (updated slowly)

Source: Internet
Author: User

I wrote a mess in the previous article, so I opened a new one.

Start with the preparation of the database.

1. Create a tablespace:

 
SQL> Create tablespace wings datafile 'd: \ app \ User \ oradata \ L \ wings_f01.dbf 'size 50 m autoextend on next 50 m maxsize 1024 m;

The above is only one data file at a time, and the following is more than one file:

 
SQL> Create tablespace wings_temp datafile 'd: \ app \ User \ oradata \ CMDL \ wings_tf01.dbf 'size 50 m autoextend on next 50 m maxsize 1024 M, 'd: \ app \ User \ oradata \ L \ wings_tf02.dbf 'size 50 m autoextend on next 50 m maxsize 1024 m;

If the data file reaches 1024 MB, an error is reported. You can add a data file to the tablespace:

SQL> alter tablespace wings add datafile 'd: \ app \ User \ oradata \ L \ wings_f02.dbf 'size 50 m autoextend on next 50 m maxsize 1024 m;

 

After the tablespace is created, you can create a user:

 
SQL> create user wings identified by wings default tablespace wings;

Here, I set the default tablespace of the wings user to wings. This is also the general practice of an enterprise when establishing a database. A single user has a tablespace, and the index also needs a separate tablespace. I will not go into details here.

Next, I want to grant the DBA permission to wings:

 
SQL> grant DBA to wings;

At this time, the wings user can start to work.

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.