Create a Standby Database step under 9i

xiaoxiao2021-03-06  78

9i Create Standby Database Step (ZZ) Last Edited by Sail On 2004-7-8 AT 10:57 Recently, the Data Guard under Oracle 9i is tested, and it is more convenient when 9i is Standby.

First sort out, as follows:

Operating environment: Windows 2000 Professional Serveice Pack 4 Database: Oracle 9201 Library SID: PORMALS Poly SiD: Pormalsoracle Installing OMF Structure

1. The main operating system and the same PACK from both two

2. Create a database on the master from the library, choose to install only Software

3. On the main library, establish a database via DBCA, except for character sets, all default methods

4. On the library, manually create the same directory

5. Close the main library database, back up the data file to the library

Determine data files that need to be copy and Redo log

SQLPlus / NOLOG

SQL> CONN / AS SYSDBA;

SQL> SELECT FILE_NAME from DBA_DATA_FILES;

Determine the required Copy data file

SQL> SELECT MEMBER from V $ logfile;

Determine what you want COPY online day to file

SQL> Shutdown Immediate;

All files selected above the Copy are selected from the corresponding directory from the library.

6. Open the main library database, modify to archive mode (Oracle9i user action)

Manually created archiving catalog C: / Oracle / Arch

SQLPlus / NOLOG

SQL> CONN / AS SYSDBA;

Connected.

SQL> Startup Mount;

SQL> ALTER DATABASE ArchiveLog;

SQL> Archive log start;

SQL> Archive Log List;

SQL> ALTABASE OPEN;

SQL> ALTER system set log_archive_dest_1 = 'location = C: / Oracle / Arch';

SQL> ALTER SESTEM SET LOG_ARCHIVE_FORMAT = '% T_% s.dbf' scope = SPFILE;

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

Restart the database so that the modification results take effect

SQL> Shutdown Immediate;

Check the archive mode

SQL> Startup

SQL> Archive Log List;

7. Produce from the Library Control File on the main library

SQLPlus / NOLOG

SQL> CONN / AS SYSDBA;

SQL> ALTER DATABASE CREATE Standby ControlFile As 'c: /oracle/control01.ctl';

Copy Library C: /oracle/control01.ctl to the Poly C: / Oracle / ORADATA / PORAMALS / Directory

8. Configure the primary library listener.ora and tnsnames.ora files

You can configure it with NET Manager or directly edit C: /Oracle/ora92/neetwork/admin/listener.ora and tnsname.ora file

That is, the network service name that is normal for the main library configuration listening and connection to the primary library, the main library to the STANDBY

9. Configure from library listener.ora and tnsnames.ora files

You can use Net Manager configuration or directly edit C: /Oracle/ora92/neetwork/admin/listener.ora and tnsname.ora files, that is, normal to search and connect from library to the main library (PRIMARY), Network service name from library (Standby)

10. Launch the Listener of the Library

Execute the following commands on the Lord library, respectively

Lsnrctl Start

Look at the main startup from the Library Listener

11 Check the master from the library TNSNames.ora configuration

Main library TNSPING STANDBY

TNSPING PRIMARY

See if the service name of the Lord Library is correct.

12. Create a PFile on the main library, because 9i defaults SPFILE

SQLPlus / NOLOG

SQL> CONN / AS SYSDBA;

Connected.

SQL> CREATE PFILE = 'c: /oracle/ora92/Database/initporamls.ora' from spfile;

13.Copy C: /Oracle/ora92/database.ora/initpormals.orabase.ora/initpormals.ora is to the corresponding directory from the library

14. Modify the initpromals.ora file from the library COPY

Main modifications Add:

Modify Control_Files makes it in line with the actual path of your control file

Add to:

Standby_archive_dest = 'location = C: / Oracle / Starch'

Fal_server = 'primary'

FAL_Client = 'Standby'

Standby_file_management = 'auto'

STANDBY_FILE_MANAGEMENT is not necessary, but to add files to the backward owner, from the library energy automatically, plus this parameter to avoid trouble.

At the same time, the work is established from the library related archive path C: / Oracle / STARCH.

15. C: /oracle/ora92/database/pwdpormals.ora to the Library

16. Create from the library real name DOS> ORADIM -NEW -SID PORMALS

17. Start from the library

SQLPlus / NOLOG

SQL> Startup Nomount;

SQL> ALTER DATABASE MOUNT Standby Database;

Place from the library to Standby mode

SQL> ALTABASE Recover Managed Standby Database Disconnect from Session;

18. Set to the library's archive on the main library

SQL> ALTER SESTEM SET LOG_ARCHIVE_DEST_2 = 'Service = Standby Mandatory Reopen = 60';

SQL> SELECT * FROM V $ log;

Switch the current online log

SQL> ALTER SYSTEM SWITCH LOGFILE;

SQL> SELECT * FROM V $ log;

See the background log from the library

C: / Oracle / admin / pormals / bdump / pormals_arler.

See if the current archived log has been restored normally

This Data Guard configuration is complete.

19. Test it

On the main library

SQL> CREATE User Test Identified by password;

SQL> Grant Connect, Resource to Test;

SQL> Conn Test / Password @Primary;

SQL> CREATE TABLE TEST (Name Varchar2 (20));

SQL> INSERT INTO TEST VALUES ('Hi, Data Guard'); SQL> Commit;

SQL> conn / as sysdba

SQL> ALTER SYSTEM SWITCH LOGFILE;

View from library log

C: /oracle/admin/poramls/bdump/pormals_alert.ora

See if the current archived log has been restored normally

Read read mode opens from the library if INTO TEST VALUES ('Hi, Data Guard'); has taken effect.

On the library

SQL> CONN / AS SYSDBA;

SQL> ALTABASE CANAGER DATABASE CANCEL;

SQL> ALTER DATABASE OPEN Read Only

SQL> Conn Test / password

SQL> SELECT *.

See if INSERT INTO TEST VALUES ('Hi, Data Guard'); has taken effect.

If the effective note is completely working properly, Data Guard is completely configured.

Place the library again in recovery mode

SQL> ALTABASE Recover Managed Standby Database Disconnect from Session;

Note:

1. About starting the closing order

When startup, first from the library Listener, then start from the library, then start the LISTENER of the Library, then the main library is closed, then close the main library, then close the main library, then start from the library.

2, some common View

V $ archive_dest_status This will record the status of Standby and restore to that log.

V $ archive_gap This will record the time from the library MRP process recovery, there is no way to get from the library log

V $ archived_log This will record all the logs that have been archived to the library, and log that the log has been restored

V $ Database will record the protection status of the system and whether it is in Force Logging Status

V $ managed_standby (Physical Standby Databases Only) will record some process IDs from the library, such as RFS, MRP, etc.

V $ Standby_log (Physical Standby Databases Only) will record some of the status of Standby Redo Log from the library.

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

New Post(0)