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

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > linux >内容正文

linux

linux异机拷贝,rman恢复异机数据库

發(fā)布時間:2025/4/16 linux 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 linux异机拷贝,rman恢复异机数据库 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.

2,利用scp拷貝到異機

[oracle@db101 ab]$ ls

liu0stl8tun_1_1?liu0ttl8u58_1_1

[oracle@db101 ab]$ scp *

oracle@192.168.3.3:/home/oracle/ab/

oracle@192.168.3.3's password:

liu0stl8tun_1_1?100%

2144MB?12.1MB/s?02:57

liu0ttl8u58_1_1?100%

7264KB?7.1MB/s?00:

3,異機關(guān)庫并設(shè)置為主庫的數(shù)據(jù)庫id即dbid

rman>set dbid 85555655666(主庫的id號)

4,需要拷貝主庫的參數(shù)文件到異機庫

[oracle@db101 dbs]$ scp initecom.ora

oracle@192.168.3.3:/oracle/app/oracle/product/10.2.0/db_1/dbs/

oracle@192.168.3.3's password:

initecom.ora?100%?960?0.9KB/s?00:00

5,異機庫啟動到nomount狀態(tài)

rman>startup nomunt

6,利用主庫的備份文件恢復(fù)控制文件

RMAN> restore controlfile from

'/home/oracle/ab/liu0ttl8u58_1_1';

Starting restore at 20-DEC-18

using target database control file instead of recovery

catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed time:

00:00:04

output filename=/oracle/app/oradata/ecom/control01.ctl

output filename=/oracle/app/oradata/ecom/control02.ctl

output filename=/oracle/app/oradata/ecom/control03.ctl

Finished restore at 20-DEC-18

RMAN> restore

database;

Starting restore at 20-DEC-18

using channel ORA_DISK_1

RMAN-00571:

===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS

===============

RMAN-00571:

===========================================================

RMAN-03002: failure of restore command at 12/20/2018

21:10:47

ORA-01507: database not

mounted

說明restore命令需要在mount之后次可以執(zhí)行

7,數(shù)據(jù)庫啟動到mount狀態(tài)

RMAN> startup mount

database is already started

database mounted

released channel: ORA_DISK_1

8,修復(fù)數(shù)據(jù)

RMAN> restore database;

Starting restore at 20-DEC-18

Starting implicit crosscheck backup at 20-DEC-18

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=156 devtype=DISK

Crosschecked 22 objects

Finished implicit crosscheck backup at 20-DEC-18

Starting implicit crosscheck copy at 20-DEC-18

using channel ORA_DISK_1

Finished implicit crosscheck copy at 20-DEC-18

searching for all files in the recovery area

cataloging files...

no files cataloged

using channel ORA_DISK_1

channel ORA_DISK_1: starting datafile backupset restore

channel ORA_DISK_1: specifying datafile(s) to restore from

backup set

restoring datafile 00001 to

/oracle/app/oradata/ecom/system01.dbf

restoring datafile 00002 to

/oracle/app/oradata/ecom/undotbs01.dbf

restoring datafile 00003 to

/oracle/app/oradata/ecom/sysaux01.dbf

restoring datafile 00004 to

/oracle/app/oradata/ecom/users01.dbf

restoring datafile 00005 to

/oracle/app/oradata/ecom/dd01.dbf

restoring datafile 00006 to

/oracle/app/oradata/ecom/liu.dbf

channel ORA_DISK_1: reading from backup piece

/home/oracle/ab/liu0stl8tun_1_1

channel ORA_DISK_1: restored backup piece 1

piece handle=/home/oracle/ab/liu0stl8tun_1_1

tag=TAG20181220T173727

channel ORA_DISK_1: restore complete, elapsed time:

00:04:11

Finished restore at 20-DEC-18

9,恢復(fù)數(shù)據(jù)庫

RMAN> recover database;

Starting recover at 20-DEC-18

using channel ORA_DISK_1

RMAN-00571:

===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS

===============

RMAN-00571:

===========================================================

RMAN-03002: failure of recover command at 12/20/2018

21:18:00

ORA-19698:

/oracle/app/oradata/ecom/redo01.log is from different database:

id=3675719757, db_name=ECOM

說明數(shù)據(jù)庫的dbid不一樣,無法恢復(fù),需要提前設(shè)置,倘若忘記設(shè)置,以下可以關(guān)庫在重新設(shè)置

RMAN> set dbid 3676077492

executing command: SET DBID

RMAN-00571:

===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS

===============

RMAN-00571:

===========================================================

RMAN-03002: failure of CSET command at 12/20/2018

21:19:53

RMAN-06188: cannot use command when connected to a mounted

target database

RMAN> shutdown immediate

database dismounted

Oracle instance shut down

RMAN> set dbid 3676077492

executing command: SET DBID

RMAN> startup mount

connected to target database (not started)

Oracle instance started

database mounted

Total System Global Area?285212672 bytes

Fixed Size?1218992

bytes

Variable Size?75499088 bytes

Database Buffers?205520896 bytes

Redo Buffers?2973696 bytes

RMAN> recover database;

Starting recover at 20-DEC-18

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=157 devtype=DISK

RMAN-00571:

===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS

===============

RMAN-00571:

===========================================================

RMAN-03002: failure of recover command at 12/20/2018

21:21:31

ORA-19698: /oracle/app/oradata/ecom/redo01.log is from

different database: id=3675719757, db_name=ECOM

說明數(shù)據(jù)庫的日志不一致,需要拷貝主庫的當前日志過來(我這里是rman全備份后,沒有歸檔可以只拷貝當前日志,倘若你有過歸檔需要你把歸檔和當前日志組一起拷貝過來)

----還是出現(xiàn)這個錯誤,從錯誤里可以看到兩個錯誤點一是日志不同,而是數(shù)據(jù)庫dbid不同,需要把這兩處都修改一致才可以recover

10,copy主庫的日志(或歸檔+當前)到異機庫

scp *.log

oracle@192.168.3.3:/oracle/app/oradata/ecom/

11,恢復(fù)數(shù)據(jù)庫

RMAN> recover database;

Starting recover at 20-DEC-18

using channel ORA_DISK_1

starting media recovery

archive log thread 1 sequence 46 is already on disk as file

/oracle/app/oradata/ecom/redo03.log

archive log filename=/oracle/app/oradata/ecom/redo03.log

thread=1 sequence=46

media recovery complete, elapsed time: 00:00:03

Finished recover at 20-DEC-18

12,修改數(shù)據(jù)庫以resetlogs方式開啟數(shù)據(jù)庫

SQL> alter database open;

alter database open

*

ERROR at line 1:

ORA-01589: must use RESETLOGS or NORESETLOGS option for

database open

SQL> alter database open noresetlogs;

alter database open noresetlogs

*

ERROR at line 1:

ORA-01588: must use RESETLOGS option for database open

SQL> alter database open resetlogs;

Database altered.----成功開啟數(shù)據(jù)庫

總結(jié)

以上是生活随笔為你收集整理的linux异机拷贝,rman恢复异机数据库的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。