记一次Oracle实例迁移
发布时间:2020-12-12 18:50:48 所属栏目:百科 来源:网络整理
导读:背景 环境: oracle为11.2版本 Linux-Centos6.5操作系统。 现状: 两台主机198,197 ,均已安装了oracle服务端。 其中198上已经创建了两个实例,197上只有orcl实例。 需要在197上搭建一套环境,数据保持和198一致。 步骤概述 停198数据库 将/oracle/product/
背景环境:
现状:
步骤概述
操作步骤停止198库使用 oracle用户操作 Last login: Tue Sep 20 04:59:33 2016 from 10.45.22.168
oracle@entel2:[/oracle]$sqlplus sys/****** as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 20 05:43:15 2016
Copyright (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 options
SQL> shutdown immediate
^CORA-01013: user requested cancel of current operation
shutdown immediate无反应......取消,改用abort
SQL> 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 sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Tue Sep 20 11:52:02 2016
Copyright (c) 1982,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 needed
SQL> show parameter audit_file_dest
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
audit_file_dest string /oracle/admin/instance1/adump
SQL> shutdown immediate
ORA-01109: database not open
Database 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.dbf
SQL> recover datafile 5;
Media recovery complete.
从损坏的磁盘中恢复可读取的信息。
--------------------------------------------------------------------------------
SQL> shutdown immediate
ORA-01109: database not open
Database 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 open
Database 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,数据库可以正常访问了. (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- xml – 多大的RSS阅读器工作(netvibes,Google阅读器…)
- ruby-on-rails – 远程查看pow.cx提供的网页
- c – 如何在合成中的运行时更改成员对象?
- ruby-on-rails – 如何在config / initializers运行后设置A
- c – 为什么cerr刷新cout的缓冲区
- ISTA算法求解L1正则化问题
- oracle事务的四个特性(ACID)
- c – 为什么可以通过const成员函数修改引用成员?
- C++中堆的应用:make_heap, pop_heap, push_heap, sort_hea
- ruby-on-rails – Rails 4 collection_check_boxes,带有has