Oracle 11.2.4.0 ACTIVE DATAGUARD Single Instance installation (copy creation repository)

Source: Internet
Author: User
Tags directory create

Oracle 11.2.4.0 ADG Single Instance installation (copy creation repository)
Planning:
Main:

Os:linux Centos 6.5 X64
Hostname:ora11g-dg1
ipaddress:192.168.213.199
Db_unique_name=netdata_pd
Db_name=netdata
Preparation:

Os:linux Centos 6.5 X64
Hostname:ora11g-dg2
ipaddress:192.168.213.200
Db_unique_name=netdata_sd
Db_name=netdata

Note OS platform consistent

1. Installing Oracle Software in the main library (refer to documentation)

2. Create a listener, you can use NETCA, or you can create it directly with a file
Listener.ora as follows
LISTENER =
(Description_list =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = ORA11G-DG1) (PORT = 51518))
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC51518))
)
)

Sid_list_listener =
(Sid_list =
(Sid_desc =
(Global_dbname = netdata)
(Sid_name = netdata)
)
)
Adr_base_listener =/u01/app/oracle

2. The main library DBCA build the library, pay attention to the production environment of some parameters sga,pga,process, archive location, open_cursor,flash_recovery location and so on, if you want to use EM to start the need to build port 1521 monitoring
3. Main Library Tnames.ora Configuration
NETDATA_SD =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.213.200) (PORT = 51518))
)
(Connect_data =
(service_name = netdata)
)
)

NETDATA_PD =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.213.199) (PORT = 51518))
)
(Connect_data =
(service_name = netdata)
)
)

4. Standby installation Oracle software installs software only (please refer to the previous installation software)

5. Prepare the library configuration Listener.ora,tnames.ora
Listener.ora as follows:
Listener =
  (description_list =
     (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP) (HOST = ora11g-dg2) (PORT = 51518))
      (ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC51518))
   )
 )

Sid_list_listener =
  (sid_list =
    (sid_desc =
      ( Sid_name = Plsextproc)
      (oracle_home =/u01/app/oracle/product/11.2.0/dbhome_1)
      (program = extproc)
   )
    (Sid_desc =
      (global_dbname = netdata)
      (oracle_home =/u01/app/ Oracle/product/11.2.0/dbhome_1)
      (sid_name = netdata)
   )
 )
Adr_base_listener =/u01/app/oracle

Tnames.ora as follows:
NETDATA_SD =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.213.200) (PORT = 51518))
)
(Connect_data =
(service_name = netdata)
)
)

NETDATA_PD =
(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.213.199) (PORT = 51518))
)
(Connect_data =
(service_name = netdata)
)
)

6. Main Library parameter file configuration
Main Library Force forceloing
sql> ALTER DATABASE Froce LOGGING;
Sql> select force_logging from V$database;
YES
Parameter file configuration
Alter system set DB_UNIQUE_NAME=NETDATA_PD Scope=spfile;
Alter system set log_archive_config= ' dg_config= (NETDATA_PD,NETDATA_SD) ' Scope=both;
Alter system set log_archive_dest_1= ' Location=/oradata/archive valid_for= (all_logfiles,all_roles) DB_UNIQUE_NAME= NETDATA_PD ' Scope=both;
Alter system set log_archive_dest_2= ' SERVICE=NETDATA_SD lgwr SYNC affirm valid_for= (online_logfiles,primary_role) DB_ UNIQUE_NAME=NETDATA_SD ';
Alter system set standby_file_management= ' AUTO ' sid= ' * ' Scope=both;
Alter system set fal_client= ' NETDATA_PD ';
Alter system set fal_server= ' NETDATA_SD ';
Alter system set db_file_name_convert= '/oradata/netdata ', '/oradata/netdata ' scope=spfile;
Alter SYSTEM SET log_file_name_convert= '/oradata/netdata ', '/oradata/netdata ' scope=spfile;

7. Create a parameter file for the standby library
Create pfile= '/oradata/standby.ora ' from SPFile
Edit Standby.ora
Modify
*.db_unique_name= ' NETDATA_PD '
*.log_archive_config= ' dg_config= (NETDATA_PD,NETDATA_SD) '
*.log_archive_dest_1= ' location=/oradata/archive
Valid_for= (All_logfiles,all_roles)
DB_UNIQUE_NAME=NETDATA_PD '
*.log_archive_dest_2= ' SERVICE=NETDATA_SD ASYNC
Valid_for= (Online_logfiles,primary_role)
Db_unique_name=netdata_sd '
*.fal_client= ' NETDATA_PD '
*.fal_server= ' NETDATA_SD '
*.log_file_name_convert= '/oradata/netdata ', '/oradata/netdata '
*.standby_file_management= ' AUTO '
*.db_file_name_convert= '/oradata/netdata ', '/oradata/netdata '

8. Create a control file for the standby library
ALTER DATABASE create standby Controlfile as '/oradata/control01.ctl ';

9. Close the main library to the data file, the parameter file, the password file ($ORACLE _home/dbs/orapwnetdata Linux to Orapw$oracle_sid), the admin file
Note: Prepare library to create the required directory Create
--data file directory
mkdir-p/oradata/netdata
--recovery directory
mkdir-p/oradata/recovery_area
--Archive directory with Oracle user Br>mkdir-p/oradata/archive
--admin directory
mkdir-p/u01/app/oracle/admin/
Copy data files and redo files
Scp-r/oradata/ Netdata/*.log [email protected]:/oradata/netdata/
scp-r/oradata/netdata/*.dbf [email protected]:c
Copy Admin directory
Scp-r/u01/app/oracle/admin/* [email protected]:/u01/app/oracle/admin/
Copy parameter file
Scp-r/ Oradata/control01.ctl [Email protected]:/oradata/control01.ctl
Scp-r/oradata/control01.ctl [email  Protected]:/oradata/control02.ctl
Scp-r/oradata/control01.ctl [email protected]:/oradata/recovery_area/ Control03.ctl
Note that you must copy all or boot the repository will be error
copy password file
scp-r $ORACLE _home/dbs/orapwnetdata [email protected]:/ U01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwnetdata

10. Create Standbylog
Main:
Startup
ALTER database ADD STANDBY LOGFILE Group 4 ('/oradata/netdata/stredo01.log ') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE Group 5 ('/oradata/netdata/stredo02.log ') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE Group 6 ('/oradata/netdata/stredo03.log ') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE Group 7 ('/oradata/netdata/stredo04.log ') SIZE 50M;
Note that the size here is consistent with Redolog, a group more than Redolog
:
Sqlplus/nolog
Create SPFile from pfile= '/oradata/netdata/ Standby.ora ';
Startup Mount;
ALTER DATABASE ADD STANDBY LOGFILE Group 4 ('/oradata/netdata/stredo01.log ') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE Group 5 ('/oradata/netdata/stredo02.log ') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE Group 6 ('/oradata/netdata/stredo03.log ') SIZE 50M;
ALTER DATABASE ADD STANDBY LOGFILE Group 7 ('/oradata/netdata/stredo04.log ') SIZE 50M;

11. Verify that the master library is synchronized
Operation:
Shutdown immediate;
Startup Nomount;
ALTER DATABASE mount standby database;
ALTER DATABASE recover managed standby database disconnect from session;

Verify that the master preparation is consistent
Archive log list;
Col name format A50;
Col dest_name format A40
Col Error format A20
Set line 200;
Select Name,sequence#,applied from V$archived_log a where a.sequence#= (select Max (sequence#) from V$archived_log);
Col dest_name format A40
Select Dest_name,status,error from V$archive_dest where rownum<3;


Start ADG:
ALTER DATABASE recover managed standby database cancel;
ALTER DATABASE open read only;
ALTER DATABASE recover managed standby database using current logfile disconnect from session;

Oracle 11.2.4.0 ACTIVE DATAGUARD Single Instance installation (copy creation repository)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.