oracle冷备份恢复和oracle异机恢复使用方法

二、异机苏醒冷备份恢复生机措施澳门金沙vip,A、不创制实例:①在对象机上的oradata目录下建构orcl文件夹,拷贝源机的持有data文件和一齐redo文件到此目录下。②在对象机上的admin目录下树立orcl文件夹,然后在orcl里面再建设构造adump、bdump、cdump、udump、dpdump、pfile八个文本夹③把源机的密码文件拷贝到指标机的database目录下。④用到oradim命令在cmd下oradim
-new -sid orcl
表示建构一个劳动,sid为orcl⑤拷贝源机的pfile到指标机的二个索引下,改过pfile里面相关文书的门径,然后通过SQLcreate
spfile from pfile=‘文件路线’来创立参数文件。⑥重新建立调整文件命令:SQLalter
database backup controlfile to
trace;然后会在udump文件夹下发生三个跟踪文件,打开文件找到如下黄金时代段,复制到文本中,改良相应路线然后保留为:createctl.sql文件,复制到指标机上。注意:SQLalter
database backup controlfile to trace as
‘aa.txt’;linux系统中会在dbs目录下创建复制代码 代码如下:STARTUP NOMOUNTCREATE
CONTROLFILE REUSE DATABASE “ORCL” RESETLOGS ARCHIVELOG MAXLOGFILES 16
MAXLO阿奇霉素EMBEHavalS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTOLANDY 292LOGFILE
GROUP 1 ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG’ SIZE
50M, GROUP 2 ‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG’
SIZE 50M, GROUP 3
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG’ SIZE 50M–
STANDBY LOGFILEDATAFILE
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF’,
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF’,
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF’,
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF’,
‘C:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\BANK_DATA02.DBF’CHARACTER
SET ZHS16GBK;

机器A: select instance_name from v$instance; select name from
v$database; select name from v$datafile; 查询日志形式: archive log
list; shutdown immediate; startup mount; 把日志改为归档方式: alter
database archivelog; alter database open; alter system archive log
current; select name from v$archived_log; 张开调整文件跟踪: alter
database backup controlfile to trace; 查看追踪文件地方: show parameter
user_dump_dest cmd: set oracle_sid=orcl rman target sys/abc host “md
c:\back”; run { backup database; format
‘c:\back\%d_%s_%T_full.bak’; } select file#,name from v$datafile;
传送以下文件到机器B: c:\back d:\oracle\product\10.2.0\admin\orcl
CREATE CONTROLFILE SET DATABASE “ORCL” RESETLOGS ARCHIVELOG MAXLOGFILES
16 MAXLOGMEMBERS 3 MAXDATAFILES 100 MAXINSTANCES 8 MAXLOGHISTORY 292
LOGFILE GROUP 1 ‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO01.LOG’
SIZE 50M, GROUP 2
‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO02.LOG’ SIZE 50M, GROUP
3 ‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\REDO03.LOG’ SIZE 50M —
STANDBY LOGFILE DATAFILE
‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSTEM01.DBF’,
‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\UNDOTBS01.DBF’,
‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\SYSAUX01.DBF’,
‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\USERS01.DBF’,
‘E:\ORACLE\PRODUCT\10.2.0\ORADATA\ORCL\XM’ CHARACTEHaval SET ZHS16GBK
机器B: 创制要苏醒oracle的目录 e:\oracle\product\10.2.0\oradata\orcl
e:\oracle\product\10.2.0\admin
e:\oracle\product\10.2.0\falsh_recovery_area
把摄取的文本夹orcl放到e:\oracle\product\10.2.0\admin 拷贝
e:\oracle\product\10.2.0\admin\orcl\pfile中的参数文件到温馨实际数据库db_1\database文件夹中,并改名换姓为initorcl.ora
展开initorcl.ora 把内部的路线改为实际oracle数据库之处 d:\替换为e:\
cmd1: set oracle_sid=orcl oracle orcl 等到晋升ctrl+c cmd2: set
oracle_sid=orcl sqlplus / as sysdba startup nomount; cmd3: set
oracle_sid=orcl rman target sys/abc restore controlfile from
‘C:\back\ORCL_2_20090414_FULL.BAK’; cmd2: alter database mount;
cmd3: run{ set newname for datafile 1 to
‘E:\oracle\product\10.2.0\oradata\orcl\SYSTEM01.DBF’; set newname
for datafile 2 to
‘E:\oracle\product\10.2.0\oradata\orcl\UNDOTBS01.DBF’; set newname
for datafile 3 to
‘E:\oracle\product\10.2.0\oradata\orcl\SYSAUX01.DBF’; set newname
for datafile 4 to
‘E:\oracle\product\10.2.0\oradata\orcl\USERS01.DBF’; set newname
for datafile 5 to ‘E:\oracle\product\10.2.0\oradata\orcl\XM’;
restore database; switch datafile all; } cmd2: select name from
v$database; shutdown immediate; startup mount; alter database backup
controlfile to trace; 找到追踪文件:
重做决定文件:把在那之中的路子改为正确路径: d:\改为 e:\ shutdown
immediate; startup nomount;
推行生成调节文件的言语;实践钱总得先删除.ctl的文书 alter database open
resetlogs; select name from v$database; select member from v$logfile;

⑦ c:\set ORACLE_SID=orcl c:\sqlplus “/as sysdba” SQLcreate spfile
from pfile=’c:\pfile.txt’; SQL@c:\createctl.sql; SQLshutdown
immediate; SQLstartup; SQLalter database open
resetlogs;⑧在network\admin下的tnsnames.ora中加多如下片段ORCL =
(DESC凯雷德IPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =
127.0.0.1)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl卡塔尔(قطر‎ )卡塔尔(قطر‎⑨用net configuration为orcl实例新建监听

2、冷备份所需备份的信封包蕴以下二种:全体数据文件、全数调控文件、全部联合REDO
LOG
文件3、冷备份的步调①好端端关闭要备份的实例②拷贝全数首要文件到备份目录下③完事备份后开发银行数据库4、用冷备份进行数据库复苏无归档形式:将备份文件拷贝回原本的目录就可以,然后运营数据库。归档方式:①将数据文件、调节文件拷贝回原本目录②SQLstartup
mount;SQLrecover database using backup
controlfile;③将相应的存档日志和协同日志拖到CMD命令窗口进行跑日志。④SQLalter
database open resetlogs;