表空间已更改。
SQL> select name,status from v$datafile;
NAME STATUS
------------------------------------------------------------ -------
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF SYSTEM
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF ONLINE
D:\HMIT_DB_BACKUP\DEMO.DBF RECOVER
D:\HMIT_DB_BACKUP\TB_CATALOG.DBF ONLINE
D:\HMIT_DB_BACKUP\TEST.DBF ONLINE
已选择8行。
SQL> alter tablespace demo online;
alter tablespace demo online
*
第 1 行出现错误:
ORA-01113: 文件 6 需要介质恢复
ORA-01110: 数据文件 6: 'D:\HMIT_DB_BACKUP\DEMO.DBF'
SQL> recover datafile 'D:\HMIT_DB_BACKUP\DEMO.DBF';
完成介质恢复。
SQL> alter tablespace demo online;
表空间已更改。
SQL> select name,status from v$datafile;
NAME STATUS
------------------------------------------------------------ -------
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF SYSTEM
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF ONLINE
D:\HMIT_DB_BACKUP\DEMO.DBF ONLINE
D:\HMIT_DB_BACKUP\TB_CATALOG.DBF ONLINE
D:\HMIT_DB_BACKUP\TEST.DBF ONLINE
已选择8行。
SQL> alter tablespace demo offline;
表空间已更改。
SQL> select name,status from v$datafile;
NAME STATUS
------------------------------------------------------------ -------
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF SYSTEM
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF ONLINE
D:\HMIT_DB_BACKUP\DEMO.DBF OFFLINE
D:\HMIT_DB_BACKUP\TB_CATALOG.DBF ONLINE
D:\HMIT_DB_BACKUP\TEST.DBF ONLINE
已选择8行。
SQL> alter tablespace demo online;
表空间已更改。
SQL> select name,status from v$datafile;
NAME STATUS
------------------------------------------------------------ -------
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF SYSTEM
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF ONLINE
C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\EXAMPLE01.DBF ONLINE
D:\HMIT_DB_BACKUP\DEMO.DBF ONLINE
D:\HMIT_DB_BACKUP\TB_CATALOG.DBF ONLINE
D:\HMIT_DB_BACKUP\TEST.DBF ONLINE
已选择8行。