利用rman在同一臺機器上主庫online搭建standby
1.用oradmin新建一個例項名test
C:\Documents and Settings\Paul Yi>oradim -new -sid test
2.準備引數檔案 d:\inittest.ora檔案
*.background_dump_dest='D:\oracle\admin\test\bdump'
*.compatible='9.2.0.0.0'
*.control_files='D:\oracle\oradata\test\control01.ctl','D:\oracle\oradata\test\control02.ctl','D:\oracle\oradata\test\control03.ctl'
*.core_dump_dest='D:\oracle\admin\test\cdump'
*.db_name='paul'
*.lock_name_space='test'
*.db_file_name_convert='d:\oracle\oradata\paul','d:\oracle\oradata\test'
*.log_file_name_convert='d:\oracle\oradata\paul','d:\oracle\oradata\test'
*.fal_server=paul
*.fal_client=test
*.standby_archive_dest='location=e:\archtest'
*.standby_file_management=auto
*.log_archive_format='%t_%s.dbf'
*.log_archive_start=TRUE
*.user_dump_dest='D:\oracle\admin\test\udump'
3.生成密碼檔案
C:\Documents and Settings\Paul Yi>orapwd file=d:\oracle\ora92\database\pwdtest.o
ra password=abcdefg entries=10
4.配置listener.ora和tnsnames.ora檔案
.配置網路
配置主備庫的listener.ora,tnsnames.ora。修改完lisner.ora後注意重啟監聽。
Listener.ora
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.163)(PORT = 1521))
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = d:\oracle\ora92)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = paul)
(ORACLE_HOME = d:\oracle\ora92)
(SID_NAME = paul)
)
(SID_DESC =
(GLOBAL_DBNAME = test)
(ORACLE_HOME = d:\oracle\ora92)
(SID_NAME = test)
)
)
tnsnames.ora
paul =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.163)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = paul)
)
)
test =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.163)(PORT = 1521))
)
(CONNECT_DATA =
(SID = test)
)
)
7.使用rman備份主庫
C:\Documents and Settings\Paul Yi>rman target /
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: PAUL (DBID=1605165889)
RMAN> backup full database;
Starting backup at 19-DEC-07
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=13 devtype=DISK
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00001 name=D:\ORACLE\ORADATA\PAUL\SYSTEM01.DBF
input datafile fno=00002 name=D:\ORACLE\ORADATA\PAUL\UNDOTBS01.DBF
input datafile fno=00003 name=D:\ORACLE\ORADATA\PAUL\INDX01.DBF
input datafile fno=00005 name=D:\ORACLE\ORADATA\PAUL\USERS01.DBF
input datafile fno=00004 name=D:\ORACLE\ORADATA\PAUL\TOOLS01.DBF
input datafile fno=00006 name=D:\TEST01_P.DBF
input datafile fno=00007 name=D:\TEST02_P.DBF
input datafile fno=00008 name=D:\TEST03_P.ORA
channel ORA_DISK_1: starting piece 1 at 19-DEC-07
channel ORA_DISK_1: finished piece 1 at 19-DEC-07
piece handle=D:\BACKUP\1SJ40FFL_1_1 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:46
Finished backup at 19-DEC-07
Starting Control File and SPFILE Autobackup at 19-DEC-07
piece handle=D:\BACKUP\C-1605165889-20071219-03 comment=NONE
Finished Control File and SPFILE Autobackup at 19-DEC-07
8.生成備庫控制檔案
SQL> alter database create standby controlfile as 'd:\control01.ctl' reuse;
Database altered.
複製兩份,放到 d:\oracle\oradata\test\下面,並改名為control02.ctl,control03.ctl
9.啟動備庫到nomount狀態
C:\Documents and Settings\Paul Yi>sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Wed Dec 19 14:25:05 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL> conn as sysdba
Connected to an idle instance.
SQL> startup nomount pfile='d:\inittest.ora';
ORACLE instance started.
Total System Global Area 101785252 bytes
Fixed Size 454308 bytes
Variable Size 75497472 bytes
Database Buffers 25165824 bytes
Redo Buffers 667648 bytes
啟動到備庫
SQL> alter database mount standby database;
Database altered.
11.利用rman恢復出備庫
C:\Documents and Settings\Paul Yi>rman target
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: PAUL (DBID=1605165889)
RMAN> restore database;
Starting restore at 19-DEC-07
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=10 devtype=DISK
skipping datafile 1; already restored to file D:\ORACLE\ORADATA\TEST\SYSTEM01.DB
F
skipping datafile 2; already restored to file D:\ORACLE\ORADATA\TEST\UNDOTBS01.D
BF
skipping datafile 3; already restored to file D:\ORACLE\ORADATA\TEST\INDX01.DBF
skipping datafile 4; already restored to file D:\ORACLE\ORADATA\TEST\TOOLS01.DBF
skipping datafile 5; already restored to file D:\ORACLE\ORADATA\TEST\USERS01.DBF
skipping datafile 8; already restored to file D:\TEST03_P.ORA
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to D:\TEST01_P.DBF
restoring datafile 00007 to D:\TEST02_P.DBF
channel ORA_DISK_1: restored backup piece 1
piece handle=D:\BACKUP\1SJ40FFL_1_1 tag=TAG20071219T141933 params=NULL
channel ORA_DISK_1: restore complete
Finished restore at 19-DEC-07
13.將備庫置於自動恢復狀態
SQL> conn as sysdba
Connected.
SQL> alter database recover managed standby database disconnect from session;
Database altered.
SQL> select process,status from v$managed_standby;
PROCESS STATUS
------- ------------
ARCH CONNECTED
ARCH CONNECTED
MRP0 WAIT_FOR_LOG
RFS RECEIVING
完成
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-883/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 通過rman在同一臺機器上搭建standby大致過程!
- 在同一臺主機上建立複製資料庫資料庫
- 利用rman快速搭建standby
- 續上_在同一節點上利用rman duplicate複製資料庫資料庫
- 利用RMAN建立STANDBY資料庫資料庫
- Oracle在一臺機器上搭建dataguardOracle
- 【轉】在同一臺主機配置MySQL ClusterMySql
- 【DATAGUARD 學習】同一臺主機上的dataguard
- Primary 和standby資料庫同一臺主機上的Ora-01102問題分析解決資料庫
- 請教在同一臺機器上配置weblogic的clusterWeb
- 在sun t2000上兩臺主機間利用oracle10g rman_duplicate複製資料庫Oracle資料庫
- 虛擬機器上單個linux 搭建standby虛擬機Linux
- Dataguard環境修改主庫和standby庫online redo log&standby redo log大小
- 在虛擬機器上搭建主機可訪問的web服務虛擬機Web
- 同一臺機器上DataGuard的密碼問題密碼
- 利用RMAN搭建DATAGARD進行主備切換
- rman 資料庫從一臺機器遷移到另外的一臺機器資料庫
- 在宿主機上搭建docker映象倉庫Docker
- hp-ux利用rman將資料庫跨平臺遷移到aix平臺上UX資料庫AI
- 在基於CentOS的雲主機上用vsftpd搭建FTP伺服器CentOSFTP伺服器
- 在同一臺機器下安裝兩個Oracle Software 版本Oracle
- 基於同一主機配置Oracle 11g Data Guard(logical standby)Oracle
- rman備份資料庫後到另一臺機器上恢復的例子資料庫
- 利用RMAN跨平臺遷移資料庫資料庫
- 使用RMAN duplicate 建立standby資料庫(RAC或單機)資料庫
- aix 下 oracle 11.2 rac 在同一臺機器上把資料遷移到新儲存AIOracle
- 使用rman建立standby資料庫資料庫
- standby全庫rman備份檔案恢復到異機
- 【RMAN】利用備份片還原資料庫(上)資料庫
- 使用RMAN建立物理Standby資料庫資料庫
- RMAN duplicate 建立standby RAC資料庫資料庫
- 在單機上建立物理的Oracle9i standby資料庫(轉)Oracle資料庫
- 在DG備庫備份資料庫並恢復到一個主機上,報錯RMAN-06820資料庫
- 在Oracle DG Standby庫上啟用flashback database功能OracleDatabase
- 將資料庫從一臺機器複製到另一臺機器上資料庫
- 在Ubuntu機器上從零開始搭建SVN伺服器Ubuntu伺服器
- [20171221]利用rman實現2臺機器檔案拷貝
- 在dg庫上搭建ogg