Build Environment: RedHatLinuxEnterprise5.4Oracle10gR2 host operating system main information is 192.168.199.128. Build preparation: the master database (production database) db_namemustangsid1_l already exists to start building DataG
Build Environment: RedHatLinuxEnterprise5.4Oracle10gR2 host operating system the main information is 192.168.199.128. Build preparation: the master database (production database) DB_NAME = mustangSID = l starts to build DataG
Build Environment: Red Hat Linux Enterprise 5.4 Oracle 10g R2 host operating system the main information is 192.168.199.128. preparation: the master database (production database) DB_NAME = mustang SID = L is already in place. To start building Data Guard, you must first prepare the parameter file, website space, and set some necessary parameters. In the master database, the pfile file is generated through spfile:
SQL> create pfile = '/home/oracle/product/10.2initapril.ora' from spfile;Then modify the inityml. ora parameter file generated by the master database. Add the following content on the basis of the original: After modifying the parameter file, you need to re-open the master database and create the spfile through inistml. ora. As follows:
SQL> create spfile = '/home/oracle/product/10.2.0/db_1/dbs/spfile1_l. ora' from pfile ='
/Home/oracle/product/10.2.0/db_1/dbs/init1_l. ora ';The next step is to create the parameter files required by the slave database through the parameter files of the master database, and run them on the master database:
SQL> create pfile = '/home/oracle/product/10.2.0/db_1/dbs/initstandby. ora' from spfile;Edit initstandby. ora. Save the initstandby. ora parameter file as follows. Use initstandby. ora to generate the dynamic file spfilestandby. ora: Create our password file on the master database:
[Oracle @ localhost dbs] $ orapwd file = '/home/oracle/product/10.2.0/db_1/dbs/orapwstandby' password = oracle entries = 10Use the control file of the master database to generate the control file of the slave database:
SQL> alter database create standby controlfile as '/home/oracle/standby. ctl ';Start to create a slave Database: first, create the directory structure of the slave database. Here, the master database is located in the same directory: master database:/home/oracle/mustang master database archive file: /home/oracle/archive so we created our backup database directory under/home/oracle:
The next step is to configure the listener (if standby is not monitored, it cannot be started ). Before configuring the listener, you must first generate the password file of the slave database:
[Oracle @ localhost dbs] $ orapwd file = '/home/oracle/product/10.2.0/db_1/dbs/orapwstandby' password = oracle entries = 10Switch the path to/home/oracle/product/10.2.0/db_1/network/admin. You can see through the ls command: [oracle @ localhost admin] $ lslistener. ora shrept. lst sqlnet. log tnsnames. before configuring a listener, ora must stop our listening service: lsnrctl stop. To start configuring the listener, first configure the tnsnames. ora file. Set the service name (because we are a single machine, we can configure it on the local machine. If it is two machines, we need to configure tnsnames in the master and slave databases. ora): Configure listener. ora file (it is recommended to use netmgr configuration and Hong Kong server for convenience, because manual configuration is prone to errors ). The configuration is as follows: Now our Listener Configuration is complete and the listener is started:
[Oracle @ localhost admin] $ lsnrctl startThe following content indicates that the configuration is successful: LSNRCTL for Linux: Version 10.2.0.1.0-Production on 26-JUL-2012 20: 59: 37 Copyright (c) 1991,200 5, Oracle. all rights reserved. starting/home/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 10.2.0.1.0-ProductionSystem parameter file is/home/oracle/product/10.2.0/db_1/network/admin/listener. oraLog messages written to/home/oracle/product/10.2.0/db_1/network/log/listener. logTrace information written to/home/oracle/product/10.2.0/db_1/network/trace/listener. trcListening on: (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = localhost. localdomain) (PORT = 1521) Listening on: (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = localhost. localdomain) (PORT = 1522) Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = localhost. localdomain) (PORT = 1521) STATUS of the LISTENER ------------------------ Alias LISTENERVersion TNSLSNR for Linux: Version 10.2.0.1.0-ProductionStart Date 26-JUL-2012 20: 59: 37 Uptime 0 days 0 hr. 0 min. 0 secTrace Level userSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File/home/oracle/product/10.2.0/db_1/network/admin/listener. oraListener Log File/home/oracle/product/10.2.0/db_1/network/log/listener. logListener Trace File/home/oracle/product/10.2.0/db_1/network/trace/listener. trcListening Endpoints Summary... (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = localhost. localdomain) (PORT = 1521) (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = localhost. localdomain) (PORT = 1522) Services Summary... service "mustang" has 1 instance (s ). instance "CMDL", status UNKNOWN, has 1 handler (s) for this service... service "standby" has 1 instance (s ). instance "standby", status UNKNOWN, has 1 handler (s) for this service... the command completed successfully we can also check whether The configuration is successful through tnsping: