快捷搜索:  as  2018  FtCWSyGV  С˵  test  xxx  Ψһ  w3viyKQx

澳门新葡亰平台游戏app:在单机上创建物理的Oracle9i standby数据库(1)Oracle9i



阐明;Oracle9i数据库的Data Guard 特点确保对数据进行完备的保护,是Oracle 9i的一个关键特点之一.Data Guard可以创建物理的Standby数据库,也可以创建逻辑的Standby数据库,还可以混杂应用,机动性对照强.这个文档是Fenng演习时刻记下来的器械,谈不上是什么心得.*这不过是一份安装历程中的条记而已* 假如对这个有更高的期望,或者想获得关于Oracle数据库的data guard 和Standby的更多信息,请参考官方的文档.

系统情况:Windows 2000 专业版 SP3 512M 内存

现有的数据库实例(Primary)名字:Demo

预创建的Standby 数据库实例名字:Pstandby

数据库版本信息:

SQL> select * from v$version;

BANNER

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

Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production

PL/SQL Release 9.2.0.1.0 - Production

CORE 9.2.0.1.0 Production

TNS for 32-bit Windows: Version 9.2.0.1.0 - Production

NLSRTL Version 9.2.0.1.0 - Production

筹备事情

首先确认Primary数据库是否在归档模式下

SQL> show user

USER is "SYS"

SQL>

SQL> archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination d:\oracle\oradata\demo\archive

Oldest online log sequence 42

Next log sequence to archive 44

Current log sequence 44

假如不在归档模式下,调剂数据库。

首先提交敕令改动SPfile:

SQL>alter system set LOG_ARCHIVE_START=TRUE scope=spfile;

然后关闭数据库实例

SQL>SHUTDOWN

备份数据库

SQL>STARTUP MOUNT

SQL>ALTER DATABASE ARCHIVELOG;

SQL>ALTER DATABASE OPEN;

SQL>SHUTDOWN IMMEDIATE

备份

1. Primary Database 必要做的筹备事情:

1.1 澳门新葡亰平台游戏app激活 Forced Logging

SQL> ALTER DATABASE FORCE LOGGING;

1.2 设置本地归档目标

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=D:\oracle\oradata\DEMO\Archive' SCOPE=BOTH;

此操作直接生效

2.创建物理的Standby数据库

2.1 标记出Primary数据库的数据文件

SQL> select name from v$datafile;

NAME

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

D:\ORACLE\ORADATA\DEMO\SYSTEM01.DBF

D:\ORACLE\ORADATA\DEMO\UNDOTBS01.DBF

D:\ORACLE\ORADATA\DEMO\CWMLITE01.DBF

D:\ORACLE\ORADATA\DEMO\DRSYS01.DBF

D:\ORACLE\ORADATA\DEMO\EXAMPLE01.DBF

D:\ORACLE\ORADATA\DEMO\INDX01.DBF

D:\ORACLE\ORADATA\DEMO\ODM01.DBF

D:\ORACLE\ORADATA\DEMO\TOOLS01.DBF

D:\ORACLE\ORADATA\DEMO\USERS01.DBF

D:\ORACLE\ORADATA\DEMO\XDB01.DBF

D:\ORACLE\ORADATA\DEMO\OEM_REPOSITORY.DBF

11 rows selected.

SQL>

2.2 关闭Instance 拷贝数据文件到既定目的地

SQL> SHUTDOWN IMMEDIATE;

2.3 为Standby 数据库创建节制文件

SQL> ALT澳门新葡亰平台游戏appER DATABASE CREATE STANDBY CONTROLFILE

AS 'C:\DataGuard\Pstandby\DEMO\DEMOSTA澳门新葡亰平台游戏appNDBY.CTL';

*.timed_statistics=TRUE

*.undo_management='AUTO'

*.undo_retention=10800

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='D:\oracle\admin\DEMO\udump'

lock_name_space=pstandby

standby_file_management=AUTO

remote_archive_enable=TRUE

standby_archive_dest='C:\DataGuard\Pstand澳门新葡亰平台游戏appby\DEMO\Archive'

db_file_name_convert=('D:\oracle\oradata\DEMO', 'C:\DataGuard\Pstandby\DEMO\')

log_file_name_convert=('D:\oracle\oradata\DEMO', 'C:\DataGuard\Pstandby\DEMO\')

log_archive_dest_1=('LOCATION=C:\DataGuard\Pstandby\DEMO\Archive')

全部操作的历程中,轻易呈现差错的地方险些都集中在此处。必须卖力仔细的对待这个文件。标记为玄色的地方是必要进行改动的。

2.6 创建一个Windows办事

WINNT> oradim -NEW -SID Pstandby -STARTMODE manual

2.7 Create a Server Parameter File for the Standby Database

可参考履行如下操作:

C:\>set oracle_sid=pstandby

C:\>sqlplus /nolog

SQL> connect / as sysdba

SQL> CREATE SPFILE FROM PFILE='C:\DataGuard\Pstandby\DEMO\initPstandby.ora';

2.8 启动物理Standby数据库

C:\>set oracle_sid=pstandby

C:\>sqlplus /nolog

SQL> connect / as sysdba

SQL> STARTUP NOMOUNT;

SQL> ALTER DATABASE MOUNT STANDBY DATABASE;

2.9 在Standby数据库上,初始化Log Apply 办事:

SEQUENCE# APP

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

38 YES

39 YES

40 YES

41 YES

42 YES

43 YES

OK.注解我们照样成功的。暂时告一段落。

参考文档

Oracle Data Guard Concepts and Administration

Release 2 (9.2)

Part Number A96653-02

附加内容:

primary数据库的Pfile内容:

*.aq_tm_processes=1

*.background_dump_dest='D:\oracle\admin\DEMO\bdump'

*.compatible='9.2.0.0.0'

*.control_files='D:\oracle\oradata\DEMO\CONTROL01.CTL',

'D:\oracle\oradata\DEMO\CONTROL02.CTL','D:\oracle\oradata\DEMO\CONTROL03.CTL'

*.core_dump_dest='D:\oracle\admin\DEMO\cdump'

*.db_block_size=8192

*.db_cache_size=19922944

*.db_domain=''

*.db_file_multiblock_read_count=32

*.db_name='DEMO'

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

*.fast_start_mttr_target=300

*.hash_area_size=1048576

*.hash_join_enabled=TRUE

*.instance_name='DEMO'

*.java_pool_size=20971520

*.job_queue_processes=10

*.large_pool_size=7340032

*.log_archive_dest_1='location=d:\oracle\oradata\demo\archive'

*.log_archive_dest_2='SERVICE=PSTANDBY'

*.log_archive_dest_state_2='ENABLE'

*.log_archive_start=TRUE

*.open_cursors=300

*.optimizer_mode='FIRST_ROW澳门新葡亰平台游戏appS'

*.pga_aggregate_target=17825792

*.processes=150

*.query_rewrite_enabled='TRUE'

*.remote_login_passwordfile='EXCLUSIVE'

*.shared_pool_size=33554432

*.sort_area_size=1048576

*.star_transformation_enabled='TRUE'

*.timed_statistics=TRUE

*.undo_management='AUTO'

*.undo_retention=10800

*.undo_tablespace='UNDOTBS1'

*.user_dump_dest='D:\oracle\admin\DEMO\udump'

创建历程中的可能的差错:待续

您可能还会对下面的文章感兴趣: