Move the datafile to release the diskspace on the drive

來源:互聯網
上載者:User

Nothing special,just keep track the history.

C:\Users\Administrator>tnspic
'tnspic' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Administrator>tnsping orcl

TNS Ping Utility for 64-bit Windows: Version 11.2.0.1.0 - Production on 17-MAY-2013 11:06:32

Copyright (c) 1997, 2010, Oracle.  All rights reserved.

Used parameter files:
E:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora

Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = HP580)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SID = orcl)))
^C

C:\Users\Administrator>
C:\Users\Administrator>set oracle_sid=orcl

C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri May 17 11:08:31 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area 1.0689E+10 bytes
Fixed Size                  2185160 bytes
Variable Size            6174017592 bytes
Database Buffers         4496293888 bytes
Redo Buffers               16977920 bytes
Database mounted.
Database opened.
SQL>
SQL>
SQL> conn businessdata/businessdata
ERROR:
ORA-03113: end-of-file on communication channel
Process ID: 0
Session ID: 419 Serial number: 3

ERROR:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Process ID: 0
Session ID: 0 Serial number: 0

Warning: You are no longer connected to ORACLE.

SQL> show user
USER is ""
SQL> exit
Check diskspace and find there is no diskspace on datafile filesysystem.
C:\Users\Administrator>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Fri May 17 14:33:20 2013

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1.0689E+10 bytes
Fixed Size                  2185160 bytes
Variable Size            6174017592 bytes
Database Buffers         4496293888 bytes
Redo Buffers               16977920 bytes
SQL> alter database rename datafile 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF';
alter database rename datafile 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF'
                      *
ERROR at line 1:
ORA-02231: missing or invalid option to ALTER DATABASE

SQL> abase rename datafile 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.D
SP2-0734: unknown command beginning "abase rena..." - rest of line ignored.
SQL>  rename datafile 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF';
 rename datafile 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF'
                 *
ERROR at line 1:
ORA-00946: missing TO keyword

SQL>
SQL>
SQL> alter database rename file 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF';
alter database rename file 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF'
*
ERROR at line 1:
ORA-01507: database not mounted

SQL> alter database mount;

Database altered.

SQL> alter database rename file 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF';
alter database rename file 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01141: error renaming data file 31 - new file 'E:\DATALRG15.DBF' not found
ORA-01110: data file 31: 'F:\BBCLDB\ORCL\DATALRG15.DBF'
ORA-27041: unable to open file
OSD-04002: unable to open file
O/S-Error: (OS 2) ???????????

SQL> select name from v$database;

NAME
---------
ORCL
cut and paste the file to the target drive.
SQL> alter database rename file 'F:\BBCLDB\orcl\DATALRG15.DBF' to 'E:\DATALRG15.DBF';

Database altered.

SQL> alter database open;

 

 

 

 

 

 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.