如何轉(zhuǎn)移
Oracle9i
數(shù)據(jù)文件
背景介紹:
??????
有時(shí)數(shù)據(jù)庫(kù)文件充滿了整個(gè)分區(qū),如果想把文件轉(zhuǎn)移到其他分區(qū),怎么做?
查看數(shù)據(jù)庫(kù)文件的方法:用
sysdba
角色登錄
sqlplus,
運(yùn)行下面命令:
SQL> select * from sys.dba_data_files;
|
?
?
Step 1
登錄
sqlplus
C:\>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on
星期日
6
月
4 23:05:40 2006
Copyright (c) 1982, 2002, Oracle Corporation.? All rights reserved.
SQL> connect /as sysdba
已連接。
|
?
Step 2
停止所有用戶(hù)的鏈接,關(guān)閉數(shù)據(jù)庫(kù)
SQL> shutdown immediate
數(shù)據(jù)庫(kù)已經(jīng)關(guān)閉。
已經(jīng)卸載數(shù)據(jù)庫(kù)。
ORACLE
例程已經(jīng)關(guān)閉。
SQL> exit
從
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
中斷開(kāi)
?
C:\>
|
?
Step 3
轉(zhuǎn)移數(shù)據(jù)庫(kù)文件。假設(shè)從“
D:\oracle\oradata\OAERP\TSTEST.ORA
”
copy to
“
F:\oracledata\ TSTEST.ORA
”
?
Step 4
重新登錄
sqlplus
C:\>sqlplus /nolog
SQL*Plus: Release 9.2.0.1.0 - Production on
星期日
6
月
4 23:12:41 2006
Copyright (c) 1982, 2002, Oracle Corporation.? All rights reserved.
SQL> connect /as sysdba
已連接到空閑例程。
SQL> startup mount
ORACLE
例程已經(jīng)啟動(dòng)。
?
Total System Global Area? 135338868 bytes
Fixed Size?????????????????? 453492 bytes
Variable Size???????????? 109051904 bytes
Database Buffers?????????? 25165824 bytes
Redo Buffers???????????????? 667648 bytes
數(shù)據(jù)庫(kù)裝載完畢。
SQL>
|
?
Step 5
更改數(shù)據(jù)庫(kù)文件名
SQL> alter database rename file 'D:\oracle\oradata\OAERP\TSTEST.ORA' to 'F:\oracledata\TSTEST.ORA';
數(shù)據(jù)庫(kù)已更改。
SQL>
|
?
Step 6
打開(kāi)數(shù)據(jù)
SQL> alter database open;
數(shù)據(jù)庫(kù)已更改。
SQL>
|
?
注:
1
、如果需要轉(zhuǎn)移多個(gè)文件,只需重做
Step 3
和
step 5
。
?????? 2
、所有操作必須在數(shù)據(jù)庫(kù)服務(wù)器上進(jìn)行。
??????
3
、
Oracle8i
下用
svrmgrl
命令代替
sqlplus
。
??????