Create a physical standby database

xiaoxiao2021-03-06  75

Create a physical standby database

View some information from the primary database before creating a physical standby database and configure the main database.

Place the primary database to Force Logging mode. Do the following:

SQL> ALTABASE force Logging;

Confirm that the primary database is archived and defined locally archive. As follows:

SQL> ALTER SESTEM SET log_archive_dest_1 = 'location = E: / Oracle / ORADATA / ORCL / Archive Mandatory' Scope = Both;

At the primary node a confirms the location and file name of the data file of the primary database.

SQL> SELECT NAME FROM V $ datafile;

Name

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

E: /oracle/ora92/orcl/system01.dbf

E: /oracle/ora92/orcl/undotbs01.dbf

E: /oracle/ora92/orcl/cwmlite01.dbf

E: /oracle/ora92/orcl/drsys01.dbf

E: /oracle/ora92/orcl/example01.dbf

E: /oracle/ora92/orcl/indx01.dbf

E: /oracle/ora92/orcl/odm01.dbf

E: /oracle/ora92/orcl/tools01.dbf

E: /oracle/ora92/orcl/users01.dbf

E: /oracle/ora92/orcl/xdb01.dbf

Do the physical backup of the data file you have learned above. Back it to a temporary location.

SQL> Shutdown Immediate;

SQL> EXIT

Use the E: / ORACLE / ORA92 / ORCL entire directory COPY to the Oracle directory of the F disk of the Node.

Start the database after copying

SQL> Startup;

SQL> Archive Log List;

Create an alternate control file for the alternate database at the primary node A

SQL> ALTER DATABASE CREATE Standby ControlFile As 'f: /oracle/stdbycon.ctl';

Create an initialization parameter file

SQL> CREATE PFILE = 'f: /oracle/initstdbyorcl. Ora' from spfile;

The file obtained above will be copied from the primary node A to the standby node b.

After modifying and adding some parameters as follows:

* .aq_tm_processes = 1

* .BACKGROUND_DUMP_DEST = 'E: / Oracle / Admin / ORCL / BDUMP'

* .compatible = '9.2.0.0.0'

* .control_files = 'e: /oracle/ora92/standby/stdbycon.ctl', 'e: /oracle/ora92/standby/stdbycon02.ctl', 'E: /oracle/ora92/standby/stdbycon03.ctl'

* .CORE_DUMP_DEST = 'E: / Oracle / Admin / Standby / CDump'

* .db_block_size = 16384

* .db_cache_size = 137363456

* .db_domain = ''

* .db_file_multiblock_read_count = 16

* .db_name = 'orcl'

* .dispatchers = '(protocol = tcp) (service = orclxdb) "*. fast_start_mttr_target = 300

* .hash_join_ENABED = TRUE

* .instance_name = 'orcl2'

* .java_pool_size = 33554432

* .job_queue_processes = 10

* .lage_pool_size = 27262976

* .log_archive_dest_1 = 'location = E: / Oracle / ORADATA / StandBy / Archive Mandatory'

* .log_archive_format = 'log% d_% t_% s.arc'

* .log_archive_start = true

* .Open_cursors = 300

* .pga_aggregate_target = 80000000

* .processes = 150

* .query_rewrite_enabled = 'false'

* .remote_login_passwordfile = 'Exclusive'

* .shared_pool_size = 45088768

* .sort_area_size = 524288

* .SQL_TRACE = FALSE

* .STAR_TRANSFORMATION_ENABLED = 'false'

* .timed_statistics = true

* .undo_management = 'auto'

* .undo_retention = 10800

* .undo_tablespace = 'undotbs1'

* .user_dump_dest = 'E: / Oracle / Admin / Standby / UDUMP'

* .workarea_size_policy = 'auto'

* .standby_file_management = 'auto'

* .fal_server = 'orcl'

* .fal_client = 'orcl2'

* .standby_archive_dest = 'E: / Oracle / ORADATA / STANDBY / STDARCH'

* .utl_file_dir = 'e: / oracle'

* .remote_archive_enable = 'true'

Create a new instance at one end of the alternate database. The following:

C: /> ORADIM -NEW -SID ORCL2 -STARTMODE M

Put the copy of the copy to the E: / ORACLE / ORA92 and modify the folder named ORCL2

Modify the control file under E: / ORACLE / ORA92 / ORCL2, deleted the control01.ora, control02.ora, control03.ora, copy the f: /oracle/stdbycon01.ora file to E: / Oracle / ORA92 / ORCL2 directory. And copy and modify its named stdbycon02.ora, stdbycon03.ora

Create an ORCL2 folder under E: / Oracle / Admin, and build three folders under it, name BDump, CDump, UDUMP, respectively.

On the primary node a configuration listner.ora and tnsnames.ora, the file contents after the SQLNET.ORA configuration are as follows:

Listener.ora file is:

Listener =

(Description_List =

(Description_List = (Description =

(Address = (protocol = TCP) (Host = 10.100.0.122) (port = 1521)))

)

)

(Description_List =

(Description =

(Address = (protocol = ipc) (key = extproc1)))

)

)

)

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(SID_NAME = PLSEXTPROC)

(Oracle_Home = E: / Oracle / ORA92)

(Program = extproc)

)

(SID_DESC =

(Global_dbname = orcl)

(Oracle_Home = E: / Oracle / ORA92)

(SID_NAME = ORCL)

)

)

TNSNames.ora file is:

ORCL =

(Description =

(Address_list =

(Address = (protocol = TCP) (Host = 10.100.0.122) (port = 1521)))

)

(Connect_data =

(Server = DEDICATED)

(Service_name = orcl)

)

)

STANDBY =

(Description =

(Address_list =

(Address = (protocol = TCP) (Host = 10.100.0.22) (port = 1521)))

)

(Connect_data =

(Server = DEDICATED)

(Service_name = orcl)

)

)

EXTPROC_CONNECTION_DATA =

(Description =

(Address_list =

(Address = (protocol = ipc) (key = extproc1)))

)

(Connect_data =

(SID = PLSEXTPROC)

(Presentation = RO)

)

)

SQLNET.ORA file is:

SQLNET.AUTHENTICATION_SERVICES = (NTS)

Names.directory_path = (Hostname, TNSNames, Onames)

After the spare Node B is configured, Listner.ora and Tnsnames.ora, SQLNET.ORA configuration After the file content is as follows:

Where parameter SQLNET.EXPIRE_TIME in the SQLNET.Or file is Enable Dead Connection Detection

Listener.ora file is:

Listener =

(Description_List =

(Description =

(Address_list =

(Address = (protocol = IPC) (key = extproc))

)

(Address_list =

(Address = (protocol = TCP) (Host = 10.100.0.22) (port = 1521)))

)

)

)

SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(Global_dbname = orcl2)

(Oracle_Home = E: / Oracle / ORA92) (SID_NAME = ORCL)

)

(SID_DESC =

(Program = extproc)

(SID_NAME = PLSEXTPROC)

(Oracle_Home = E: / Oracle / ORA92)

)

)

TNSNames.ora file is:

ORCL =

(Description =

(Address_list =

(Address = (protocol = TCP) (Host = 10.100.0.122) (port = 1521)))

)

(Connect_data =

(Server = DEDICATED)

(Service_name = orcl)

)

)

STANDBY =

(Description =

(Address_list =

(Address = (protocol = TCP) (Host = 10.100.0.22) (port = 1521)))

)

(Connect_data =

(Server = DEDICATED)

(Service_name = orcl)

)

)

EXTPROC_CONNECTION_DATA =

(Description =

(Address_list =

(Address = (protocol = IPC) (key = extproc0)))

)

(Connect_data =

(SID = PLSEXTPROC)

(Presentation = RO)

)

)

SQLNET.ORA file is:

SQLNET.AUTHENTICATION_SERVICES = (NTS)

Names.directory_path = (Hostname, TNSNames, Onames)

SQLNET.EXPIRE_TIME = 2

Create a Server Parameter file for the standby database

Create SPFile from Pfile;

Start the standby database for mount status

SQL> Startup Nomout

SQL> ALTER DATABASE MOUNT Standby Database;

Initial Log Apply Services

SQL> ALTABASE Recover Managed Standby Database Disconnect from Session;

Set the remote archive directory at the primary node:

SQL> ALTER SESTEM SET LOG_ARCHIVE_DEST_2 = 'Service = Standby' Scope = Both;

SQL> ALTER System Set Log_archive_dest_state_2 = enable scope = Both;

Start remote archiving:

SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

Confirm that the remote archive is successful:

SQL> SELECT SEQUENCE #, First_TIME, Next_TIME

2 from v $ archived_log order by sequence #;

Sequence # first_TIME NEXT_TIME

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

8 11-jul-02 17:50:45 11-jul-02 17:50:53

9 11-jul-02 17:50:53 11-jul-02 17:50:58

10 11-JUL-02 17:50:58 11-JUL-02 17: 51: 033 rows selected.

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

New Post(0)