Establish Standby Database experience on a machine

zhaozj2021-02-16  95

Environment: CPU: PII233 OS: Redhat Linux 6.22 Oracle: Oracle8.1.6.0.0 for Linux ================================== ===== Oracle home directory in / home / oracle / orahome1sid = PDB data files in / u01 / oradata / PDB archive redo log file in / u01 / oradata / arch =========== = Standy Database =============================================================================================================== / ARC_DEST Establishment Steps: 1. Create a DBA group and Oracle user and modify it .bash_profile2. Install RH Linux6.22 and Oracle 8.1.6ee, SID is PDB as a PDB; 3. All datafiles in all Primary DBs are installed as an Oracle user. A backup for later transfer to Standby Database: SQL> CONN / AS SYSDBASQL> SELECT NAME FROM V $ DATAFILE; (My Primary DB Data File in / U01 / ORADATA / PDB Directory) SQL> Shutdown Immediate $ CP / U01 / U01BAK / ORADATA / PDB / 4. Creating Standby DB Control File $ SQLPLUS "/ as sysdba" SQL> Startup SQL> ALTER DATABASE CREATE Standby ControlFile As' / U01Bak / ORADATA / PDB / CONTROL01 .ctl '; 5. Establish Standby DB users ------- Standby, and modify it .bash_profile (I will always be confused, so I started two terminals from this, I agree to TTY1 of Oracle landing. The terminal of Standby login is TTY2) 6. In TTY2, use root identity to set the / u01, / u02, / home / oracle to all readable writable manner, and set the corresponding host (I feel simply Thorough * ^ - ^ *, this method is for reference only, especially Safety issues should also be considered in the company) $ chmod -r 777 / u01 $ chmod -r 777 / u02 $ chmod -r 777 / home / oracle $ chGRP -R DBA / U01 $ chgrp -r dba / u02 $ chown -R Oracle / U01 $ Chown -R Standby / U027. In TTY2, transfer the Control file and data files required by Standby DB to a pre-designed directory $ CP /U01BAK/Ordata/pdb/control01.ctl / u02 / stdby $ Cp /u01bak/oradata/pdb/*.dbf / u02 / stdby executes with root:

$ Chown -r Standby / U028. Configure Listener.ora Add the following Standby DB listener slistener: slistener = (description_list = (address = (address = (protocol = tcp) (Host = 1512) (port = 1512) ) ---------- Difference to the port 1521 of Primary DB 1521)))))) SID_LIST_SLISTENER = (SID_LIST = (SID_DESC = (Oracle_Home = / Home / Oracle / OraHome1) (SID_NAME = SDB) ---- --- Must consisten to instance_name in the parameter file))))))) 9. Configure TNSNames.ora to add the following listener SDB: SDB = (deSCription = (address = (protocol = tcp) (host = 1512) (port = 1512) ))) ----------- The SID_NAME in SListener is consistent with the instance_name in the parameter file, mainly 8i previous versions (Server = Dedicated) (global_name = sdb) ------------ The uniform, SID and GLOBAL_NAME in the parameter file can be set one)) 10. Test the listener in TTY1, let Oracle test Default listener (listening Primary DB) startup and status $ lsnrctllsnrctl> Stoplsnrctl> Start (or start listener) In TTY2, let Standby test Standby DB startup and status $ lsnrctllsnrctl> Start Slistener *** Note, modify the Listener. After ORA, if you want it to take effect to restart your monitor, or use the reload command 11. Pay attention to these when you modify the parameter file of Primary DB: DB_NAME = "PDB" ******** ****** STANDBY DB will be consistent with the same instance_name = pdb *********** listener.or The SID_NAME of the Listener Listener of the A file will solve the service_names = pdb ************ TNSNAMES.ORA file PDB listening global_name will consistent with CONTROL_FILES = ("/ u01 / oradata / pdb /control01.ctl "," /u01/oradata/pdb/control02.ctl "," /u01/oradata/pdb/control03.ctl")log_archive_start = truelog_archive_dest_1 = "location = / u01 / oradata / arch MANDATORY REOPEN = 60" ******** Archive to the local destination log_archive_dest_state_1 = enable ****** Display Description (OK) can be archived to this path log_archive_dest_2 = "service = SDB Optional Reopen = 180"

********* STANDBY DB Service Namelog_archive_dest_state_2 = enablelog_archive_format = Arch_% T_% s.arccompatible = "8.0.5" ************** Standby DB will be Consistency ** Note log_archive_dest_n and location, service keywords use 12. In TTY2, put the PRIMARY DB parameter file copy to / u02 / stdby, and modify it (where you can set your Copy, if Copy to $ Oracle_Home / DBS In this position, a link to establish a file is established. You don't have to use a PFILE parameter at a time of startup) $ cp /home/oracle/initpdb.ora /u02/stdby/initsdb.ora These are good: DB_NAME = "PDB" ************** must match the primary DB uniform instance_name = SDB ************ listener.ora file SiD_Name of the SLISTENER listener will consider the service_names = SDB ************ TNSNAMES. ORA file SDB listening global_name will consist in control_files = ("/u02/stdby/control01.ctl" ******* Note the location of Standby DB's Control File log_archive_start = truelog_archive_DEST_1 = "location = / u02 / arc_dest" ************** Because of the default STANDBY DB looks for archive reform logs in the log_arch_dest_1 directory, so it should be set to the value of LOG_ARCH_DEST_1 with StandBy_arch_Dest. Standby_archive_dest = "/ u02 / arc_dest" ******************** The Archive log file will be transferred and written to this location. LOG_ARCHIVE_DEST_STATE_1 = Enable log_archive_format = Arch_% T_% s.arcdb_file_name_convert = ("/ U01 / ORADATA / PDB", "/ U02 / stdby") ******** Rename the location of Primary DB to Standby Data's location, Oracle Document said that if this is unsuccessful, you should name the text of Standby DB's DataFile, but I have not tried it, huh, hure, huh log_file_name_convert = ("/ u01 / oradata / pdb", "/ u02 / stdby" ********* Rename the position of the primary DB's Redo Log File to the position of Standby DB, Oracle Document said that if this is unsuccessful, you should be named Standby DB Redo Log File. Text, but I didn't tried, huh Lock_name_space = SDB *** Specifies the namespace of DLM (namespace) for SDB.

This is a compatible = "8.0.5" ******************************************************************** Start Primary DB $ SQLUS "/ as sysdba" SQL> Startup14. Prepare Standby DB Management Reply (1). In TTY2, start the Standby instance with Standby, but do not install $ SQLPLUS "/ as sysdba" SQL> Startup Nomount Pfile = / U02 / stdby / initsdb.ora (if you have established LINK for IRACLE_HOME / DBS, you have a good thing in Startup Nomount) (2). Install but do not open the standby database. ALTER DATABASE MOUNT Standby Database; (3). Copy Primary DB Archive Log File to / U02 / Arc_Dest $ CP / U01 / ORADATA / ARCH / * / U02 / Arc_Dest (4). Using Automatic Options Reply Database SQL> Recover Automatic STANDBY DATABASE; see a message such as Specify log: { = suggester | filename | auto | ca Zan} prompts, only the carriage is good (5). Enter the Managed Recovery Modesql> Recovery Managed Standby Database; Note: You can use Recover Managed Standby Database Timeout 5 Waiting for Primary DB transfer from the Archive Log file transferred in the next 5 minutes; after this command, you can go to TTY1, do an Alter System Archive Log Current, then look at whether the Archive log file is automatically transferred. In / u02 / stdby / arc_dest it:) After 5 minutes, the system returns to (4), this is to try Read Open Standby DB. 15. Read Open Standby DBSQL> ALTER DATABASE OPEN read online; now you can do more tests, such as building a user in Primary DB, build a table, etc., then send it to the Standby DB Effect, huh http://www.itpub.net/showthread.php?s=&threadiD=27163&highlight=*

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

New Post(0)