--offline data files in non-archive mode--because the database is in non-archive mode, when the data file goes offline, it causes the information to be lost, so that the data file can no longer be brought online.--that's not working. Therefore, in non-archive mode, it is often not possible toshutdownImmediatestartup MountAlter DatabaseNoarchivelog;Alter Database Open;Alter DatabaseDataFile'd:\app\administrator\product\11.2.0\dbhome_1\database\users3.dbf'Offline for Drop;Select file_name, fromDba_data_fileswhereTablespace_name= 'Users';--Note Using this statement simply takes the data file offline, the data file is not available, the data file information is not removed from the data dictionary and the control file, and the data file is not deleted from the disk. --the file can then be deleted with the deletion of the table space to which it belongs. Altertablespace users datafile offline;SelectName,status fromV$datafilewherets#=(Selectts# fromV$tablespacewhereName='Users');--View the status of individual data files in the Users table spacerecover TABLESPCE users;--change the name and location of the data fileAlterTablespacle...rename datafile ... to--change the name and location of the data file in the same tablespace. Alter DatabaseRenamefile... to--change the name and location of data files in multiple table spaces--ExampleSelect file_name, bytes fromDba_data_fileswhereTablespace_name= 'Users';Altertablespace users datafile offline;host copy d:\app\administrator\oradata\orcl\users02.dbf d:\disk1\ Users02.dbfhost copy d:\app\administrator\oradata\orcl\users04.dbf d:\disk1\users04.dbfAltertablespace users Rename datafile'd:\app\administrator\oradata\orcl\users02.dbf','d:\app\administrator\oradata\orcl\users04.dbf' to'd:\disk1\users02.dbf','d:\disk1\users02.dbf'Altertablespace users online;--to modify the name and location of data files in multiple table spacesSelect file_name, bytes fromDba_data_fileswhereTablespace_nameinch('Users','Example');shutdownimmediatestartup mounthost copy d:\app\administrator\oradata\orcl\users01.dbf d:\disk2\users01.dbfhost copy d:\ APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF d:\disk2\example01.dbfAlter DatabaseRenamefile_nameAlter Database Open;--Delete a data fileAlterTablespace ...DropDataFile--deletes the empty data file specified in the persistent tablespace. AlterTablespace ...DropTempfile--deletes the empty temporary data file specified in the staging tablespace. --ExampleAlterTablespace usersDropdatafile'd:\app\administrator\product\11.2.0\dbhome_1\database\users03.dbf';AlterTablespaceTemp DropTempfile'd:\app\administrator\oradata\orcl\temp02.dbf';Alter DatabaseTempfile'd:\app\administrator\oradata\orcl\temp02.dbf'Drop;--Querying data FilesDba_data_files--contains information about all data files of the database, including the table space to which the data file belongs, data file number, etc.Dba_temp_files--contains information about all temporary data files for a databaseDba_extents--contains descriptive information for all allocated extents in all table spacesUser_extents--contains descriptive information about the areas that the current user owns that are allocated in all tablespacesDba_free_space--contains descriptive information about the idle area in the tablespaceUser_free_space--contains descriptive information about the idle area in the table space that the current user can accessV$datafile--contains data file information obtained from the control fileV$datafile_header--contains information obtained from the head of the data fileV$tempfile--contains basic information for all temporary data files
Oracle (Create data file 1)