--asm存储,删除一个数据文件
[oracle@rac1 oracle]$ sqlplus / as sysdba
[oracle@rac1 oracle]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Apr 15 13:19:32 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ASM instance started
ASM instance started
Total System Global Area 92274688 bytes
Fixed Size 1217884 bytes
Variable Size 65890980 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@rac1 oracle]$ asmcmd
ASMCMD>
ASMCMD>
ASMCMD> ls
ASM_DISK01/
ASMCMD> cd ASM_DISK01/
ASMCMD> ls
ORADB/
ASMCMD> cd ORADB/
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileoradb.ora
ASMCMD> cd DATAFILE/
ASMCMD> ls
SYSAUX.257.812806269
SYSTEM.256.812806267
UNDOTBS1.258.812806269
UNDOTBS2.264.812806467
USERS.259.812810471
ASMCMD> rm USERS.259.812810471
ASMCMD>
ASMCMD>
ASMCMD>
ASMCMD> exit
[oracle@rac1 oracle]$
Fixed Size 1217884 bytes
Variable Size 65890980 bytes
ASM Cache 25165824 bytes
ASM diskgroups mounted
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
[oracle@rac1 oracle]$ asmcmd
ASMCMD>
ASMCMD>
ASMCMD> ls
ASM_DISK01/
ASMCMD> cd ASM_DISK01/
ASMCMD> ls
ORADB/
ASMCMD> cd ORADB/
ASMCMD> ls
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
TEMPFILE/
spfileoradb.ora
ASMCMD> cd DATAFILE/
ASMCMD> ls
SYSAUX.257.812806269
SYSTEM.256.812806267
UNDOTBS1.258.812806269
UNDOTBS2.264.812806467
USERS.259.812810471
ASMCMD> rm USERS.259.812810471
ASMCMD>
ASMCMD>
ASMCMD>
ASMCMD> exit
[oracle@rac1 oracle]$
--恢复此数据文件,首先启动rac到mount状态
[oracle@rac1 dbs]$ crs_start -all
Attempting to start `ora.rac2.vip` on member `rac2`
Start of `ora.rac2.vip` on member `rac2` succeeded.
Attempting to start `ora.rac2.ASM2.asm` on member `rac2`
Start of `ora.rac2.ASM2.asm` on member `rac2` succeeded.
Attempting to start `ora.oradb.oradb2.inst` on member `rac2`
Start of `ora.oradb.oradb2.inst` on member `rac2` failed.
rac1 : CRS-1018: Resource ora.rac2.vip (application) is already running on rac2
rac1 : CRS-1018: Resource ora.rac2.vip (application) is already running on rac2
Attempting to start `ora.rac1.gsd` on member `rac1`
CRS-1002: Resource 'ora.rac2.ons' is already running on member 'rac2'
Attempting to start `ora.oradb.oradb1.inst` on member `rac1`
Attempting to start `ora.rac2.gsd` on member `rac2`
Attempting to start `ora.oradb.db` on member `rac1`
Start of `ora.rac2.gsd` on member `rac2` succeeded.
Start of `ora.rac1.gsd` on member `rac1` succeeded.
Start of `ora.oradb.oradb1.inst` on member `rac1` failed.
rac2 : CRS-1018: Resource ora.rac1.vip (application) is already running on rac1
Attempting to start `ora.rac2.gsd` on member `rac2`
Attempting to start `ora.oradb.db` on member `rac1`
Start of `ora.rac2.gsd` on member `rac2` succeeded.
Start of `ora.rac1.gsd` on member `rac1` succeeded.
Start of `ora.oradb.oradb1.inst` on member `rac1` failed.
rac2 : CRS-1018: Resource ora.rac1.vip (application) is already running on rac1
rac2 : CRS-1018: Resource ora.rac1.vip (application) is already running on rac1
Start of `ora.oradb.db` on member `rac1` failed.
Attempting to start `ora.oradb.db` on member `rac2`
Start of `ora.oradb.db` on member `rac2` failed.
CRS-1006: No more members to consider
CRS-0215: Could not start resource 'ora.oradb.db'.
CRS-0215: Could not start resource 'ora.oradb.oradb1.inst'.
CRS-0215: Could not start resource 'ora.oradb.oradb2.inst'.
CRS-0223: Resource 'ora.rac1.LISTENER_RAC1.lsnr' has placement error.
CRS-0223: Resource 'ora.rac2.LISTENER_RAC2.lsnr' has placement error.
CRS-0223: Resource 'ora.rac2.ons' has placement error.
[oracle@rac1 dbs]$ crs_start -all
[oracle@rac1 backup]$ srvctl start instance -d oradb -i oradb1,oradb2 -o mount
[oracle@rac1 dbs]$ crs_start -all
[oracle@rac1 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.oradb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
[oracle@rac1 dbs]$
[oracle@rac1 backup]$ srvctl start instance -d oradb -i oradb1,oradb2 -o mount
[oracle@rac1 dbs]$ crs_start -all
[oracle@rac1 dbs]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.oradb.db application ONLINE ONLINE rac2
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
[oracle@rac1 dbs]$
--rac节点1取节点2的数据文件,此处归档路径必须与参数log_archive_dest_1相同,此操作都是在节点1上进行
[oracle@rac1 oradb2]$ pwd
/home/oracle/backup/arch/oradb2
[oracle@rac1 oradb2]$
[oracle@rac1 oradb2]$ sftp 139.0.0.12
Connecting to 139.0.0.12...
sftp> ls
.
..
.ICEauthority
.Trash
.Xauthority
.bash_history
.bash_logout
.bash_profile
.bashrc
.esd_auth
.fonts.cache-1
.gconf
.gconfd
.gftp
.gnome
.gnome-desktop
.gnome2
.gnome2_private
.gtkrc
.gtkrc-1.2-gnome2
.icons
.kde
.metacity
.mozilla
.nautilus
.recently-used
.rhn-applet.conf
.ssh
.vnc
.xsession-errors
.zshrc
app
backup
default.png
lost+found
sftp> cd backup/arch
sftp> ls
.
..
oradb2
sftp> cd oradb2
sftp> ls
.
..
2_1_812806367.dbf
2_2_812806367.dbf
2_3_812806367.dbf
2_4_812806367.dbf
2_5_812806367.dbf
2_6_812806367.dbf
sftp> get *.dbf
Fetching /home/oracle/backup/arch/oradb2/2_1_812806367.dbf to 2_1_812806367.dbf
2_1_812806367.dbf 100% 745KB 7.3MB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_2_812806367.dbf to 2_2_812806367.dbf
2_2_812806367.dbf 100% 2048 1.5MB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_3_812806367.dbf to 2_3_812806367.dbf
2_3_812806367.dbf 100% 1024 867.3KB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_4_812806367.dbf to 2_4_812806367.dbf
2_4_812806367.dbf 100% 1024 842.4KB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_5_812806367.dbf to 2_5_812806367.dbf
2_5_812806367.dbf 100% 1024 898.4KB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_6_812806367.dbf to 2_6_812806367.dbf
2_6_812806367.dbf 100% 1024 946.9KB/s 00:00
sftp>
sftp> exit
[oracle@rac1 oradb2]$
[oracle@rac1 oradb2]$ pwd
/home/oracle/backup/arch/oradb2
[oracle@rac1 oradb2]$
[oracle@rac1 oradb2]$ sftp 139.0.0.12
Connecting to 139.0.0.12...
sftp> ls
.
..
.ICEauthority
.Trash
.Xauthority
.bash_history
.bash_logout
.bash_profile
.bashrc
.esd_auth
.fonts.cache-1
.gconf
.gconfd
.gftp
.gnome
.gnome-desktop
.gnome2
.gnome2_private
.gtkrc
.gtkrc-1.2-gnome2
.icons
.kde
.metacity
.mozilla
.nautilus
.recently-used
.rhn-applet.conf
.ssh
.vnc
.xsession-errors
.zshrc
app
backup
default.png
lost+found
sftp> cd backup/arch
sftp> ls
.
..
oradb2
sftp> cd oradb2
sftp> ls
.
..
2_1_812806367.dbf
2_2_812806367.dbf
2_3_812806367.dbf
2_4_812806367.dbf
2_5_812806367.dbf
2_6_812806367.dbf
sftp> get *.dbf
Fetching /home/oracle/backup/arch/oradb2/2_1_812806367.dbf to 2_1_812806367.dbf
2_1_812806367.dbf 100% 745KB 7.3MB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_2_812806367.dbf to 2_2_812806367.dbf
2_2_812806367.dbf 100% 2048 1.5MB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_3_812806367.dbf to 2_3_812806367.dbf
2_3_812806367.dbf 100% 1024 867.3KB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_4_812806367.dbf to 2_4_812806367.dbf
2_4_812806367.dbf 100% 1024 842.4KB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_5_812806367.dbf to 2_5_812806367.dbf
2_5_812806367.dbf 100% 1024 898.4KB/s 00:00
Fetching /home/oracle/backup/arch/oradb2/2_6_812806367.dbf to 2_6_812806367.dbf
2_6_812806367.dbf 100% 1024 946.9KB/s 00:00
sftp>
sftp> exit
[oracle@rac1 oradb2]$
--rman恢复
[oracle@rac1 oracle]$ rman target /
[oracle@rac1 oracle]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Mon Apr 15 13:29:26 2013
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ORADB (DBID=2566071129, not open)
RMAN> restore datafile 4;
Starting restore at 15-APR-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 instance=oradb1 devtype=DISK
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=143 instance=oradb1 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to +ASM_DISK01/oradb/datafile/users.259.812810471
channel ORA_DISK_1: reading from backup piece /home/oracle/app/oracle/product/10.2.0/db_1/dbs/03o74ug1_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/app/oracle/product/10.2.0/db_1/dbs/03o74ug1_1_1 tag=TAG20130415T121145
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
Finished restore at 15-APR-13
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00004 to +ASM_DISK01/oradb/datafile/users.259.812810471
channel ORA_DISK_1: reading from backup piece /home/oracle/app/oracle/product/10.2.0/db_1/dbs/03o74ug1_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/home/oracle/app/oracle/product/10.2.0/db_1/dbs/03o74ug1_1_1 tag=TAG20130415T121145
channel ORA_DISK_1: restore complete, elapsed time: 00:00:04
Finished restore at 15-APR-13
RMAN> recover datafile 4;
Starting recover at 15-APR-13
using channel ORA_DISK_1
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 2 is already on disk as file /home/oracle/backup/arch/oradb11_2_812806367.dbf
archive log thread 1 sequence 3 is already on disk as file /home/oracle/backup/arch/oradb11_3_812806367.dbf
archive log thread 1 sequence 4 is already on disk as file /home/oracle/backup/arch/oradb11_4_812806367.dbf
archive log thread 1 sequence 5 is already on disk as file /home/oracle/backup/arch/oradb11_5_812806367.dbf
archive log thread 1 sequence 6 is already on disk as file /home/oracle/backup/arch/oradb11_6_812806367.dbf
archive log thread 1 sequence 7 is already on disk as file /home/oracle/backup/arch/oradb11_7_812806367.dbf
archive log thread 1 sequence 8 is already on disk as file /home/oracle/backup/arch/oradb11_8_812806367.dbf
archive log thread 1 sequence 9 is already on disk as file /home/oracle/backup/arch/oradb11_9_812806367.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/15/2013 13:30:16
RMAN-06053: unable to perform. media recovery because of missing log
RMAN-06025: no backup of log thread 2 seq 6 lowscn 461540 found to restore
RMAN-06025: no backup of log thread 2 seq 5 lowscn 461529 found to restore
RMAN-06025: no backup of log thread 2 seq 4 lowscn 461525 found to restore
RMAN-06025: no backup of log thread 2 seq 3 lowscn 461521 found to restore
RMAN-06025: no backup of log thread 2 seq 2 lowscn 461504 found to restore
RMAN-06025: no backup of log thread 2 seq 1 lowscn 455559 found to restore
archive log thread 1 sequence 3 is already on disk as file /home/oracle/backup/arch/oradb11_3_812806367.dbf
archive log thread 1 sequence 4 is already on disk as file /home/oracle/backup/arch/oradb11_4_812806367.dbf
archive log thread 1 sequence 5 is already on disk as file /home/oracle/backup/arch/oradb11_5_812806367.dbf
archive log thread 1 sequence 6 is already on disk as file /home/oracle/backup/arch/oradb11_6_812806367.dbf
archive log thread 1 sequence 7 is already on disk as file /home/oracle/backup/arch/oradb11_7_812806367.dbf
archive log thread 1 sequence 8 is already on disk as file /home/oracle/backup/arch/oradb11_8_812806367.dbf
archive log thread 1 sequence 9 is already on disk as file /home/oracle/backup/arch/oradb11_9_812806367.dbf
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 04/15/2013 13:30:16
RMAN-06053: unable to perform. media recovery because of missing log
RMAN-06025: no backup of log thread 2 seq 6 lowscn 461540 found to restore
RMAN-06025: no backup of log thread 2 seq 5 lowscn 461529 found to restore
RMAN-06025: no backup of log thread 2 seq 4 lowscn 461525 found to restore
RMAN-06025: no backup of log thread 2 seq 3 lowscn 461521 found to restore
RMAN-06025: no backup of log thread 2 seq 2 lowscn 461504 found to restore
RMAN-06025: no backup of log thread 2 seq 1 lowscn 455559 found to restore
RMAN> recover datafile 4;
Starting recover at 15-APR-13
using channel ORA_DISK_1
using channel ORA_DISK_1
starting media recovery
archive log thread 1 sequence 2 is already on disk as file /home/oracle/backup/arch/oradb11_2_812806367.dbf
archive log thread 1 sequence 3 is already on disk as file /home/oracle/backup/arch/oradb11_3_812806367.dbf
archive log thread 1 sequence 4 is already on disk as file /home/oracle/backup/arch/oradb11_4_812806367.dbf
archive log thread 1 sequence 5 is already on disk as file /home/oracle/backup/arch/oradb11_5_812806367.dbf
archive log thread 1 sequence 6 is already on disk as file /home/oracle/backup/arch/oradb11_6_812806367.dbf
archive log thread 1 sequence 7 is already on disk as file /home/oracle/backup/arch/oradb11_7_812806367.dbf
archive log thread 1 sequence 8 is already on disk as file /home/oracle/backup/arch/oradb11_8_812806367.dbf
archive log thread 1 sequence 9 is already on disk as file /home/oracle/backup/arch/oradb11_9_812806367.dbf
archive log thread 2 sequence 1 is already on disk as file /home/oracle/backup/arch/oradb2/2_1_812806367.dbf
archive log thread 2 sequence 2 is already on disk as file /home/oracle/backup/arch/oradb2/2_2_812806367.dbf
archive log thread 2 sequence 3 is already on disk as file /home/oracle/backup/arch/oradb2/2_3_812806367.dbf
archive log thread 2 sequence 4 is already on disk as file /home/oracle/backup/arch/oradb2/2_4_812806367.dbf
archive log thread 2 sequence 5 is already on disk as file /home/oracle/backup/arch/oradb2/2_5_812806367.dbf
archive log thread 2 sequence 6 is already on disk as file /home/oracle/backup/arch/oradb2/2_6_812806367.dbf
archive log filename=/home/oracle/backup/arch/oradb11_2_812806367.dbf thread=1 sequence=2
archive log filename=/home/oracle/backup/arch/oradb2/2_1_812806367.dbf thread=2 sequence=1
archive log filename=/home/oracle/backup/arch/oradb11_3_812806367.dbf thread=1 sequence=3
archive log filename=/home/oracle/backup/arch/oradb11_4_812806367.dbf thread=1 sequence=4
archive log filename=/home/oracle/backup/arch/oradb11_5_812806367.dbf thread=1 sequence=5
archive log filename=/home/oracle/backup/arch/oradb2/2_2_812806367.dbf thread=2 sequence=2
archive log filename=/home/oracle/backup/arch/oradb11_6_812806367.dbf thread=1 sequence=6
archive log filename=/home/oracle/backup/arch/oradb11_7_812806367.dbf thread=1 sequence=7
archive log filename=/home/oracle/backup/arch/oradb11_8_812806367.dbf thread=1 sequence=8
archive log filename=/home/oracle/backup/arch/oradb2/2_3_812806367.dbf thread=2 sequence=3
archive log filename=/home/oracle/backup/arch/oradb2/2_4_812806367.dbf thread=2 sequence=4
archive log filename=/home/oracle/backup/arch/oradb2/2_5_812806367.dbf thread=2 sequence=5
media recovery complete, elapsed time: 00:00:02
Finished recover at 15-APR-13
archive log thread 1 sequence 3 is already on disk as file /home/oracle/backup/arch/oradb11_3_812806367.dbf
archive log thread 1 sequence 4 is already on disk as file /home/oracle/backup/arch/oradb11_4_812806367.dbf
archive log thread 1 sequence 5 is already on disk as file /home/oracle/backup/arch/oradb11_5_812806367.dbf
archive log thread 1 sequence 6 is already on disk as file /home/oracle/backup/arch/oradb11_6_812806367.dbf
archive log thread 1 sequence 7 is already on disk as file /home/oracle/backup/arch/oradb11_7_812806367.dbf
archive log thread 1 sequence 8 is already on disk as file /home/oracle/backup/arch/oradb11_8_812806367.dbf
archive log thread 1 sequence 9 is already on disk as file /home/oracle/backup/arch/oradb11_9_812806367.dbf
archive log thread 2 sequence 1 is already on disk as file /home/oracle/backup/arch/oradb2/2_1_812806367.dbf
archive log thread 2 sequence 2 is already on disk as file /home/oracle/backup/arch/oradb2/2_2_812806367.dbf
archive log thread 2 sequence 3 is already on disk as file /home/oracle/backup/arch/oradb2/2_3_812806367.dbf
archive log thread 2 sequence 4 is already on disk as file /home/oracle/backup/arch/oradb2/2_4_812806367.dbf
archive log thread 2 sequence 5 is already on disk as file /home/oracle/backup/arch/oradb2/2_5_812806367.dbf
archive log thread 2 sequence 6 is already on disk as file /home/oracle/backup/arch/oradb2/2_6_812806367.dbf
archive log filename=/home/oracle/backup/arch/oradb11_2_812806367.dbf thread=1 sequence=2
archive log filename=/home/oracle/backup/arch/oradb2/2_1_812806367.dbf thread=2 sequence=1
archive log filename=/home/oracle/backup/arch/oradb11_3_812806367.dbf thread=1 sequence=3
archive log filename=/home/oracle/backup/arch/oradb11_4_812806367.dbf thread=1 sequence=4
archive log filename=/home/oracle/backup/arch/oradb11_5_812806367.dbf thread=1 sequence=5
archive log filename=/home/oracle/backup/arch/oradb2/2_2_812806367.dbf thread=2 sequence=2
archive log filename=/home/oracle/backup/arch/oradb11_6_812806367.dbf thread=1 sequence=6
archive log filename=/home/oracle/backup/arch/oradb11_7_812806367.dbf thread=1 sequence=7
archive log filename=/home/oracle/backup/arch/oradb11_8_812806367.dbf thread=1 sequence=8
archive log filename=/home/oracle/backup/arch/oradb2/2_3_812806367.dbf thread=2 sequence=3
archive log filename=/home/oracle/backup/arch/oradb2/2_4_812806367.dbf thread=2 sequence=4
archive log filename=/home/oracle/backup/arch/oradb2/2_5_812806367.dbf thread=2 sequence=5
media recovery complete, elapsed time: 00:00:02
Finished recover at 15-APR-13
RMAN>
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/23382569/viewspace-761079/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/23382569/viewspace-761079/