国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 數(shù)據(jù)庫(kù) > Oracle > 正文

Oracle 10g使用RMAN創(chuàng)建physical standby

2024-08-29 13:53:13
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

1.試驗(yàn)環(huán)境

SQL> select * from v$version;


BANNER

----------------------------------------------------------------

Oracle Database 10g EnterPRise Edition Release 10.2.0.1.0 - Prod

PL/SQL Release 10.2.0.1.0 - Production

CORE 10.2.0.1.0 Production

TNS for linux: Version 10.2.0.1.0 - Production

NLSRTL Version 10.2.0.1.0 - Production

 

2.確認(rèn)主庫(kù)處于歸檔模式

SQL> archive log list;

Database log mode Archive Mode

Automatic archival Enabled

Archive destination /u02/arch

Oldest online log sequence 154

Next log sequence to archive 156

Current log sequence 156

 

3.創(chuàng)建備庫(kù)instance

windows平臺(tái)利用oradim工具創(chuàng)建一個(gè)新的instance,

unix/linux平臺(tái)設(shè)置新的ORACLE_SID即可

 


4.準(zhǔn)備好主備庫(kù)的參數(shù)文件

主庫(kù):

orcl.__db_cache_size=184549376

orcl.__java_pool_size=4194304

orcl.__large_pool_size=4194304

orcl.__shared_pool_size=88080384

orcl.__streams_pool_size=0

*.audit_file_dest='/u01/oracle/admin/orcl/adump'

*.background_dump_dest='/u01/oracle/admin/orcl/bdump'

*.compatible='10.2.0.1.0'

*.control_files='/u01/oracle/oradata/orcl/control01.ctl','

/u01/oracle/oradata/orcl/control02.ctl','

/u01/oracle/oradata/orcl/control03.ctl'

*.core_dump_dest='/u01/oracle/admin/orcl/cdump'

*.db_block_size=8192

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='orcl'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.job_queue_processes=10

*.log_archive_dest_1='LOCATION=/u02/arch'

*.log_archive_format='%t_%s_%r.dbf'

*.nls_language='SIMPLIFIED CHINESE'

*.nls_territory='CHINA'

*.open_cursors=300

*.pga_aggregate_target=94371840

*.processes=150

*.remote_login_passWordfile='EXCLUSIVE'

*.sga_target=285212672

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='/u01/oracle/admin/orcl/udump'

#################################

db_unique_name=node1

service_names=orcl

log_archive_config='dg_config=(node1,node2)'

log_archive_dest_2='service=dbstandby

valid_for=(online_logfiles,primary_role) db_unique_name=node2'

log_archive_dest_state_1=enable

log_archive_dest_state_2=enable

fal_server=dbstandby

standby_file_management=AUTO

 

備庫(kù):

orcl.__db_cache_size=184549376

orcl.__java_pool_size=4194304

orcl.__large_pool_size=4194304

orcl.__shared_pool_size=88080384

orcl.__streams_pool_size=0

*.audit_file_dest='/u01/oracle/admin/orcl/adump'

*.background_dump_dest='/u01/oracle/admin/orcl/bdump'

*.compatible='10.2.0.1.0'

*.control_files='/u01/oracle/oradata/orcl/control01.ctl','

/u01/oracle/oradata/orcl/control02.ctl','

/u01/oracle/oradata/orcl/control03.ctl'

*.core_dump_dest='/u01/oracle/admin/orcl/cdump'

*.db_block_size=8192

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='orcl'

*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'

*.job_queue_processes=10

*.log_archive_dest_1='LOCATION=/u02/arch'

*.log_archive_format='%t_%s_%r.dbf'

*.nls_language='SIMPLIFIED CHINESE'

*.nls_territory='CHINA'

*.open_cursors=300

*.pga_aggregate_target=94371840

*.processes=150

*.remote_login_passwordfile='EXCLUSIVE'

*.sga_target=285212672

*.undo_management='AUTO'

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='/u01/oracle/admin/orcl/udump'

#################################

db_unique_name=node2

service_names=orcl

log_archive_config='dg_config=(node1,node2)'

log_archive_dest_2='service=dbprimary

valid_for=(online_logfiles,primary_role) db_unique_name=node1'

log_archive_dest_state_1=enable

log_archive_dest_state_2=enable

fal_server=dbprimary

fal_client=dbstandby

standby_file_management=AUTO

 

5.生成password file

c:/>orapwd file=d:/oracle/ora92/DATABASE/PWDtest.ORA password=pass

或者直接將主庫(kù)上的密碼文件copy一份到備庫(kù)上

 

6.配置網(wǎng)絡(luò)

配置主備庫(kù)的listener.ora,tnsnames.ora。修改完listener.ora后需要重啟監(jiān)聽(tīng)器。


主庫(kù):


listener.ora


SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSExtProc)

(ORACLE_HOME = /u01/oracle/product/10.2.0)

(PROGRAM = extproc)

)

)


LISTENER =

(DESCRipTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = s1.gti.com)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

)

 

tnsnames.ora


dbprimary =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)


dbstandby =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)

 

備庫(kù):


listener.ora


SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = orcl)

(ORACLE_HOME = /u01/oracle/product/10.2.0)

)

)


LISTENER =

(DESCRIPTION_LIST =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))

(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))

)

)


tnsnames.ora


dbprimary =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.131)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)


dbstandby =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.132)(PORT = 1521))

)

(CONNECT_DATA =

(SERVICE_NAME = orcl)

)

)


7.使用rman備份主庫(kù)


[oracle@s1 ~]$ rman target /


Recovery Manager: Release 10.2.0.1.0 - Production on Thu May 29 19:52:37 2008


Copyright (c) 1982, 2005, Oracle. All rights reserved.


connected to target database: ORCL (DBID=1171867028)


RMAN> backup full format='/u02/db_%U'

database include current controlfile for standby;


...................

 


8.歸檔主庫(kù)當(dāng)前日志

SQL> alter system archive log current;

System altered.

 

9.啟動(dòng)備庫(kù)到nomount

sqlplus "/ as sysdba"

Connected to an idle instance.

SQL> startup nomount


Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 96470608 bytes

Database Buffers 184549376 bytes

Redo Buffers 2973696 bytes

 

10.利用rman恢復(fù)備庫(kù)

[oracle@s1 ~]$ rman target /


Recovery Manager: Release 10.2.0.1.0 - Production on Thu May 29 19:53:21 2008


Copyright (c) 1982, 2005, Oracle. All rights reserved.


connected to target database: ORCL (DBID=1171867028)


RMAN> connect auxiliary sys/a@dbstandby


connected to auxiliary database: ORCL (DBID=1171867028, not mount)


RMAN> duplicate target database for standby nofilenamecheck;


.............................

 

如果第8步?jīng)]有歸檔當(dāng)前日志,duplicate時(shí)可能出現(xiàn)錯(cuò)誤:

RMAN-05507: standby controlfile checkpoint (710256) is more recent than duplicat

ion point in time (709530)

 

至此,備庫(kù)創(chuàng)建成功。

 

11.將備庫(kù)置于自動(dòng)恢復(fù)狀態(tài)

SQL> conn / as sysdba

Connected.

SQL>alter database recover managed standby database disconnect from session;

Media recovery complete.

 

12.switchover


物理STANDBY的SWITCHOVER切換會(huì)把當(dāng)前的一個(gè)物理STANDBY切換為PRIMARY數(shù)據(jù)庫(kù),而PRIMARY數(shù)據(jù)庫(kù)且變成物理STNADBY數(shù)據(jù)庫(kù)。


一般SWITCHOVER切換都是計(jì)劃中的切換,特點(diǎn)是在切換后,不會(huì)丟失任何的數(shù)據(jù),而且這個(gè)過(guò)程是可逆的,整個(gè)DATA GUARD環(huán)境不會(huì)被破壞,原來(lái)DATA GUARD環(huán)境中的所有物理和邏輯STANDBY都可以繼續(xù)工作。


在進(jìn)行DATA GUARD的物理STANDBY切換前需要注意:


確認(rèn)主庫(kù)和從庫(kù)間網(wǎng)絡(luò)連接通暢;


確認(rèn)沒(méi)有活動(dòng)的會(huì)話連接在數(shù)據(jù)庫(kù)中;


PRIMARY數(shù)據(jù)庫(kù)處于打開(kāi)的狀態(tài),STANDBY數(shù)據(jù)庫(kù)處于MOUNT狀態(tài);


確保STANDBY數(shù)據(jù)庫(kù)處于ARCHIVELOG模式;


如果設(shè)置了REDO應(yīng)用的延遲,那么將這個(gè)設(shè)置去掉;


確保配置了主庫(kù)和從庫(kù)的初始化參數(shù),使得切換完成后,DATA GUARD機(jī)制可以順利的運(yùn)行。

 

主庫(kù):


[oracle@s1 ~]$ sqlplus "/ as sysdba"


SQL*Plus: Release 10.2.0.1.0 - Production on Thu May 29 19:55:02 2008


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> alter database commit to switchover to physical standby;


Database altered.


SQL> shutdown immediate;

ORA-01507: database not mounted

 

ORACLE instance shut down.

SQL> startup nomount

ORACLE instance started.


Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 96470608 bytes

Database Buffers 184549376 bytes

Redo Buffers 2973696 bytes

SQL> alter database mount standby database;


Database altered.


SQL> alter database recover managed standby database disconnect from session;


Database altered.

 

備庫(kù):


SQL> alter database commit to switchover to primary;


Database altered.


SQL> shutdown immediate;

ORA-01109: database not open

 

Database dismounted.

ORACLE instance shut down.

SQL> startup

ORACLE instance started.


Total System Global Area 285212672 bytes

Fixed Size 1218992 bytes

Variable Size 96470608 bytes

Database Buffers 184549376 bytes

Redo Buffers 2973696 bytes

Database mounted.

Database opened.

SQL>


至此完成自由切換。


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 宁晋县| 张家港市| 丘北县| 集贤县| 长丰县| 新晃| 乌兰察布市| 凯里市| 綦江县| 依兰县| 克什克腾旗| 额尔古纳市| 黔南| 宜黄县| 安宁市| 湖州市| 措勤县| 万全县| 常山县| 英山县| 自治县| 乡宁县| 额尔古纳市| 团风县| 太仆寺旗| 巴塘县| 衡东县| 黄浦区| 额济纳旗| 宜宾县| 龙海市| 金堂县| 安阳市| 荥经县| 叶城县| 宜昌市| 华坪县| 灵台县| 巫山县| 南郑县| 介休市|