Oracle实例迁移_真实场景实操
生活随笔
收集整理的這篇文章主要介紹了
Oracle实例迁移_真实场景实操
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
背景
環(huán)境:
oracle為11.2版本 Linux-Centos6.5操作系統(tǒng)。
現(xiàn)狀:
兩臺主機198,197 ,均已安裝了oracle服務端。
其中198上已經(jīng)創(chuàng)建了兩個實例,197上只有orcl實例。
需要在197上搭建一套環(huán)境,數(shù)據(jù)保持和198一致。
步驟概述
停198數(shù)據(jù)庫
將/oracle/product/112/dbs目錄下的全部文件copy到197對應目錄
/oracle/admin目錄以及子目錄遷到197對應目錄 ,文件可以不遷。
/oradata/instance1 /oradata/instance2 全部文件數(shù)據(jù)遷到197對目錄
操作步驟
停止198庫
使用 oracle用戶操作 su - oracle
Last login: Tue Sep 20 04:59:33 2016 from 10.45.22.168 oracle@entel2:[/oracle]$sqlplus sys/****** as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 20 05:43:15 2016Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing optionsSQL> shutdown immediate ^CORA-01013: user requested cancel of current operationshutdown immediate無反應......取消,改用abortSQL> shutdown abort; ORACLE instance shut down. SQL>copy數(shù)據(jù)到197對應目錄
scp -r /oracle/product/112/dbs oracle@10.45.7.197:/oracle/product/112/scp -r /oradata/instance1/ oracle@10.45.7.197:/oradata/scp -r /oradata/instance2/ oracle@10.45.7.197:/oradata/操作之前請先確保197主機對應目錄存在,確保存儲空間足夠.
啟動197主機上的實例
oracle@entel1:[/oracle]$sqlplus sys/system as sysdbaSQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 20 11:52:02 2016Copyright (c) 1982, 2013, Oracle. All rights reserved.Connected to an idle instance.SQL> shutdown immediate ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux-x86_64 Error: 2: No such file or directory SQL> SQL> startup force ORACLE instance started.Total System Global Area 6530822144 bytes Fixed Size 2265384 bytes Variable Size 1140854488 bytes Database Buffers 5368709120 bytes Redo Buffers 18993152 bytes Database mounted. ORA-01172: recovery of thread 1 stuck at block 85000 of file 5 ORA-01151: use media recovery to recover block, restore backup if neededSQL> show parameter audit_file_destNAME TYPE VALUE ------------------------------------ ----------- ------------------------------ audit_file_dest string /oracle/admin/instance1/adump SQL> shutdown immediate ORA-01109: database not openDatabase dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started.Total System Global Area 6530822144 bytes Fixed Size 2265384 bytes Variable Size 1140854488 bytes Database Buffers 5368709120 bytes Redo Buffers 18993152 bytes Database mounted. ORA-01172: recovery of thread 1 stuck at block 85000 of file 5 ORA-01151: use media recovery to recover block, restore backup if needed解決: SQL> select file#,name from v$datafile where file#=5;FILE# ---------- NAME --------------------------------------------------------------------------------5 /oradata/instance1/tab_instance1_01.dbfSQL> recover datafile 5; Media recovery complete.從損壞的磁盤中恢復可讀取的信息。--------------------------------------------------------------------------------SQL> shutdown immediate ORA-01109: database not openDatabase dismounted. ORACLE instance shut down. SQL> startup ORACLE instance started.Total System Global Area 6530822144 bytes Fixed Size 2265384 bytes Variable Size 1140854488 bytes Database Buffers 5368709120 bytes Redo Buffers 18993152 bytes Database mounted. ORA-00600: internal error code, arguments: [kcratr_scan_lastbwr], [], [], [], [], [], [], [], [], [], [], []看日志: /oracle/diag/rdbms/instance1/instance1/trace/alert_instance1.log Reread (file 3, block 2136) found same corrupt data (logically corrupt) ******** WRITE VERIFICATION FAILED ******** 出現(xiàn)了邏輯壞塊 (logically corrupt),因此需要進行介質(zhì)恢復。SQL> shutdown immediate ORA-01109: database not openDatabase dismounted. ORACLE instance shut down. SQL> startup mount ; ORACLE instance started.Total System Global Area 6530822144 bytes Fixed Size 2265384 bytes Variable Size 1140854488 bytes Database Buffers 5368709120 bytes Redo Buffers 18993152 bytes Database mounted. SQL> recover database ; Media recovery complete. SQL> alter database open ;Database altered.自此OK,數(shù)據(jù)庫可以正常訪問了.
總結(jié)
以上是生活随笔為你收集整理的Oracle实例迁移_真实场景实操的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Linux-awk及内置变量
- 下一篇: Linux-sed文本处理流编辑器