Create a temporary tablespace: createtemporarytablespacezfmi_temptempfileD: empty; The tempfile parameter must have the space to create a data table: createtablespacezfmilogging
// Create temporary tablespace zfmi_temp tempfile 'd: oracleoradatazfmizfmi_temp.dbf 'size 32 m autoextend on next 32 m maxsize 2048 m extent management local; // The tempfile parameter must contain // create tablespace zfmi logging
// Create a temporary tablespace
Create temporary tablespace zfmi_temp
Tempfile 'd: oracleoradatazfmizfmi_temp.dbf'
Size 32 m
Autoextend on
Next 32 m maxsize 2048 m
Extent management local;
// The tempfile parameter must have
// Create a data table space
Create tablespace zfmi
Logging
Datafile 'd: oracleoradatazfmizfmi. dbf'
Size 100 m
Autoextend on
Next 32 m maxsize 2048 m
Extent management local;
// The datafile parameter must have
// Delete the user and all objects of the user
Drop user zfmi cascade;
// The cascade parameter is used to cascade the deletion of all objects of the user. if the user has an object but does not add this parameter, the user cannot delete it. Therefore, this parameter is habitually added.
// Delete the tablespace
Prerequisites: before deleting a tablespace, make sure that the tablespace is not used by other users before deleting it.
Drop tablespace zfmi including contents and datafiles cascade onstraints;
// Including contents deletes the content in the tablespace. If the content in the tablespace is not added before the tablespace is deleted, the tablespace cannot be deleted. Therefore, this parameter is habitually added.
// Including datafiles Delete the data files in the tablespace
// Cascade constraints
If the tablespace file is deleted before the tablespace is deleted, the solution is as follows:
If the data file corresponding to the tablespace is deleted before the tablespace is cleared, the database cannot be started or shut down normally.
You can use the following method to restore data (this method has been verified in oracle9i ):
In the following process, filename is a deleted data file. If there are multiple data files, it needs to be executed multiple times. tablespace_name is the name of the corresponding tablespace.
$ Sqlplus/nolog
SQL> conn/as sysdba;
If the database has been started, run the following line first:
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 the tablespace
Create user zfmi identified by zfmi
Default tablespace zfmi temporary tablespace zfmi_temp;
// The identified by parameter must have
// Grant all permissions for the message user DBA role
Grant dba to zfmi;
// Grant permissions to users