说明:Oracle9i数据库的Data Guard 特性确保对数据进行完整的保护,是Oracle 9i的一个关键特性之一。Data Guard可以创建物理的Standby数据库,也可以创建逻辑的Standby数据库,还可以混合使用,灵活性比较强。
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> ALTER DATABASE CREATE STANDBY CONTROLFILE
AS 'C:\DataGuard\Pstandby\DEMO\DEMOSTANDBY.CTL'; |
要注意这个控制文件的名字不要和Primary的控制文件名字重复。
2.4 为Standby数据库准备初始化参数文件名字:
SQL> CREATE PFILE='C:\DataGuard\Pstandby\DEMO\initpstandby' FROM SPFILE;
2.5 设定初始化Physical Standby Database参数:
*.aq_tm_processes=1
*.background_dump_dest='
D:\oracle\admin\DEMO\bdump'
*.compatible='9.2.0.0.0'
*.control_files='
C:\DataGuard\Pstandby\DEMO\DEMOSTANDBY.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='pstandby'
*.java_pool_size=20971520
*.job_queue_processes=10
*.large_pool_size=7340032
*.log_archive_dest_1='
location=d:\oracle\oradata\demo\archive'
*.log_archive_start=TRUE
*.open_cursors=300
*.optimizer_mode='FIRST_ROWS'
*.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'
lock_name_space=pstandby
standby_file_management=AUTO
remote_archive_enable=TRUE
standby_archive_dest='
C:\DataGuard\Pstandby\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') |
整个操作的过程中,容易出现错误的地方几乎都集中在此处。必须认真仔细的对待这个文件。标记为黑色的地方是需要进行修改的。