rman之建立恢復目錄筆記
晚上做了一下建立恢復目錄的實驗,整理了一下,供自己以後參考
環境:
源庫:oracle10gr2 源OS:rhelas4 源sid=ora10 源庫ip=192.168.1.200
目標庫: oracle10gr2 目地OS:rhelas4 目的sid=ora10hha 目的庫ip=192.168.1.10
實驗目的:
要將源庫192.168.1.200 上的資料檔案、控制檔案以及日誌檔案備份到 目的庫192.168.1.10上,以便源庫出現問題時,可以透過
備份目錄恢復。
實驗準備:
1:在虛擬機器上安裝好兩個redhat系統,源庫ip=192.168.1.200,目的庫ip=192.168.1.10
並分別建立好兩個庫,一個ora10庫 , 一個orahha庫
同時關閉兩個redhat系統上的防火牆,確保這兩個OS都可以相互ping通
2:在目的庫(192.168.1.10)上透過圖形化介面執行netca命令,配置好監聽,配置好的listener.ora 如下
ora10hha =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
3:在源庫(192.168.1.200)上透過圖形化介面執行netca命令,配置好tnsname.ora ,配置好的內容如下:
ORA10HHA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora10hha)
)
)
4:在源庫(192.168.1.200)上執行客戶端到伺服器端的連線是不是正常:
[oracle@sphost admin]$ tnsping ORA10HHA
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 03-MAY-2011 23:22:19
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/home/oracle/10.2.0/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ora10hha)))
OK (80 msec)
[oracle@sphost admin]$
ok,這樣就可以透過網路連線到目的庫上了。
5:在源庫(192.168.1.200)上執行
[oracle@sphost admin]$ sqlplus sys/sysdba@ORA10HHA as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 3 23:26:18 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
6:在源庫(192.168.1.200)上建立表空間,用於存放恢復目錄資料,
並建立使用者,該使用者是恢復目錄的擁有者;同時給使用者授予查詢、維護恢復目錄的許可權
SQL> create tablespace tbs_catalog datafile '/home/oracle/oradata/catalog.dbf' size 1G;
Tablespace created.
SQL> create user rman identified by rman temporary tablespace temp default tablespace tbs_catalog quota unlimited on tbs_catalog;
User created.
SQL> grant connect,resource,recovery_catalog_owner to rman;
Grant succeeded.
SQL>
7:啟動rman
oracle@sphost admin]$rman
一定要注意:如果此處輸入rman後,一直沒有反應,那麼就執行如下命令:
[oracle@sphost admin]$ export PATH=$ORACLE_HOME/binPATH:.
[oracle@sphost admin]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Tue May 3 23:38:10 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN>
8:以使用者rman身份連線到恢復目錄所在的資料庫中
RMAN> connect catalog rman@ORA10HHA
recovery catalog database Password:
connected to recovery catalog database
RMAN>
當然,在這裡我的恢復目錄是已經建立好了的,如果還沒有建立的話,在執行這條命令後,顯示如下:
recovery catalog database Password:
connected to recovery catalog database
recovery catalog is not installed
9:因此要建立恢復目錄
在這裡一定要注意,建立的恢復目錄名一定要和剛建立的表空間名字一直,否則無效。如下:
RMAN> connect catalog rman@ORA10HHA
recovery catalog database Password:
connected to recovery catalog database
RMAN> create catalog tablespace tt;
ORACLE error from recovery catalog database: ORA-00959: tablespace 'TT' does not exist
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06433: error installing recovery catalog
RMAN> create catalog tablespace tbs_catalog;
recovery catalog created
RMAN> exit
10:測試恢復目錄是否建立成功。
[oracle@sphost ~]$ sqlplus sys/sysdba@ORA10HHA as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 3 22:48:23 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> connect rman@ORA10HHA
Enter password:
Connected.
SQL> set linesize 2000;
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------------------------------------
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
DFATT
TF
TFATT
TABLE_NAME
------------------------------------------------------------
OFFR
RR
RT
ORL
RLH
AL
BS
BP
BCF
CCF
XCF
TABLE_NAME
------------------------------------------------------------
BSF
BDF
CDF
XDF
BRL
BCB
CCB
SCR
SCRL
CONFIG
XAL
TABLE_NAME
------------------------------------------------------------
RSR
FB
ROUT
RCVER
37 rows selected.
如果這些表不存在,則表示恢復目錄沒有建立成功。
11.將資料庫註冊到恢復目錄
[oracle@catalog ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Tue May 3 21:23:52 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect target ora10; ////連線到源庫
target database Password:
connected to target database: ORA10HHA (DBID=3339398398)
RMAN> connect catalog rman@ORA10HHA ////連線到恢復目錄,感覺這邊隨意輸入任何密碼都是可以的
recovery catalog database Password:
connected to recovery catalog database
RMAN> register database; /// 把源資料庫的資訊註冊到恢復目錄中
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> exit
環境:
源庫:oracle10gr2 源OS:rhelas4 源sid=ora10 源庫ip=192.168.1.200
目標庫: oracle10gr2 目地OS:rhelas4 目的sid=ora10hha 目的庫ip=192.168.1.10
實驗目的:
要將源庫192.168.1.200 上的資料檔案、控制檔案以及日誌檔案備份到 目的庫192.168.1.10上,以便源庫出現問題時,可以透過
備份目錄恢復。
實驗準備:
1:在虛擬機器上安裝好兩個redhat系統,源庫ip=192.168.1.200,目的庫ip=192.168.1.10
並分別建立好兩個庫,一個ora10庫 , 一個orahha庫
同時關閉兩個redhat系統上的防火牆,確保這兩個OS都可以相互ping通
2:在目的庫(192.168.1.10)上透過圖形化介面執行netca命令,配置好監聽,配置好的listener.ora 如下
ora10hha =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))
)
)
3:在源庫(192.168.1.200)上透過圖形化介面執行netca命令,配置好tnsname.ora ,配置好的內容如下:
ORA10HHA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = ora10hha)
)
)
4:在源庫(192.168.1.200)上執行客戶端到伺服器端的連線是不是正常:
[oracle@sphost admin]$ tnsping ORA10HHA
TNS Ping Utility for Linux: Version 10.2.0.1.0 - Production on 03-MAY-2011 23:22:19
Copyright (c) 1997, 2005, Oracle. All rights reserved.
Used parameter files:
/home/oracle/10.2.0/network/admin/sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = ora10hha)))
OK (80 msec)
[oracle@sphost admin]$
ok,這樣就可以透過網路連線到目的庫上了。
5:在源庫(192.168.1.200)上執行
[oracle@sphost admin]$ sqlplus sys/sysdba@ORA10HHA as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 3 23:26:18 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL>
6:在源庫(192.168.1.200)上建立表空間,用於存放恢復目錄資料,
並建立使用者,該使用者是恢復目錄的擁有者;同時給使用者授予查詢、維護恢復目錄的許可權
SQL> create tablespace tbs_catalog datafile '/home/oracle/oradata/catalog.dbf' size 1G;
Tablespace created.
SQL> create user rman identified by rman temporary tablespace temp default tablespace tbs_catalog quota unlimited on tbs_catalog;
User created.
SQL> grant connect,resource,recovery_catalog_owner to rman;
Grant succeeded.
SQL>
7:啟動rman
oracle@sphost admin]$rman
一定要注意:如果此處輸入rman後,一直沒有反應,那麼就執行如下命令:
[oracle@sphost admin]$ export PATH=$ORACLE_HOME/binPATH:.
[oracle@sphost admin]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Tue May 3 23:38:10 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN>
8:以使用者rman身份連線到恢復目錄所在的資料庫中
RMAN> connect catalog rman@ORA10HHA
recovery catalog database Password:
connected to recovery catalog database
RMAN>
當然,在這裡我的恢復目錄是已經建立好了的,如果還沒有建立的話,在執行這條命令後,顯示如下:
recovery catalog database Password:
connected to recovery catalog database
recovery catalog is not installed
9:因此要建立恢復目錄
在這裡一定要注意,建立的恢復目錄名一定要和剛建立的表空間名字一直,否則無效。如下:
RMAN> connect catalog rman@ORA10HHA
recovery catalog database Password:
connected to recovery catalog database
RMAN> create catalog tablespace tt;
ORACLE error from recovery catalog database: ORA-00959: tablespace 'TT' does not exist
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-06433: error installing recovery catalog
RMAN> create catalog tablespace tbs_catalog;
recovery catalog created
RMAN> exit
10:測試恢復目錄是否建立成功。
[oracle@sphost ~]$ sqlplus sys/sysdba@ORA10HHA as sysdba
SQL*Plus: Release 10.2.0.1.0 - Production on Tue May 3 22:48:23 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> connect rman@ORA10HHA
Enter password:
Connected.
SQL> set linesize 2000;
SQL> select table_name from user_tables;
TABLE_NAME
------------------------------------------------------------
DB
NODE
CONF
DBINC
CKP
TS
TSATT
DF
DFATT
TF
TFATT
TABLE_NAME
------------------------------------------------------------
OFFR
RR
RT
ORL
RLH
AL
BS
BP
BCF
CCF
XCF
TABLE_NAME
------------------------------------------------------------
BSF
BDF
CDF
XDF
BRL
BCB
CCB
SCR
SCRL
CONFIG
XAL
TABLE_NAME
------------------------------------------------------------
RSR
FB
ROUT
RCVER
37 rows selected.
如果這些表不存在,則表示恢復目錄沒有建立成功。
11.將資料庫註冊到恢復目錄
[oracle@catalog ~]$ rman
Recovery Manager: Release 10.2.0.1.0 - Production on Tue May 3 21:23:52 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
RMAN> connect target ora10; ////連線到源庫
target database Password:
connected to target database: ORA10HHA (DBID=3339398398)
RMAN> connect catalog rman@ORA10HHA ////連線到恢復目錄,感覺這邊隨意輸入任何密碼都是可以的
recovery catalog database Password:
connected to recovery catalog database
RMAN> register database; /// 把源資料庫的資訊註冊到恢復目錄中
database registered in recovery catalog
starting full resync of recovery catalog
full resync complete
RMAN> exit
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28373936/viewspace-1722312/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 透過搭建恢復目錄實現RMAN異地備份和恢復
- RMAN恢復之RMAN-06555處理
- RMAN增量恢復
- Oracle 備份恢復篇之RMAN catalogOracle
- RMAN恢復實踐
- docker筆記47-ceph建立快照以及快照恢復Docker筆記
- rman 增量備份恢復
- Oracle RMAN恢復測試Oracle
- RMAN備份恢復技巧
- GO 筆記-目錄Go筆記
- mysql學習筆記之備份與恢復MySql筆記
- RMAN深入解析之--Incarnation應用(不完全恢復)
- ORACLE 11.2.0.4 RAC RMAN異機恢復之ORA-15001Oracle
- 查詢RMAN恢復進度
- Oracle RMAN 表空間恢復Oracle
- RMAN備份異機恢復
- RMAN備份恢復典型案例——異機恢復未知DBID
- RMAN備份恢復效能優化優化
- 在rman恢復中incarnation的概念
- RMAN備份與恢復測試
- RAC安裝目錄許可權快速恢復
- Oracle 目錄許可權丟失故障恢復Oracle
- 微信聊天記錄的恢復
- Spring學習筆記目錄Spring筆記
- 筆記本硬碟資料恢復筆記硬碟資料恢復
- ORACLE DG從庫 Rman備份恢復Oracle
- rman備份異機恢復(原創)
- RMAN備份恢復典型案例——RMAN備份&系統變慢
- 【RMAN】Oracle12c以後rman 備份恢復命令參考Oracle
- 【RMAN】在多租戶環境下的RMAN備份及恢復
- MySQL:Innodb恢復的學習筆記MySql筆記
- Oracle 12C新特性-RMAN恢復表Oracle
- 12 使用RMAN備份和恢復檔案
- RMAN備份恢復典型案例——ORA-00245
- 【RMAN】Oracle12c之後,rman備份Dataguard備端恢復可能出現邏輯錯誤Oracle
- [20190130]刪除tab$記錄的恢復.txt
- 伺服器資料恢復案例:FreeNAS資料恢復過程記錄伺服器資料恢復
- 【筆記】DP最佳化技巧目錄筆記
- centerOs根目錄盤擴容筆記ROS筆記