日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

Oracle实例迁移_真实场景实操

發布時間:2025/3/21 编程问答 20 豆豆
生活随笔 收集整理的這篇文章主要介紹了 Oracle实例迁移_真实场景实操 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

背景

環境:

oracle為11.2版本 Linux-Centos6.5操作系統。

現狀:

兩臺主機198,197 ,均已安裝了oracle服務端。

其中198上已經創建了兩個實例,197上只有orcl實例。

需要在197上搭建一套環境,數據保持和198一致。

步驟概述

  • 停198數據庫

  • 將/oracle/product/112/dbs目錄下的全部文件copy到197對應目錄

  • /oracle/admin目錄以及子目錄遷到197對應目錄 ,文件可以不遷。

  • /oradata/instance1 /oradata/instance2 全部文件數據遷到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數據到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 ******** 出現了邏輯壞塊 (logically corrupt),因此需要進行介質恢復。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,數據庫可以正常訪問了.

    總結

    以上是生活随笔為你收集整理的Oracle实例迁移_真实场景实操的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。