用rman更改管理裸裝置檔案
--用rman更改管理裸裝置檔案
----裸裝置=>檔案系統
$ export ORACLE_SID=test
$ rman target /
Recovery Manager: Release 11.1.0.7.0 - Production on Wed Apr 29 10:35:43 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: TEST (DBID=1981273836)
RMAN> backup tablespace "TEST";
Starting backup at 29-APR-09
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00007 name=/dev/datavg/rlihjtest1
channel ORA_DISK_1: starting piece 1 at 29-APR-09
channel ORA_DISK_1: finished piece 1 at 29-APR-09
piece handle=/opt/oradata/flash_recovery_area/TEST/backupset/2009_04_29/o1_mf_nnndf_TAG20090429T104149_4zhhmg4q_.bkp tag=TAG20090429T104149 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02
Finished backup at 29-APR-09
RMAN> run
2> {allocate channel d1 type disk;
3> set newname for datafile 7 to '/opt/oradata/oradata/test/lihjtest1';
4> restore datafile 7;
5> release channel d1;
6> }
released channel: ORA_DISK_1
allocated channel: d1
channel d1: SID=141 device type=DISK
executing command: SET NEWNAME
Starting restore at 29-APR-09
channel d1: starting datafile backup set restore
channel d1: specifying datafile(s) to restore from backup set
channel d1: restoring datafile 00007 to /opt/oradata/oradata/test/lihjtest1
channel d1: reading from backup piece /opt/oradata/flash_recovery_area/TEST/backupset/2009_04_29/o1_mf_nnndf_TAG20090429T104149_4zhhmg4q_.bkp
channel d1: piece handle=/opt/oradata/flash_recovery_area/TEST/backupset/2009_04_29/o1_mf_nnndf_TAG20090429T104149_4zhhmg4q_.bkp tag=TAG20090429T104149
channel d1: restored backup piece 1
channel d1: restore complete, elapsed time: 00:00:07
Finished restore at 29-APR-09
released channel: d1
RMAN> recover datafile 7;
---------
--sqlplus 操作!
SQL> alter database datafile 7 offline drop;
Database altered.
SQL> alter database rename file '/dev/datavg/rlihjtest1' to '/opt/oradata/oradata/test/lihjtest1';
Database altered.
SQL> alter database datafile 7 online;
Database altered.
SQL> conn test1/test
Connected.
SQL> select count(*) from dd;
COUNT(*)
----------
7
SQL> select name from v$datafile;
NAME
----------------------------------------------------------------------
/opt/oradata/oradata/test/system01.dbf
/opt/oradata/oradata/test/sysaux01.dbf
/opt/oradata/oradata/test/undotbs01.dbf
/opt/oradata/oradata/test/users01.dbf
/opt/oradata/product/11.1.0/db_2/dbs/imp.dbf
/opt/oradata/product/11.1.0/db_2/dbs/impidx.dbf
/opt/oradata/oradata/test/lihjtest1
7 rows selected.
SQL>
---------
----檔案系統=>裸裝置
$ rman target /
Recovery Manager: Release 11.1.0.7.0 - Production on Wed Apr 29 13:10:50 2009
Copyright (c) 1982, 2007, Oracle. All rights reserved.
connected to target database: TEST (DBID=1981273836)
RMAN> run
2> {allocate channel d1 type disk;
3> set newname for datafile 7 to '/dev/datavg/rlihjtest2';
4> restore datafile 7;
5> release channel d1;
6> }
using target database control file instead of recovery catalog
allocated channel: d1
channel d1: SID=155 device type=DISK
executing command: SET NEWNAME
Starting restore at 29-APR-09
channel d1: restoring datafile 00007
input datafile copy RECID=1 STAMP=685450171 file name=/opt/oradata/oradata/test/lihjtest1
destination for restore of datafile 00007: /dev/datavg/rlihjtest2
ORA-19563: datafile copy header validation failed for file /opt/oradata/oradata/test/lihjtest1
ORA-19600: input file is datafile-copy 1 (/opt/oradata/oradata/test/lihjtest1)
ORA-19601: output file is datafile-copy 0 (/dev/datavg/rlihjtest2)
failover to previous backup
channel d1: starting datafile backup set restore
channel d1: specifying datafile(s) to restore from backup set
channel d1: restoring datafile 00007 to /dev/datavg/rlihjtest2
channel d1: reading from backup piece /opt/oradata/flash_recovery_area/TEST/backupset/2009_04_29/o1_mf_nnndf_TAG20090429T104149_4zhhmg4q_.bkp
channel d1: piece handle=/opt/oradata/flash_recovery_area/TEST/backupset/2009_04_29/o1_mf_nnndf_TAG20090429T104149_4zhhmg4q_.bkp tag=TAG20090429T104149
channel d1: restored backup piece 1
channel d1: restore complete, elapsed time: 00:00:01
Finished restore at 29-APR-09
released channel: d1
RMAN> recover datafile 7;
Starting recover at 29-APR-09
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=155 device type=DISK
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 29-APR-09
RMAN>
---------
--sqlplus 操作!
SQL> alter database datafile 7 offline drop;
Database altered.
SQL> alter database rename file '/opt/oradata/oradata/test/lihjtest1' to '/dev/datavg/rlihjtest2';
Database altered.
SQL> alter database datafile 7 online;
Database altered.
SQL> conn test1/test
Connected.
SQL> select count(*) from dd;
COUNT(*)
----------
7
SQL> select name from v$datafile;
NAME
----------------------------------------------------------------------
/opt/oradata/oradata/test/system01.dbf
/opt/oradata/oradata/test/sysaux01.dbf
/opt/oradata/oradata/test/undotbs01.dbf
/opt/oradata/oradata/test/users01.dbf
/opt/oradata/product/11.1.0/db_2/dbs/imp.dbf
/opt/oradata/product/11.1.0/db_2/dbs/impidx.dbf
/dev/datavg/rlihjtest2
7 rows selected.
SQL>
--利用匯入匯出做資料庫全移植!!
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9879835/viewspace-1021489/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- raw 裸裝置資料檔案更改其他raw裸裝置位置
- 利用rman copy的方法實現儲存上裸裝置資料檔案的遷移ITPUB
- 儲存、檔案管理/目錄、裝置管理
- Linux裸裝置總結Linux
- AIX中的裸裝置AI
- linux udev裸裝置繫結Linuxdev
- 使用 udev 高效、動態地管理 Linux 裝置檔案devLinux
- 使用udev高效、動態的管理Linux裝置檔案devLinux
- 檔案系統&&磁碟管理(六)–swap分割槽、迴環裝置、檔案系統配置檔案fstab
- DM7使用裸裝置搭建DMRAC
- DM8 使用裸裝置搭建DMRAC
- linux-中塊裝置檔案和字元裝置檔案的本質區別Linux字元
- 利用pearcmd實現裸檔案包含
- linux一切皆檔案之塊裝置檔案(四)Linux
- windows 更改檔案關聯Windows
- 408 知識點筆記——作業系統(檔案系統、裝置管理)筆記作業系統
- Linux 裝置檔案/dev/*詳解、查詢Linuxdev
- rhel 7.x 使用 udev scsi rules 配置裸裝置dev
- 基於裸裝置的ASM磁碟組擴容方案ASM
- 記錄一則AIX使用裸裝置安裝OracleRAC的問題AIOracle
- 【智慧裝置】智慧工廠如何運用視覺化進行裝置管理視覺化
- iOS裝置GPS位置更改軟體:FoneLab Location Changer啟用最新版iOS
- 使用 Syncthing 在多個裝置間同步檔案
- 蘋果裝置訪問 Windows 檔案共享教程蘋果Windows
- MacDroid for mac(安卓裝置檔案傳輸助手)Mac安卓
- MacDroid for Mac安卓裝置檔案傳輸工具Mac安卓
- win10 如何更改檔案筐顏色_win10更改檔案筐顏色方法Win10
- 醫療裝置管理系統-智慧裝置管理系統平臺
- Linux下基於裸裝置建立10g資料庫Linux資料庫
- win10如何把txt更改為bat檔案_win10系統把檔案更改為bat檔案的方法Win10BAT
- MacDroid pro for mac(安卓裝置檔案傳輸助手)1.8(160)中文啟用版Mac安卓
- gdb除錯嵌入式裝置的core檔案除錯
- vmware + 裸裝置 + crs + oracle10g RAC搭建步驟(二):安裝linuxOracleLinux
- 12 使用RMAN備份和恢復檔案
- 裝置管理系統AI大模型應用RAG案例AI大模型
- MacDroid pro for mac(安卓裝置檔案傳輸助手)1.8中文啟用版Mac安卓
- 作業系統——裝置驅動和檔案系統作業系統
- flutter-讀寫二進位制檔案到裝置Flutter
- Linux7更改檔案開啟數Linux