Create a Standby Database in 9i, recently, the Data Guard under Oracle 9i is tested, and it is more convenient to finish the 9i Standby, 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. Turn off the main library database, back up the data file to the library to determine if you need a copy of data files and redo log sqlplus / nolog sql> conn / as sysdba; sql> select file_name from dba_data_files; determine what to COPY Data file SQL> SELECT MEMBER FROM V $ logfile; Determine what you want COPY online day to file SQL> Shutdown Immediate; Copy selected all files to the corresponding directory from the library.
6. Open the host library database, modify to archive (Oracle9i user action) manually created an archive directory C: / Oracle / Archsqlplus / Nolog SQL> conn / as sysdba; connection. Sql> Startup Mount; SQL> ALTER DATABASE ArchiveLog; SQL> archive log start; SQL> archive log list; SQL> alter database open; SQL> alter system set LOG_ARCHIVE_DEST_1 = 'LOCATION = C: / Oracle / Arch'; SQL> alter system set log_archive_format = '% t_% s.dbf' scope = SPFILE; SQL> ALTER system set log_archive_start = true scope = spfile; restart the database, make the modification result take effect SQL> Shutdown Immediate; check the archive mode SQL> Startup SQL> Archive log list;
7. Produce from library control file sqlplus / nolog sql> conn / as sysdba on the main library; SQL> ALTABASE CREATE Standby ControlFile As 'c: /oracle/control01.ctl'; Copy Library C: / Oracle / Control01. CTL to the library C: / Oracle / ORADATA / PORAMALS / directory
8. Configure the main library listner.ora and tnsnames.ora files You can use NET Manager or directly edit C: /Oracle/ora92/neetwork/admin/listener.ora and tnsname.ora files are normal for main library configuration listening and Connect to the primary library, the main library to the network service name from the STANDBY
9. Configuring from library listener.ora and tnsnames.ora files You can use NET Manager or directly edit C: /Oracle/ora92/neetwork/admin/listener.ora and tnsname.ora files are normal for the library. Connect to the Library to the main library, directly to the STANDBY network service name.
11 Check the main library TNSNAMES.ORA Configuration Main Library TNSPING Standby from the library TNSPING PRIMARY to see if the service name of the Library is configured correctly
12. Create a PFile on the main library, because 9i default uses spfile sqlplus / nolog sql> conn / as sysdba; connection. 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 main modification of the initpormals.ora file from the library, modify the control_files to make it conform to your actual path to your control file: StandBy_archive_Dest = 'location = C: / Oracle / Starch'FAL_Server =' primary'fal_client = ' StandBy'Standby_File_Management = 'auto' where standby_file_management is not necessary, but to add files to the back of the main library, automatically process from the library energy, plus this parameter, 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 C: ORADPORMALS. ORABASE/PWDPORMALS. ORA is created from the library real name DOS> ORADIM -NEW -SID PORMALS 17. Starting from the library SQLPLUS / NOLOG SQL> Startup Nomount ; SQL> ALTER DATABASE MOUNT STANDBY DATABASE; set from the library to Standby mode SQL> ALTABASE Recover Managed Standby Database Disconnect from Session;
18. Set to the owner's archive SQL> ALTER system set log_archive_dest_2 = 'service = standby mandatory reopen = 60'; SQL> SELECT * FROM V $ log; Switch Current online log SQL> ALTER SYSTEM SWITCH logfile; SQL > SELECT * from V $ log; check the library background log C: / Oracle / Admin / Pormals / BDump / Pormals_arler. See if the current archive log has been restored to this Data Guard configuration.
19. Test it on the main library on 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; look at the library log C: /oracle/admin/poramls/bdump/pormals_alert.ora See current Whether the archive log has been restored normally
Read read mode opens from the library if INTO TEST VALUES ('Hi, Data Guard'); has taken effect. SQL> CONN / AS SYSDBA; SQL> ALTABASE CANCOVER Management Standby Database Cancel; SQL> ALTER DATABASE OPEN READLY; SQL> Conn Test / Password SQL> Select * from test; check if INSERT INTO TEST VALUES (' Hi, Data Guard '; has taken effect. If the effective note is completely working properly, Data Guard is completely configured. Return from the library in recovery mode SQL> ALTER DATABASE Recover Managed Standby Database Disconnect from Session; Note: 1. About starting the closing order starts, first from the library Listener, then start from the library, then start the list of the Lustener When the main library is closed, the main library is turned off first, then it is passed from the library. 2, some common View V $ Archive_Dest_status This will record to Standby's status and restore to that log V $ archive_gap This will record the currently recovered from the library MRP process to recover the courage to get from the library log V $ archived_log this record All files that have been archived from the library, and log that the log has been restored to the protection status of the V $ Database Record system and whether it is in force logging status v $ managed_standby (physical standby databases only) will record some of the processes from the library and Process ID of the process, 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.