标签:art log 启动 bootstrap 用户名 替换 进入 main 线程
说明,只要是同样系统,同样数据库版本,是可以做冷备恢复。冷备份数据必须是数据库不在open状态下。以oracle11gR2为例。
具体步骤如下。
(1)创建一个和原来一样的数据库。(安装路径和数据库名必须和原来一致)
(2)停止数据库shutdown immediate;
(3)复制安装目录下的admin、oradata、flash_recovery_area覆盖,复制database(PWDfile、pfile) 覆盖
(4)启动数据库 startup;
备注:
无归档模式:将备份文件拷贝回原来的目录即可,然后启动数据库。
归档模式:
①将数据文件、控制文件拷贝回原来目录
②SQL>startup mount;
SQL>recover database using backup controlfile;
③将相应的归档日志和联机日志拖到CMD命令窗口进行跑日志。
④SQL>alter database open resetlogs;
此时,操作系统重装,如果做冷备恢复,要保证相同操作系统,相同的数据库版本。形势如同异机恢复。
(1) 恢复oradata/orcl目录
在目标机上的oradata目录下建立orcl文件夹,然后进行数据覆盖。
STARTUP NOMOUNT CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG MAXLOGFILES 16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292 LOGFILE GROUP 1 ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG‘ SIZE 50M BLOCKSIZE 512, GROUP 2 ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG‘ SIZE 50M BLOCKSIZE 512, GROUP 3 ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG‘ SIZE 50M BLOCKSIZE 512 -- STANDBY LOGFILE DATAFILE ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF‘, ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF‘, ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF‘, ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF‘, ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF‘, ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\YTQ.DBF‘, ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\ZJHH‘, ‘E:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SDE_TBS‘, ‘I:\ZJECMS\DB\DB_BK_DATA\RMAN_LOCAL_1805\RMAN_BKUP_1805.DBF‘ CHARACTER SET ZHS16GBK ;
(5) 数据库设置SID和启动服务
c:\>set ORACLE_SID=orcl c:\>sqlplus "/as sysdba" SQL>create spfile from pfile=‘c:\pfile.txt‘; SQL>@c:\createctl.sql; SQL>shutdown immediate; SQL>startup; SQL>alter database open resetlogs;
备注:
如果(4)、(5)不好用,可以用下面的方法修改这些路径不一致的问题(反正笔者电脑上冷备份恢复时,上面的两个步骤就不好用):
1)SQL>下执行如下语句,恢复控制文件
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "ORCL" NORESETLOGS ARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
2)修改日志、DBF的路径
alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO01.LOG‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\REDO01.LOG‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO02.LOG‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\REDO02.LOG‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\REDO03.LOG‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\REDO03.LOG‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSTEM01.DBF‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\SYSTEM01.DBF‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\SYSAUX01.DBF‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\SYSAUX01.DBF‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\UNDOTBS01.DBF‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\UNDOTBS01.DBF‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS01.DBF‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\USERS01.DBF‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\EXAMPLE01.DBF‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\EXAMPLE01.DBF‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\YTQ.DBF‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\YTQ.DBF‘; alter database rename file ‘E:\APP\ADMINISTRATOR\ORADATA\ORCL\ZJHH‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\ZJHH‘; alter database rename file ‘E:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SDE_TBS‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\SDE_TBS‘; alter database rename file ‘I:\ZJECMS\DB\DB_BK_DATA\RMAN_LOCAL_1805\RMAN_BKUP_1805.DBF‘ to ‘E:\IDEPROS\oracle_home\oradata\orcl\RMAN_BKUP_1805.DBF‘; 修改oracle_home\oradata\orcl下及相关文件的路径
ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ) )
c:\>sqlplus "/as sysdba" SQL>@c:\createctl.sql; SQL>shutdown immediate; SQL>startup; SQL>alter database open resetlogs;
(4) 在network\admin下的tnsnames.ora中添加如下片段
复制代码代码如下:
ORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ) )
在从mount状态下,启动时出现;或者从startup命令启动时出现。
详情请参考文章
Oracle错误——ORA-03113:通信通道的文件结尾 解决办法
如何釋放 DB_RECOVERY_FILE_DEST_SIZE
(1) 查看diag\rdbms\oracle\oracle\trace\下的oracle_ora_xxxx.trc错误日志
Oracle出现错误,于是去错误日志里去找问题根源:在 e:\app\kang\diag\rdbms\oracle\oracle\trace\文件夹下找到oracle_ora_6320.trc文件,打开显示错误日志:
ORA-19815: WARNING: db_recovery_file_dest_size of 4102029312 bytes is 100.00% used, and has 0 remaining bytes available. ************************************************************************ You have following choices to free up space from recovery area: 1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard, then consider changing RMAN ARCHIVELOG DELETION POLICY. 2. Back up files to tertiary device such as tape using RMAN BACKUP RECOVERY AREA command. 3. Add disk space and increase db_recovery_file_dest_size parameter to reflect the new space. 4. Delete unnecessary files using RMAN DELETE command. If an operating system command was used to delete files, then use RMAN CROSSCHECK and DELETE EXPIRED commands. ************************************************************************ ORA-19809: limit exceeded for recovery files ORA-19804: cannot reclaim 38451712 bytes disk space from 4102029312 limit *** 2018-08-09 17:47:48.882 4132 krsh.c ARC1: Error 19809 Creating archive log file to ‘E:\IDEPROS\ORACLE_HOME\FLASH_RECOVERY_AREA\ORCL\ARCHIVELOG\2018_08_09\O1_MF_1_5330_%U_.ARC‘ *** 2018-08-09 17:47:48.882 2747 krsi.c krsi_dst_fail: dest:1 err:19809 force:0 blast:1 DDE rules only execution for: ORA 312 ----- START Event Driven Actions Dump ---- ---- END Event Driven Actions Dump ---- ----- START DDE Actions Dump ----- Executing SYNC actions ----- START DDE Action: ‘DB_STRUCTURE_INTEGRITY_CHECK‘ (Async) ----- DDE Action ‘DB_STRUCTURE_INTEGRITY_CHECK‘ was flood controlled ----- END DDE Action: ‘DB_STRUCTURE_INTEGRITY_CHECK‘ (FLOOD CONTROLLED, 0 csec) ----- Executing ASYNC actions ----- END DDE Actions Dump (total 0 csec) ----- *** 2018-08-09 17:47:48.882 4529 kcrr.c ORA-16038: log 2 sequence# 5330 cannot be archived ORA-19809: limit exceeded for recovery files ORA-00312: online log 2 thread 1: ‘E:\IDEPROS\ORACLE_HOME\ORADATA\ORCL\REDO02.LOG‘
(2) 找出问题根源
从这里我们发现了问题的根源:
ORA-19815: WARNING: db_recovery_file_dest_size of 4102029312 bytes is 100.00% used, and has 0 remaining bytes available.
是db_recovery_file_dest_size也叫归档日志空间不足导致的,既然找到问题的根源,那解决起来也就容易了。 (3) 确定解决方法 ---设置归档日志空间的大小 空间小,那摆在我们面前办法就是,一个是将空间设置大点,另一个就是将多余的文件删除掉即可,那么我们就将这两个办法都使用一下。 CMD命令窗口启动: 方法1:设置归档日志空间的大小
-- at cmd sqlplus / as sysdba -- at sql shutdown abort ----关闭进程 startup mount ---- 装载数据库 select * from v$recovery_file_dest; ---查询归档日志 exit -- at cmd rman target / -- at rman db_recovery_file_dest_size = 6442450944; --设置归档日志空间为6G (6*1024*1024*1024) Exit ---到这里空间大小已经设置完成
方法2: 删除归档日志
rman target / -----进入rman工具窗口 RMAN>crosscheck archivelog all; --运行这个命令可以把无效的expired的archivelog标出来。 RMAN>delete noprompt archivelog until time "sysdate -3"; -- -即删除3天前的归档日志
具体请参考
ORA-00704: bootstrap process failure ORA-39700: database must be opened with UPGRADE option
Oracle案例04——ORA-39700: database must be opened with UPGRADE option
错误出现的过程
SQL> startup ORA-01081: 无法启动已在运行的 ORACLE - 请首先关闭它 SQL> shutdown immediate ORA-01109: 数据库未打开 已经卸载数据库。 ORACLE 例程已经关闭。 SQL> startup ORACLE 例程已经启动。 Total System Global Area 3340451840 bytes Fixed Size 2180344 bytes Variable Size 1828719368 bytes Database Buffers 1493172224 bytes Redo Buffers 16379904 bytes 数据库装载完毕。 ORA-01092: ORACLE instance terminated. Disconnection forced ORA-00704: bootstrap process failure ORA-39700: database must be opened with UPGRADE option 进程 ID: 7660 会话 ID: 191 序列号: 3 SQL>
通过数据字典升级解决
C:\Windows\System32>sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on 星期四 8月 9 19:09:30 2018 Copyright (c) 1982, 2010, Oracle. All rights reserved. 已连接到空闲例程。 SQL> startup upgrade; ORACLE 例程已经启动。 Total System Global Area 3340451840 bytes Fixed Size 2180344 bytes Variable Size 1828719368 bytes Database Buffers 1493172224 bytes Redo Buffers 16379904 bytes 数据库装载完毕。 数据库已经打开。 SQL>
(2)查看预升级信息
SQL> @$ORACLE_HOME/rdbms/admin/utlu112i.sql
(3)执行升级脚本
SQL> @$ORACLE_HOME/rdbms/admin/catupgrd.sql
//这个过程时间比较长, 执行完上面操作执行,也可重新正常打开数据库即可。
SQL> @$ORACLE_HOME/rdbms/admin/utlu112s.sql
SQL> @$ORACLE_HOME/rdbms/admin/catuppst.sql
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
(4)重启数据库
SQL> shutdown immediate;
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup;
参考 ORA-01589: 要打开数据库则必须使用 RESETLOGS 或 NOR
冷备份1.1中的内容后,在原地回复这些dbf文件,及参数、日志、控制重新覆盖在目标位置后,重新在sqlplus下执行1.2的步骤后,可能会出现如上的错误。解决办法如下:
SQL> alter database open resetlogs; alter database open resetlogs * ERROR 位于第 1 行: ORA-01113: 文件 1 需要介质恢复 ORA-01110: 数据文件 1: ‘E:\ORACLE\ORADATA\EYGLE\SYSTEM01.DBF‘ SQL> recover database using backup controlfile; ORA-00279: 更改 1670743 (在 04/17/2008 14:13:16 生成) 对于线程 1 是必需的 ORA-00289: 建议: E:\ORACLE\ORA92\RDBMS\ARC00030.001 ORA-00280: 更改 1670743 对于线程 1 是按序列 # 30 进行的 指定日志: {=suggested | filename | AUTO | CANCEL} E:\oracle\oradata\EYGLE\REDO01.LOG ORA-00310: 存档日志包含序列 29;要求序列 30 ORA-00334: 归档日志: ‘E:\ORACLE\ORADATA\EYGLE\REDO01.LOG‘ SQL> recover database using backup controlfile; ORA-00279: 更改 1670743 (在 04/17/2008 14:13:16 生成) 对于线程 1 是必需的 ORA-00289: 建议: E:\ORACLE\ORA92\RDBMS\ARC00030.001 ORA-00280: 更改 1670743 对于线程 1 是按序列 # 30 进行的 指定日志: {=suggested | filename | AUTO | CANCEL} E:\oracle\oradata\EYGLE\REDO02.LOG 已应用的日志。 完成介质恢复。 SQL> alter database open resetlogs; 数据库已更改。
标签:art log 启动 bootstrap 用户名 替换 进入 main 线程
原文地址:https://www.cnblogs.com/jijm123/p/12397316.html