一
[oracle@ASM ~]$ echo $ORACLE_SID
+ASM
[oracle@ASM ~]$ sqlplus /nolog
SQL*Plus: Release
Copyright (c)
SQL> conn / as sysdba
Connected to an idle instance
SQL> startup
ASM instance started
Total System Global Area
Fixed Size
Variable Size
ASM Cache
ASM diskgroups mounted
SQL> select name
NAME STATE
DATA MOUNTED
DGROUP
二
SQL> ALTER SYSTEM SET CONTROL_FILES=
System altered
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST=
System altered
三
SQL> SHUTDOWN IMMEDIATE
Database closed
Database dismounted
ORACLE instance shut down
四
[oracle@ASM admin]$ rman target /
Recovery Manager: Release
Copyright (c)
connected to target database (not started)
RMAN> startup nomount
Oracle instance started
Total System Global Area
Fixed Size
Variable Size
Database Buffers
Redo Buffers
RMAN>
五
RMAN> RESTORE CONTROLFILE FROM
Starting restore at
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_
channel ORA_DISK_
channel ORA_DISK_
output filename=+DGROUP
Finished restore at
RMAN> ALTER DATABASE MOUNT;
database mounted
released channel: ORA_DISK_
RMAN>
六
RMAN > BACKUP AS COPY DATABASE FORMAT
Starting backup at
allocated channel: ORA_DISK_
channel ORA_DISK_
channel ORA_DISK_
input datafile fno=
output filename=+DGROUP
channel ORA_DISK_
channel ORA_DISK_
input datafile fno=
output filename=+DGROUP
channel ORA_DISK_
channel ORA_DISK_
input datafile fno=
output filename=+DGROUP
channel ORA_DISK_
channel ORA_DISK_
input datafile fno=
output filename=+DGROUP
channel ORA_DISK_
channel ORA_DISK_
input datafile fno=
output filename=+DGROUP
channel ORA_DISK_
channel ORA_DISK_
copying current control file
output filename=+DGROUP
channel ORA_DISK_
channel ORA_DISK_
channel ORA_DISK_
including current SPFILE in backupset
channel ORA_DISK_
channel ORA_DISK_
piece handle=+DGROUP
channel ORA_DISK_
Finished backup at
RMAN>
七
RMAN> SWITCH DATABASE TO COPY;
datafile
datafile
datafile
datafile
datafile
RMAN> RECOVER DATABASE;
Starting recover at
using channel ORA_DISK_
starting media recovery
media recovery complete
Finished recover at
RMAN>
八
RMAN> ALTER DATABASE OPEN;
database opened
RMAN>
九
由於臨時文件不會被遷移
SQL> SELECT NAME FROM V$TEMPFILE;
NAME
/u
SQL> ALTER TABLESPACE TEMP ADD TEMPFILE
Tablespace altered
SQL> ALTER TABLESPACE TEMP DROP TEMPFILE
Tablespace altered
SQL> SELECT NAME FROM V$TEMPFILE;
NAME
+DGROUP
SQL>
十
SQL> SELECT * FROM V$LOG;
GROUP# THREAD# SEQUENCE# BYTES MEMBERS ARC STATUS FIRST_CHANGE# FIRST_TIM
SQL> ALTER DATABASE ADD LOGFILE
Database altered
SQL> ALTER DATABASE ADD LOGFILE
Database altered
SQL> ALTER DATABASE ADD LOGFILE
Database altered
SQL> ALTER DATABASE DROP LOGFILE GROUP
Database altered
SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered
SQL> ALTER SYSTEM SWITCH LOGFILE;
System altered
SQL> SQL> ALTER DATABASE DROP LOGFILE GROUP
ALTER DATABASE DROP LOGFILE GROUP
*
ERROR at line
ORA
ORA
SQL> ALTER SYSTEM CHECKPOINT;
System altered
SQL> ALTER DATABASE DROP LOGFILE GROUP
Database altered
SQL>ALTER DATABASE DROP LOGFILE GROUP
Database altered
SQL> SELECT MEMBER FROM V$LOGFILE;
MEMBER
+DGROUP
+DGROUP
+DGROUP
SQL>
十一
[oracle@ASM ~]$ ls
total
[oracle@ASM ~]$ rm
[oracle@ASM ~]$ ls
total
[oracle@ASM ~]$
遷移完畢!
From:http://tw.wingwit.com/Article/program/Oracle/201311/17127.html