noarchivelog下,open时执行backup database会直接
ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
所以,要rman,就必须得mount,要留意的是停的时候不要abort停下来,比如用startup noforce是不行的。另外,shutdown 之前,最好执行一下 alter system checkpoint,将脏块内容(写到了redo log里面但是没写到datafile里)都写回到datafile,否则就算正常shutdown,执行时仍然会报ORA-19602。虽然说shutdown照理应该也会自动发出checkpoint,但是我的确遇到这样的问题。
run {
allocate channel oem_disk_backup device type disk;
recover copy of database with tag 'ORA_OEM_LEVEL_0';
backup incremental level 1 cumulative copies=1 for recover of copy with tag 'ORA_OEM_LEVEL_0' database;
}
第一句是recover一下,如果没有对应的tag,啥也不干。
第二句直接下指示备份 level1的累积增量,没有level0时,rman会自动copy datafile来当做level0备份。
执行模拟
第一天, recovery啥也不干,backup 了full 的level0,是img copy。
第二天,recovery啥也不干(因为还没有增量),backup了增量,增量自然是bacupset。
第三天,recovery将第二天的增量反应进level0的dbf,backup了增量
这样下来,每天都得到了差一个增量的dbf。
这样rman备份的东西,就可以用rman恢复了
startup force nomount
如果没使用catalog管理,需要set dbid 972690783
restore controlfile from autobackup;
alter database mount;
restore database;
redolog丢失或者增量备份不能反映进redolog时,recover database noredo;
alter database open resetlogs;
我这样做了,也恢复了数据库,但是em却完蛋了
Service is not initialized correctly. The Em Key is not configured properly. Run "emctl status emkey" for more details
因为我测试时,是先backup,后再create的em的repos。
测试了
[oracle@NKV2DEVDB_O config]$ emctl status emkey -sysman_pwd oracle
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
The Em Key is not configured properly or is corrupted in the file system and does not exist in the Management Repository. To correct the problem:
1) Copy the emkey.ora file from another OMS or backup machine to the OH/sysman/config directory.
2) Configure the emkey.ora file by running "emctl config emkey -emkeyfile <emkey.ora file location>".
[oracle@NKV2DEVDB_O config]$ emctl config emkey -emkeyfile /ORADATA/app/product/11.2.0/dbhome_1/192.168.101.40_orcl11g/sysman/config/emkey.ora -force -sysman_pwd oracle
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
The Em Key could not be configured. /ORADATA/app/product/11.2.0/dbhome_1/192.168.101.40_orcl11g/sysman/config/emkey.ora is corrupted or contains an invalid Em Key.
[oracle@NKV2DEVDB_O config]$ emctl config emkey -repos -sysman_pwd oracle -emkeyfile /ORADATA/app/product/11.2.0/dbhome_1/192.168.101.40_orcl11g/sysman/config/emkey.ora
Oracle Enterprise Manager 11g Database Control Release 11.2.0.1.0
Copyright (c) 1996, 2009 Oracle Corporation. All rights reserved.
The Em Key could not be configured. The Em Key was not found in Management Repository.
都不灵,没法子,重新来过
emca -deconfig dbcontrol db -repos drop
emca -config dbcontrol db -repos create
没有评论:
发表评论