日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

asm和file system之间数据文件的转换

發布時間:2023/12/20 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 asm和file system之间数据文件的转换 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

How to move a datafile from a file system to ASM
Moving a datafile from the file system can be achived in two ways.


i. While the database is shutdown (in mount stage).
ii. While the database is running (with the selected tablespace offline).
(
數據文件實現文件系統到ASM的轉換遷移,一是在數據庫mount狀態,二是在open狀態,但數據文件所屬表空間需要offline狀態)
-----------------------------------------------------------------------------------------------

i. While the database is shutdown (in mount stage).
1mount狀態)
Moving oracle datafile while the database is in mount stage is performed in the following way:

1. Shutdown and mount the database.

[oracle@linux] sqlplus '/as sysdba'
SQL> shutdown immediate;
SQL> startup mount;


2. Ensure you have enough space in the ASM diskgroup to copy the datafile.
First identify the size of the datafile you wish to move.

ASM上要有足夠的空間

SQL> select file#, name, (bytes/1048576) File_Size_MB from v$datafile;
FILE# NAME FILE_SIZE_MB
----- ---------------------------- --------------
...
4 /oradata/PROD/users01.dbf 2500
...
* In this example we will be moving users01.dbf

[oracle@linux] export ORACLE_SID=+ASM

SQL> select NAME, STATE, TOTAL_MB, FREE_MB from v$asm_diskgroup;

NAME STATE TOTAL_MB FREE_MB
------------------------------ ----------- ---------- ----------
DGROUP1 MOUNTED 100 3
DGROUP2 MOUNTED 4882 4830


3. Connect to RMAN and copy the datafile from the filesystem to the select ASM diskgroup.

RMAN copy 數據文件

[oracle@linux] rman target=/
RMAN> copy datafile 4 to '+DGROUP2'
Starting backup at 2006/09/05 12:14:23
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=31 devtype=DISK
channel ORA_DISK_1: starting datafile copy
input datafile fno=00004 name=/oradata/PROD/users01.dbf
output filename=+DGROUP2/PROD/datafile/users01.258.600351265 tag=TAG20060905T121424 recid=10 stamp=600351264
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:05:01
Finished backup at 2006/09/05 12:19:24


4. Update the controlfile with the new location of the datafile.

更新控制文件中的數據文件新的文件位置

[oracle@linux] rman target /
RMAN> switch datafile 4 to copy;
datafile 4 switched to datafile copy "+DGROUP2/PROD/datafile/users01.258.600351265".

5. The file is now if the new location.

在數據庫中查看,文件位置已經更新

SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
..
+DGROUP2/PROD/datafile/users01.258.600351265
..

6. The database may now be opened.
open
數據庫。

While the database is running (with the select tablespace offline).

open狀態下轉換
In order to move a datafile on a running active database the tablespace where the datafile resides must be placed offline.

1. Identify the tablespace which contains the datafile and offline the tablespace.

確保表空間offline

SQL> select tablespace_name, file_name from dba_data_files where file_id=4;

TABLESPACE_NAME FILE_NAME
------------------ ------------------------------
USERS /oradata/RMAN/users01.dbf


SQL> alter tablespace USERS offline;

?

* * * * * Continue with Steps 2 - 5 above. * * * * *

以上步驟2-5相同

6. After you have successfully completed the above steps (2 -5) place the

tablespace online;

?

SQL> alter tablespace USERS online;

?

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的asm和file system之间数据文件的转换的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。