Create a physical Oracle9i StandBy database on a single machine

zhaozj2021-02-16  46

Description; the Data Guard features of the Oracle9i database ensure that the data is completely protected, one of the key features of Oracle 9i. Data Guard can create a physical StandBy database or create logical StandBy databases, and it is also possible to mix, and the flexibility is stronger. This document is a thing that is still in the Fenng exercise, and I can't talk about what is the experience. * This is just a notes during the installation process. System environment: Windows 2000 Professional SP3 512M memory

Existing DB Speed ​​Name: DEMO Pre-created StandBy Database Instance Name: PStandby

Database version information:

SQL> SELECT * FROM V $ VERSION;

Banner ------------------------------------- --------------- Oracle9i Enterprise Edition Release 9.2.0.1.0 - ProductionPL / SQL Release 9.2.0.1.0 - ProductionCore 9.2.0.1.0 ProductionTns for 32-Bit Windows: Version 9.2 .0.1.0 - Productionnlsrtl Version 9.2.0.1.0 - Production

Preparations First make sure Primary database SQL in archive mode> show userUSER is "SYS" SQL> SQL> archive log listDatabase log mode Archive ModeAutomatic archival EnabledArchive destination d: / oracle / oradata / demo / archiveOldest online log sequence 42Next log sequence to Archive 44current Log Sequence 44

If it is not in archive mode, adjust the database. First submit the command to modify the spfile:

SQL> ALTER SESTEM SET LOG_ARCHIVE_START = TRUE Scope = SPFILE;

Then close the database instance SQL> Shutdown

backup database

SQL> Startup Mount

SQL> ALTER DATABASE ArchiveLog; SQL> ALTER DATABASE OPEN;

SQL> ShutDown Immediate Backup

1. Primary Database needs to do prepared:

1.1 activation forced logging

SQL> ALTABASE force Logging;

1.2 Set the local archive target

SQL> ALTER SESTEM SET LOG_ARCHIVE_DEST_1 = 'Location = D: / Oracle / ORADATA / DEMO / Archive' Scope = Both; This operation directly takes effect

2. Create a physical STANDBY database

2.1 Marking the data file of the Primary database

SQL> SELECT NAME FROM V $ datafile;

Name ------------------------------------- ---- D: /oracle/oradata/demo/system01.dbfd: /oracle/oradata/demo/undotbs01.dbfd: /oracle/oradata/demo/cwmlite01.dbfd: /oracle/oradata/demo/drsys01.dbfd: / Oracle/oradata/demo/example01.dbfd:/oracle/oradata/demo/indx01.dbfd:/oRacle/oradata/temo/odm01.dbfd:/oracle/oradata/demo/tools01.dbfd:/oracle/Ordata/demo /Users01.dbfd:/oracle/oradata/demo/xdb01.dbfd:/oracle/oradata/demo/oem_repository.dbf

11 rows selected.

SQL>

2.2 Close Instance Copy Data Files to the Ordinary Destination

SQL> Shutdown Immediate;

2.3 Creating a Control File for the StandBy Database

SQL> Alter Database Create Standby ControlFile As 'c: /dataguard/pstandby/demo/demostandby.ctl';

To pay attention to this control file, don't repeat the name of Primary's control file.

2.4 Prepare the initialization parameter file name for the StandBy database:

SQL> CREATE PFILE = 'C: / DataGuard / PStandby / Demo / Initpstandby' from spfile;

2.5 Setting initialization Physical Standby Database parameters

* .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 / DEM O / udump'lock_name_space = pstandbystandby_file_management = AUTOremote_archive_enable = TRUEstandby_archive_dest = 'C: / DataGuard / Pstandby / DEMO / Archive' db_file_name_convert = ( 'D: / oracle / oradata / DEMO', 'C: / DataGuard / Pstandby / DEMO /') LOG_FILE_NAME_CONVERT = ('D: / ORADATA / DEMO', 'C: / DataGuard / PStandby / Demo /') LOG_ARCHIVE_DEST_1 = ('location = C: / DataGuard / PStandby / Demo / Archive')

Each operation is often concentrated here. This file must be taken carefully carefully. Places marked as black is to modify. 2.6 Creating a Windows service

Winnt> ORADIM -NEW -SID PStandby -startMode Manual

2.7 Create a Server Parameter File for the Standby Database

Refer to the following: c: /> set oracle_sid = pstandbyc: /> sqlplus / nologsql> Connect / as sysdbasql> create spfile from pfile = 'c: /DataGuard/pstandby/demo/initpstandby.ora';

2.8 Start the physical StandBy database

C: /> set oracle_sid = pstandbyc: /> sqlplus / nologsql> connect / as sysdbasql> Startup Nomount; SQL> ALTER DATABASE MOUNT Standby Database;

2.9 On the Standby database, initialize the Log Apply service:

SQL> ALTABASE Recover Managed Standby Database Disconnect from Session;

2.10 Activate the archive of the physical STANDBY database

SQL> ALTER SESTEM SET LOG_ARCHIVE_DEST_2 = 'Service = PStandby' Scope = Both; SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2 = Enable Scope = Both;

2.11 Launching Remote Archive

SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

3. Finished verification:

3.1 In Database, query V $ archived_log (actually directly to the relevant directory to see if it is created):

SQL> SELECT SEQUENCE #, first_time, next_time 2 from v $ archived_log order by sequence #;

Sequence # first_time next_time ---------------------------- 38 23-7? -02 23-7? -02 39 23- 7? -02 23-7? -02 40 23-7? -02 41 23-7? -02 23-7? -02 42 23-7? -02 23-7? -02

3.2 On the primary database, archive the current log

SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

3.3 Verification is received:

SQL> SELECT SEQUENCE #, first_time, next_time 2> from v $ archived_log order by sequence #;

Sequence # first_time next_time ---------------------------- 38 23-7? -02 23-7? -02 39 23- 7? -02 23-7? -02 40 23-7? -02 41 23-7? -02 23-7? -02 42 23-7? -02 23-7? -02 43 23-7? -02 23-7? -023.4 Verify that the new archive Redo log has been applied:

SQL> SELECT SEQUENCE #, Applied from V $ Archived_log 2 Order by Sequence #;

Sequence # app ---------- --- 38 Yes 39 Yes 40 Yes 41 Yes 42 Yes 43 YES

Ok. Indicates that we are still successful. Temporarily report a paragraph.

Reference documentation

Oracle Data Guard Concepts And AdministrationRelease 2 (9.2) Part Number A96653-02

Additional content:

PFILE of the primary database:

* .aq_tm_processes = 1 * .Background_dump_dest = 'd: / oracle / admin / demo / bdump' *. compatible = '9.2.0.0' *. contract_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_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_ena .. Bled = 'TRUE' * timed_statistics = TRUE * .undo_management = 'AUTO' * undo_retention = 10800 * .undo_tablespace = 'UNDOTBS1' * user_dump_dest =. 'D: / oracle / admin / DEMO / udump' may be created in the process of Error: Will

转载请注明原文地址:https://www.9cbs.com/read-27589.html

New Post(0)