... 修改保存后,重新启动实例
[oracle@bak ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 12 17:25:50 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated ORA-01262: Stat failed on a file destination directory Linux Error: 2: No such file or directory
由于刚才忘记创建了/oracle/flash_recovery_area这个目录,因此报错,如果测试机并不想启用FRA的话,可以把该参数注释掉
SQL> ! [oracle@bak ~]$ vim /u01/app/oracle/product/10.2.0/db_1/dbs/initora10g.ora
... #*.db_recovery_file_dest='/oracle/flash_recovery_area' #*.db_recovery_file_dest_size=2147483648 ...
[oracle@bak ~]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Sun Oct 12 17:28:08 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount ORACLE instance started.
Total System Global Area 1073741824 bytes Fixed Size 1223512 bytes Variable Size 264242344 bytes Database Buffers 805306368 bytes Redo Buffers 2969600 bytes SQL>
注意,如果登陆SQLPLUS时碰到无法用OS Local验证,只需用netca创建一个监听即可解决
Recovery Manager: Release 10.2.0.1.0 - Production on Sun Oct 12 17:42:07 2014
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database: ora10g (not mounted)
RMAN> restore controlfile from '/tmp/ora10g-c-4175411955-20141012-00.ctl';
Starting restore at 12-OCT-14 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=156 devtype=DISK
channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:05 output filename=/oradata/ora10g/control01.ctl output filename=/oradata/ora10g/control02.ctl output filename=/oradata/ora10g/control03.ctl Finished restore at 12-OCT-14
RMAN> alter database mount;
database mounted released channel: ORA_DISK_1
7. 恢复测试机数据库文件 RMAN> restore database;
Starting restore at 12-OCT-14 allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid=156 devtype=DISK
RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of restore command at 10/12/2014 17:43:29 ORA-01220: file based sort illegal before database is open
RMAN> host! [oracle@bak ~]$ oerr ora 01220 01220, 00000, "file based sort illegal before database is open" // *Cause: A query issued against a fixed table or view required a temporary // segment for sorting before the database was open. Only in-memory // sorts are supported before the database is open. // *Action: Re-phrase the query to avoid a large sort, increase the values // of the SORT_AREA_SIZE and/or SORT_AREA_RETAINED_SIZE // initialization parameters to enable the sort to be done in memory.
SQL> show parameter sort_
NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ sort_area_retained_size integer 0 sort_area_size integer 65536
查看源库也是这个配置,感觉提示中增加SORT_AREA_SIZE and/or SORT_AREA_RETAINED_SIZE是误导,怀疑是pga_aggregate_target设置为0引起的,有点不解的是,为什么RMAN做restore database还需要用到排序区
[oracl