Oracle数据库迁移及问题处理两例

Oracle数据库迁移问题一:

一.问题描述:
由于需要将一个生产库停机冷备份copy到本机的新存储上,新存储在链路聚合操作时重启solairs 10后,无法识别所有光纤卡,尝试各种办法都无法找到光纤卡,且原OS系统在经过多种操作后,OS都无法启动。杯具发生,由于生产环境停机时间有限,所以决定将原存储分配到备机上,开启数据库。
 启动数据库时,报redo log找不到:
SQL> conn /as sysdba
 Connected to an idle instance.
 SQL> startup
Oracle instance started.

Total System Global Area 4.2771E+10 bytes
 Fixed Size 2118064 bytes
 Variable Size 1.0522E+10 bytes
 Database Buffers 3.2212E+10 bytes
 Redo Buffers 34709504 bytes
 Database mounted.
 ORA-00313: open failed for members of log group 15 of thread 1
 ORA-00312: online log 15 thread 1: '/apps/redolog/redo15.log'


二.问题分析:

1.查看控制文件中redo log有哪些在本地文件系统中:

SQL> select open_mode from v$database; ---查看数据库现在处于mounted状态

OPEN_MODE
 ----------
 MOUNTED

SQL> alter database backup controlfile to trace; ---产生控制文件trace

Database altered.

SQL> oradebug setmypid; ---定位trace路径
Statement processed.
 SQL> oradebug tracefile_name;
 /rdcpc/oracpc/diag/rdbms/rdcpc/rdcpc/trace/rdcpc_ora_3655.trc
 SQL> exit
 Disconnected from Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
 With the Partitioning, OLAP, Data Mining and Real Application Testing options

-bash-3.00$ more /rdcpc/oracpc/diag/rdbms/rdcpc/rdcpc/trace/rdcpc_ora_3655.trc
 .................................................................
 -- ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE
 STARTUP NOMOUNT
 CREATE CONTROLFILE REUSE DATABASE "RDCPC" NORESETLOGS ARCHIVELOG
 MAXLOGFILES 16
 MAXLOGMEMBERS 3
 MAXDATAFILES 200
 MAXINSTANCES 8
 MAXLOGHISTORY 11680
 LOGFILE
 GROUP 1 (
 '/cpcdata4/redologa/redo01a.log',
 '/cpcdata5/redologb/redo01b.log'
 ) SIZE 200M,
 GROUP 2 (
 '/cpcdata4/redologa/redo02a.log',
 '/cpcdata5/redologb/redo02b.log'
 ) SIZE 200M,
 GROUP 3 (
 '/cpcdata4/redologa/redo03a.log',
 '/cpcdata5/redologb/redo03b.log'
 ) SIZE 200M,
 GROUP 4 (
 '/cpcdata4/redologa/redo04a.log',
 '/cpcdata5/redologb/redo04b.log'
 ) SIZE 200M,
 GROUP 5 (
 '/cpcdata4/redologa/redo05a.log',
 '/cpcdata5/redologb/redo05b.log'
 ) SIZE 200M,
 GROUP 15 '/apps/redolog/redo15.log' SIZE 200M
 -- STANDBY LOGFILE
 DATAFILE
 '/cpcdata1/data1/system01.dbf',
 '/cpcdata1/data1/sysaux01.dbf',
 '/cpcdata4/undo/undotbs01.dbf',
 '/cpcdata1/data1/users01.dbf',
 '/cpcdata2/data2/cpcbase01.dbf',
 '/cpcdata2/data2/cpcbase_idx01.dbf',
 '/cpcdata2/data2/cpcbase02.dbf',
 ........................................................................................
确认只有group 15的redo log是放在本地文件系统/apps下。

2.检查group 15的redo log 状态
SQL> desc v$log;
 Name Null? Type
 ----------------------------------------- -------- ----------------------------
 GROUP# NUMBER
 THREAD# NUMBER
 SEQUENCE# NUMBER
 BYTES NUMBER
 MEMBERS NUMBER
 ARCHIVED VARCHAR2(3)
 STATUS VARCHAR2(16)
 FIRST_CHANGE# NUMBER
 FIRST_TIME DATE

SQL> select group#,members,archived,status from v$log;

GROUP# MEMBERS ARC STATUS
 ---------- ---------- --- ----------------
 1 2 YES INACTIVE
 2 2 YES INACTIVE
 15 1 YES INACTIVE
 4 2 YES INACTIVE
 5 2 NO CURRENT
 3 2 YES INACTIVE

6 rows selected.
确认group 15已有归档,且是inactive状态。
 当在open DB时,数据库会检测控制文件中各文件是否存在,所以报找不到redo15.log文件的错误。

三.解决方法:
inactive状态且已归档的redo log可以在线drop,数据库不需要用到这些redo。

SQL> alter database drop logfile group 15;

Database altered.

SQL> alter database open;

Database altered.


数据库迁移问题二:
一.问题描述:
 原数据库存储划分迁移到备机后,重新建立oracle用户,并对oracle程序目录统一执行了chown oracpc:dba /rdcpc,启动数据库后,查看到alert.log中的大量如下报错:

WARNING: -------------------------------
WARNING: oradism did not start up correctly.
 Dynamic ISM can not be locked.----------------------------------------
 oradism creation failed for unknown reasons 0 8 1007
 WARNING: -------------------------------
 WARNING: oradism did not start up correctly.
 Dynamic ISM can not be locked.--------------------

二.问题分析:
查看MOS,确认问题主要是Dynamic ISM文件的权限不正确,数据库中有设置max_sga_size参数,处理方法有两种:
 一个是unset max_sga_size,另一个是更改oradism文件权限。

三.解决:
 这里采用了更改文件权限的方法:
chown root $ORACLE_HOME/bin/oradism
 chmod 06550 $ORACLE_HOME/bin/oradism
重启数据库后,alert.log中再没有报错。

相关推荐