asm 檔案系統遷移
此文是在oracle10g的基礎上,將從到管理的檔案系統上。
一、環境:
OS :
[oracle@yitai ~]$ lsb_release --all
LSB Version: :core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID: RedHatEnterpriseAS
Description: Red Hat Enterprise Linux AS release 4 (Nahant Update 7)
Release: 4
Codename: NahantUpdate7
RDBMS:
SQL> SELECT * FROM V$VERSION;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for Linux: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
ASM:(這裡使用磁碟組DATA2)
SQL> select name, state, type from v$asm_diskgroup;
NAME STATE TYPE
------------------------------ ----------- ------
DATA1 MOUNTED EXTERN
DATA2 MOUNTED EXTERN
[oracle@yitai ~]$ export ORACLE_SID=+ASM
[oracle@yitai ~]$ asmcmd
ASMCMD> lsdg
State Type Rebal Unbal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Name
MOUNTED EXTERN N N 512 4096 1048576 2038 763 0 763 0 DATA1/
MOUNTED EXTERN N N 512 4096 1048576 2038 929 0 929 0 DATA2/
二、遷移前檢視rdbms的資訊
檢視當前檔案系統的控制檔案路徑
SQL> select name from v$controlfile;
NAME
-------------------------------------------------------------------------------
/u01/app/oracle/oradata/prod/control01.ctl
/u01/app/oracle/oradata/prod/control02.ctl
/u01/app/oracle/oradata/prod/control03.ctl
檢視臨時檔案資訊
SQL>SQL> select file#, name from v$tempfile;
FILE#, NAME
-- --------------------------------------------------------------------------------
1 /u01/app/oracle/oradata/prod/temp01.dbf
檢視日誌檔案資訊:
SQL> SELECT a.group#, b.member, a.status FROM v$log a, v$logfile b WHERE a.group#=b.group#;
GROUP# MEMBER STATUS
---------- ------------------------------------------------------------ ----------------
1 /u01/app/oracle/oradata/prod/redo01.log CURRENT
2 /u01/app/oracle/oradata/prod/redo02.log INACTIVE
3 /u01/app/oracle/oradata/prod/redo03.log INACTIVE
檢視資料檔案位置:
SQL> select name from v$datafile;
NAME
----------------------------------------------------------------------------------
/u01/app/oracle/oradata/prod//system01.dbf
/u01/app/oracle/oradata/prod/undotbs01.dbf
/u01/app/oracle/oradata/prod/sysaux01.dbf
/u01/app/oracle/oradata/prod//users01.dbf
/u01/app/oracle/oradata/prod//example01.dbf
三、利用RMAN工具遷移
export ORACLE_SID=prod
SQL > shutdown immediate
SQL > startup nomount #rdbms操作控制檔案的時候,需要進入nomount狀態
[oracle@yitai ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Tue Aug 28 08:01:45 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: CUUG (DBID=1247937484)
轉移控制檔案
RMAN> restore controlfile to '+DATA2' from '/u01/app/oracle/oradata/prod/control01.ctl';
using channel ORA_DISK_1
Finished restore at 21-AUG-12
檢視新的控制檔案
ASMCMD> cd +DATA2
ASMCMD> ls
PROD/
DB_UNKNOWN/
ASMCMD> cd prod
ASMCMD> ls
CONTROLFILE/
ASMCMD> find -t controlfile . *
+DATA2/prod/CONTROLFILE/Backup.262.792483465
+DATA2/prod/CONTROLFILE/backup.256.792483231
修改當前系統的控制檔案引數相關
ORA-01507: database not mounted
datafile 2 switched to datafile +DATA2/prod/datafile/undotbs1.260.792483461
datafile 3 switched to datafile +DATA2/prod/datafile/sysaux.258.792483441
datafile 4switched to datafile +DATA2/prod/datafile/users.261.792483463
+DATA2/prod/datafile/example.259.792483457
引數檔案
RMAN> run {
backup as backupset spfile;
restore spfile to "+DATA2/spfileprod.ora";
}
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> SELECT a.group#, b.member, a.status FROM v$log a, v$logfile b WHERE a.group#=b.group#;
GROUP# MEMBER STATUS
---------- ------------------------------------------------------------ ----------------
1 /u01/app/oracle/oradata/prod/redo01.log CURRENT
2 /u01/app/oracle/oradata/prod/redo02.log INACTIVE
3 /u01/app/oracle/oradata/prod/redo03.log INACTIVE
SQL> ALTER DATABASE ADD LOGFILE MEMBER '+DATA2' TO GROUP 1;
---------- ------------------------------------------------------------ ----------------
1 /u01/app/oracle/oradata/prod/redo01.log CURRENT
2 /u01/app/oracle/oradata/prod/redo02.log INACTIVE
3 /u01/app/oracle/oradata/prod/redo03.log INACTIVE
2 +DATA2/prod/onlinelog/group_2.266.792483795 INACTIVE
3 +DATA2/prod/onlinelog/group_3.267.792483801 INACTIVE
SQL> ALTER DATABASE DROP LOGFILE MEMBER '/u01/app/oracle/oradata/prod/redo03.log';
SQL> ALTER DATABASE DROP LOGFILE MEMBER '/u01/app/oracle/oradata/prod/redo02.log';
GROUP# MEMBER STATUS
---------- ------------------------------------------------------------ ----------------
1 /u01/app/oracle/oradata/prod/redo01.log inactive 2 /u01/app/oracle/oradata/prod/redo02.log INACTIVE
3 /u01/app/oracle/oradata/prod/redo03.log INACTIVE
1 +DATA2/prodonlinelog/group_1.265.792483781 CURRENT
2 +DATA2/prod/onlinelog/group_2.266.792483795 INACTIVE
3 +DATA2/prod/onlinelog/group_3.267.792483801 INACTIVE
---------- ------------------------------------------------------------ ----------------
1 +DATA2/pord/onlinelog/group_1.265.792483781 CURRENT
2 +DATA2/prod/onlinelog/group_2.266.792483795 INACTIVE
3 +DATA2/prod/onlinelog/group_3.267.792483801 INACTIVE
SQL> select file#, name from v$tempfile;
---------- ------------------------------------------------------------
1 +DATA2/prod/tempfile/temp.264.792483707
------------------------------------------------------------
+DATA2/prod/datafile/system.257.792483427
+DATA2/prod/datafile/undotbs1.260.792483461
+DATA2/prod/datafile/sysaux.258.792483441
+DATA2/prod/datafile/users.261.792483463
+DATA2/prod/datafile/example.259.792483457
[oracle@yitai ~]$ asmcmd
ASMCMD> cd +DATA2
ASMCMD> ls
PROD/
ASMCMD> cd prod(# asmcmd不區分大小寫)
ASMCMD> ls
BACKUPSET/
CONTROLFILE/
DATAFILE/
ONLINELOG/
TEMPFILE/
spfilecuug.ora
------------------------------------ ----------- ------------------------------
spfile string +DATA2/prod/spfilecuug.ora
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
7369 SMITH CLERK 7902 17-DEC-80 800 20
7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
7566 JONES MANAGER 7839 02-APR-81 2975 20
7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
7782 CLARK MANAGER 7839 09-JUN-81 2450 10
7788 SCOTT ANALYST 7566 19-APR-87 3000 20
7839 KING PRESIDENT 17-NOV-81 5000 10
7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
7876 ADAMS CLERK 7788 23-MAY-87 1100 20
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27042095/viewspace-742041/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ASM檔案系統遷移ASM
- 如何遷移ASM資料檔案到檔案系統ASM
- 使用RMAN遷移檔案系統資料庫到ASM資料庫ASM
- 遷移檔案系統管理下的db到asm下ASM
- ASM下遷移控制檔案ASM
- 用rman從檔案系統遷移資料庫到asm資料庫ASM
- 從檔案系統遷移到ASM上ASM
- oralce 從檔案系統遷移到ASMASM
- 用RMAN遷移檔案到ASM或從ASM遷出ASM
- 四、用rman從檔案系統遷移資料庫到asm資料庫ASM
- 使用RAM將檔案系統遷移到ASMASM
- 利用RMAN在檔案系統與ASM之間遷移資料庫ASM資料庫
- 遷移資料庫檔案到ASM資料庫ASM
- 將spfile從ASM裡遷移到檔案系統ASM
- 資料庫從檔案系統遷移到ASM資料庫ASM
- 遷移和移動 UNIX 檔案系統(轉)
- 移動資料檔案從ASM到檔案系統ASM
- 把檔案系統的資料檔案遷移到ASM儲存ASM
- 將資料庫從ASM遷移到檔案系統資料庫ASM
- 將資料庫從檔案系統遷移到ASM資料庫ASM
- 【資料遷移】RMAN遷移資料庫到ASM(二)切換資料檔案到ASM資料庫ASM
- ASM與檔案系統之間copy資料檔案--檔案系統到ASMASM
- 移動資料檔案從檔案系統到ASM磁碟組中ASM
- Oracle 11g單例項ASM遷移到檔案系統Oracle單例ASM
- 利用RMAN將資料庫從檔案系統遷移到ASM資料庫ASM
- FastDFS檔案系統遷移和資料恢復AST資料恢復
- 利用rman遷移裸裝置資料檔案到檔案系統
- asm拷貝檔案到檔案系統ASM
- 實現資料庫由檔案系統遷移到 ASM 磁碟組中資料庫ASM
- 透過xtts遷移單例項檔案系統表空間到RAC ASM儲存表空間TTS單例ASM
- 通過xtts遷移單例項檔案系統表空間到RAC ASM儲存表空間TTS單例ASM
- oracle 將表空間下的資料檔案從檔案系統遷移到ASM磁碟組OracleASM
- 將ASM裡面的檔案copy到檔案系統ASM
- 遷移ASM磁碟組ASM
- ASM下遷移spfileASM
- 利用RMAN將資料庫從檔案系統遷移到ASM(單例項)資料庫ASM單例
- 資料檔案遷移
- ASM叢集檔案系統ACFS(ASM Cluster File System)ASM