如何複製控制檔案在ASM例項儲存

楊奇龍發表於2010-05-16

本文介紹如何在ASM例項的環境下,去複製2個控制檔案的過程。

如果在檔案系統,相對比較簡單了。


##Make sure db is in the archived mode

SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +ARCH_01/t/
Oldest online log sequence 24
Next log sequence to archive 25
Current log sequence 25

##Make sure all of online redo is done backup
alter system switch logfile;
...

## If you are using spfile parameter file ,please convert it to pfile first

create pfile='/u01/app/oracle/initt.ora' from spfile='+ARCH_01/t/spfilet.ora';

## Backup controlfile in mount stage
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup mount
ORACLE instance started.
Total System Global Area 1191182336 bytes
Fixed Size 2072288 bytes
Variable Size 318767392 bytes
Database Buffers 855638016 bytes
Redo Buffers 14704640 bytes
Database mounted.


alter database backup controlfile to '/u01/app/oracle/test_ctl.ctl';

##Edit the parameter: controlfile in the pfile
SQL> show parameter control
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time integer 7
control_files string +DATA_01/t/controlfile/current
.285.640542545, +DATA_01/t/con
trolfile/current.286.640542545
## Duplicate controlfile from file system to ASM instance
SQL> startup nomount pfile=/u01/app/oracle/initt1.ora
ORACLE instance started.

Total System Global Area 1191182336 bytes
Fixed Size 2072288 bytes
Variable Size 318767392 bytes
Database Buffers 855638016 bytes
Redo Buffers 14704640 bytes

$ ./rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Fri Dec 7 11:54:15 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: t (not mounted)

RMAN> restore controlfile from '/u01/app/oracle/test_ctl.ctl';

Starting restore at 12/07/2007 11:54:33
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=153 devtype=DISK

channel ORA_DISK_1: copied control file copy
output filename=+DATA_01/t/controlfile/test_ctl01
output filename=+DATA_01/t/controlfile/test_ctl02
Finished restore at 12/07/2007 11:54:41


SQL> startup nomount pfile=/u01/app/oracle/initt1.ora

alter database open resetlogs;

 轉載自:http://jack2k.itpub.net/post/9350/427659

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-662823/,如需轉載,請註明出處,否則將追究法律責任。

相關文章