Oracle Create/delete, import/Export command summary

Source: Internet
Author: User
Tags dba

Create a temporary table space

Create temporary tablespace zfmi_temp

Tempfile ' d:oracleoradatazfmizfmi_temp.dbf '

Size 32m

Autoextend on

Next 32m MaxSize 2048m

Extent management Local;

The Tempfile parameter must have

Create a datasheet space

Create Tablespace ZFMI

Logging

DataFile ' d:oracleoradatazfmizfmi.dbf '

Size 100m

Autoextend on

Next 32m MaxSize 2048m

Extent management Local;

The datafile parameter must have

Delete users and all objects of the user

Drop user ZFMI cascade;

The cascade parameter is a cascading deletion of all objects of the user, often encountering problems that users cannot delete if they have an object without this parameter, so it is customary to add this parameter

Delete a table space

Prerequisite: Before deleting a tablespace, make sure that the tablespace is not used by another user before deleting it

Drop tablespace ZFMI including contents and datafiles cascade;

Including contents delete the contents of the tablespace, if there is content in the tablespace before the table space is deleted, but not with this parameter, the table space is not deleted, so it is customary to add this parameter

including datafiles delete data files in a tablespace

Cascade constraints Delete foreign key references for tables in tablespace

If you delete tablespace files before you delete them, you can resolve:

If you delete the data file for the table space before you clear the table space, the database will not start and shut down properly.

You can recover by using the following method (this method has been validated in oracle9i):

In the following procedure, filename is a data file that has been deleted, and if there are more than one, it needs to be executed multiple times; Tablespace_name is the name of the corresponding table space.

$ sqlplus/nolog

Sql> Conn/as sysdba;

If the database is already started, you need to first execute the following line:

sql> Shutdown Abort

Sql> Startup Mount

sql> ALTER DATABASE datafile ' filename ' offline drop;

sql> ALTER DATABASE open;

Sql> drop tablespace tablespace_name including contents;

Create a user and specify a table space

Create user Zfmi identified by ZFMI

Default tablespace zfmi temporary tablespace zfmi_temp;

The identified by parameter must have

Grant all permissions to the message user DBA role

GRANT DBA to Zfmi;

Granting permissions to Users

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.