RMAN異機恢複步驟及故障處理
一、測試機安裝OS+Oracle Software,包括配置oracle使用者、組和環境變數(略) 二、開始異機恢複 1. 複製源庫最新備份組、初始化參數、密碼檔案到測試機[oracle@ora10g backupsets]$ scp *20141012* 192.168.1.213:/tmpThe authenticity of host '192.168.1.213 (192.168.1.213)' can't be established.RSA key fingerprint is 78:0e:33:cb:3f:04:e4:5d:d1:71:29:a4:3f:3a:79:41.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added '192.168.1.213' (RSA) to the list of known hosts.oracle@192.168.1.213's password: Connection closed by 192.168.1.213lost connection[oracle@ora10g backupsets]$ scp *20141012* 192.168.1.213:/tmporacle@192.168.1.213's password: ora10g-4175411955_20141012_860776699_315.arc 100% 4336KB 2.1MB/s 00:02 ora10g-4175411955_20141012_860776704_316.db 100% 165MB 2.1MB/s 01:20 ora10g-4175411955_20141012_860776830_317.arc 100% 418KB 417.5KB/s 00:00 ora10g-c-4175411955-20141012-00.ctl 100% 7424KB 2.4MB/s 00:03 [oracle@ora10g backupsets]$ scp $ORACLE_HOME/dbs/initora10g.ora oracle@192.168.1.213:/tmporacle@192.168.1.213's password: initora10g.ora 100% 1136 1.1KB/s 00:00 [oracle@ora10g backupsets]$ scp $ORACLE_HOME/dbs/orapwora10g oracle@192.168.1.213:/tmporacle@192.168.1.213's password: orapwora10g 100% 1536 1.5KB/s 00:00 如果沒有產生過initora10g.ora初始化參數檔案,則建立一個:SQL> create pfile from spfile;建立完預設路徑是放在$ORACLE_HOME/dbs下面 2. 修改初始化參數[root@bak tmp]# cat initora10g.ora ora10g.__db_cache_size=0ora10g.__java_pool_size=0ora10g.__large_pool_size=0ora10g.__shared_pool_size=0ora10g.__streams_pool_size=0*.audit_file_dest='/oracle/admin/ora10g/adump'*.background_dump_dest='/oracle/admin/ora10g/bdump'*.compatible='10.2.0.1.0'*.control_files='/oradata/ora10g/control01.ctl','/oradata/ora10g/control02.ctl','/oradata/ora10g/control03.ctl'#Restore Controlfile*.core_dump_dest='/oracle/admin/ora10g/cdump'*.db_block_size=8192*.db_domain=''*.db_file_multiblock_read_count=16*.db_name='ora10g'*.db_recovery_file_dest='/oracle/flash_recovery_area'*.db_recovery_file_dest_size=2147483648*.dispatchers='(PROTOCOL=TCP) (SERVICE=ora10gXDB)'*.job_queue_processes=10*.log_archive_format='%t_%s_%r.dbf'*.nls_language='SIMPLIFIED CHINESE'*.nls_territory='CHINA'*.open_cursors=300*.pga_aggregate_target=0*.processes=150*.remote_login_passwordfile='EXCLUSIVE'*.sga_target=0*.undo_management='AUTO'*.undo_tablespace='UNDOTBS1'*.user_dump_dest='/oracle/admin/ora10g/udump' 注意,假設我這裡測試機使用的目錄和源庫不同,注意紅色部分為修改的內容 3. 把密碼檔案和修改好的初始化參數檔案拷貝到測試機相應位置[oracle@bak ~]$ mv /tmp/initora10g.ora $ORACLE_HOME/dbs[oracle@bak ~]$ mv /tmp/orapwora10g $ORACLE_HOME/dbs
--------------------------------------推薦閱讀 --------------------------------------
RMAN 配置歸檔日誌刪除策略
Oracle基礎教程之通過RMAN複製資料庫
RMAN備份策略制定參考內容
RMAN備份學習筆記
OracleDatabase Backup加密 RMAN加密
--------------------------------------分割線 --------------------------------------
4. 在測試機根據初始化參數檔案中指定的路徑建立目錄(注意目錄必須對於oracle使用者有讀寫權限)[root@bak tmp]# mkdir /oradata/ora10g -p[root@bak tmp]# mkdir /oracle/admin/ora10g/adump -p[root@bak tmp]# mkdir /oracle/admin/ora10g/bdump[root@bak tmp]# mkdir /oracle/admin/ora10g/cdump[root@bak tmp]# mkdir /oracle/admin/ora10g/udump[root@bak tmp]# chown oracle:oinstall /oradata -R[root@bak tmp]# chmod 755 /oradata -R[root@bak tmp]# chown oracle:oinstall /oracle -R[root@bak tmp]# chmod 755 /oracle -R 5. 啟動執行個體到nomountSQL> startup nomountORA-00371: not enough shared pool memory, should be atleast 72265318 bytes 由於假設測試機配置要比源庫低,而暫時不確定如何分配SGA,剛才在初始化參數中把記憶體配置的值,都設定成了0,包括sga_target,既然沒有自動分配記憶體組件,那麼手動設定sga_target=1G SQL> ![oracle@bak ~]$ vim /u01/app/oracle/product/10.2.0/db_1/dbs/initora10g.ora ...*.sga_target=1G
...修改儲存後,重新啟動執行個體 [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 nomountORA-01261: Parameter db_recovery_file_dest destination string cannot be translatedORA-01262: Stat failed on a file destination directoryLinux 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 nomountORACLE instance started. Total System Global Area 1073741824 bytesFixed Size 1223512 bytesVariable Size 264242344 bytesDatabase Buffers 805306368 bytesRedo Buffers 2969600 bytesSQL> 注意,如果登陸SQLPLUS時碰到無法用OS Local驗證,只需用netca建立一個監聽即可解決 6. 恢複測試機控制檔案[oracle@bak ~]$ rman target / 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-14using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=156 devtype=DISK channel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:05output filename=/oradata/ora10g/control01.ctloutput filename=/oradata/ora10g/control02.ctloutput filename=/oradata/ora10g/control03.ctlFinished restore at 12-OCT-14 RMAN> alter database mount; database mountedreleased channel: ORA_DISK_1
在CentOS 6.4下安裝Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虛擬機器中安裝步驟
Debian 下 安裝 Oracle 11g XE R2
更多詳情見請繼續閱讀下一頁的精彩內容: