您的位置:首页 > 其它

DataGuard的创建步骤

2007-04-12 17:27 148 查看
单机Oracle 9i Data Guard的创建步骤:

要求:

Winxp 上已经存在数据库ice,Instance ice(主库),希望创建Instance snow(备库),将snow作为Instance ice的Data Guard。

一、主库为备库作的一些准备工作:
1、 将主库设置为强制Logging。
Alter database force logging;

2、 设置主库为归档模式。
Alter system set log_archive_start = true scope = both;

Alter system set log_archive_format = ‘LOG%t%s.arc’ scope = both;

Alter system set log_archive_dest_1 = ‘Location = d:/ora90/oradata/ice/archive/’ scope = both;

Shutdown immediate

Startup

Archive log list; ——确认一下。

二、冷备主库。
1、 Shutdown immediate
2、 Cope 所有数据文件到D:/ora90/oradata/snow/目录下。
三、在主库上为备库创建Standby Controlfile。
1、 重起DB。
2、 Alter database create standby controlfile as ‘d:/ora90/oradata/snow/control.ctl’;
四、在主库上为备库创建Standby pfile。
1、 Create pfile = ‘d:/ora90/admin/snow/pfile/init.ora’ from spfile;
五、修改Standby pfile。

主要参数修改如下:

*.LOG_ARCHIVE_DEST='d:/ora90/oradata/snow/archive/'

*.LOG_ARCHIVE_FORMAT='LOG%s_%t.ARC'

*.LOG_ARCHIVE_START=TRUE

*.background_dump_dest='D:/ora90/admin/snow/bdump'

*.compatible='9.2.0.0.0'

*.control_files='d:/ora90/oradata/snow/control.ctl'

*.core_dump_dest='D:/ora90/admin/snow/cdump'

*.db_block_size=8192

*.db_cache_size=36700160

*.db_domain=''

*.db_file_multiblock_read_count=16

*.db_name='ice'

*.fast_start_mttr_target=300

*.hash_join_enabled=TRUE

*.instance_name='snow'

*.java_pool_size=0

*.large_pool_size=8388608

*.log_checkpoints_to_alert=TRUE

*.open_cursors=300

*.pga_aggregate_target=25165824

*.processes=150

*.query_rewrite_enabled='FALSE'

*.remote_login_passwordfile='EXCLUSIVE'

*.shared_pool_size=50331648

*.sort_area_size=524288

*.star_transformation_enabled='FALSE'

*.timed_statistics=TRUE

*.transactions_per_rollback_segment=5

*.undo_management='AUTO'

*.undo_retention=10800

*.undo_tablespace='UNDO'

*.user_dump_dest='D:/ora90/admin/snow/udump'

再增加几个参数:

*.standby_archive_dest='d:/ora90/oradata/snow/standbylog/'
*.fal_server='ice'
*.fal_client='snow'
*.standby_file_management='AUTO'
*.lock_name_space='snow'


*.remote_archive_enable=true

*.log_file_name_convert=('d:/ora90/oradata/ice/archive/', 'd:/ora90/oradata/snow/archive/')

*.db_file_name_convert=('d:/ora90/oradata/ice/', 'd:/ora90/oradata/snow/')

相关参数作用说明如下:

· db_name - Not modified. The same name as the primary database.
· compatible - Not modified. The same as the primary database, 9.2.0.1.0.
· control_files - Specify the path name and filename for the standby control file.
· log_archive_start - Not modified. The same as the setting for the primary database, TRUE.
· standby_archive_dest - Specify the location of the archived redo logs that will be received from the primary database.
· db_file_name_convert - Specify the location of the primary database datafiles followed by the standby location of the datafiles. This parameter will convert the filename of the primary database datafiles to the filename of the standby datafile filenames. If the standby database is on the same system as the primary database or if the directory structure where the datafiles are located on the standby site is different from the primary site then this parameter is required.
· log_file_name_convert - Specify the location of the primary database logs followed by the standby location of the logs. This parameter will convert the filename of the primary database log to the filenames of the standby log. If the standby database is on the same system as the primary database or if the directory structure where the logs are located on the standby site is different from the primary site then this parameter is required.

九、配置tnsname文件。

在原文件上加上:
snow =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = ORASKY)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = snow)
)
)
十、测试。
先重起Linstener,再通过tnsping snow来测试。

Microsoft Windows XP [版本 5.1.2600]
(C) 版权所有 1985-2001 Microsoft Corp.
C:/Documents and Settings/Administrator>lsnrctl
LSNRCTL for 32-bit Windows: Version 9.2.0.1.0 - Production on 15-12月-2005 16:28
:29
Copyright (c) 1991, 2002, Oracle Corporation. All rights reserved.
欢迎来到LSNRCTL,请键入"help"以获得信息。
LSNRCTL> stop
正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
命令执行成功
LSNRCTL> start
启动tnslsnr:请稍候...
TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Production
系统参数文件为D:/ora90/network/admin/listener.ora
写入D:/ora90/network/log/listener.log的日志信息
监听:(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=//./pipe/EXTPROC2ipc)))
监听:(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORASKY)(PORT=1521)))

正在连接到 (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC2)))
LISTENER 的 STATUS
------------------------
别名 LISTENER
版本 TNSLSNR for 32-bit Windows: Version 9.2.0.1.0 - Produc
tion
启动日期 15-12月-2005 16:28:35
正常运行时间 0 天 0 小时 0 分 2 秒
跟踪级别 off
安全性 OFF
SNMP OFF
监听器参数文件 D:/ora90/network/admin/listener.ora
监听器日志文件 D:/ora90/network/log/listener.log
监听端点概要...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=//./pipe/EXTPROC2ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ORASKY)(PORT=1521)))
服务摘要..
服务 "PLSExtProc" 包含 1 个例程。
例程 "PLSExtProc", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "ice" 包含 1 个例程。
例程 "ice", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "kingping" 包含 1 个例程。
例程 "kingping", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
服务 "snow" 包含 1 个例程。
例程 "snow", 状态 UNKNOWN, 包含此服务的 1 个处理程序...
命令执行成功
LSNRCTL> exit
C:/Documents and Settings/Administrator>tnsping snow
TNS Ping Utility for 32-bit Windows: Version 9.2.0.1.0 - Production on 15-12月-2
005 16:28:52
Copyright (c) 1997 Oracle Corporation. All rights reserved.
已使用的参数文件:
D:/ora90/network/admin/sqlnet.ora
已使用 TNSNAMES 适配器来解析别名
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: