Building process of Oracle 10g physical Dataguard

Source: Internet
Author: User
Tags mkdir sqlplus

Primary environment

DB version:oracle10.2.0.4

ip:192.168.1.7

Hostname:vzwc

Db_name:dbserver

Db_unique_name:dbserver

Service_name:dbserver

Instance_name:orcl

Standby environment

DB version:oracle10.2.0.4

ip:192.168.1.6

Hostname:dgstb

Db_name:dbserver

Db_unique_name:standby

Service_name:standby

Instance_name:standby

*********************************************

Configure Primary

--Open force logging and archive, set up archive directory

Sql> Startup Mount

ORACLE instance started.

Total System Global area 612368384 bytes

Fixed Size 2085872 bytes

Variable Size 167775248 bytes

Database buffers 436207616 bytes

Redo buffers 6299648 bytes

Database mounted.

sql> ALTER DATABASE force logging;

Database altered.

sql> ALTER DATABASE Archivelog;

Database altered.

sql> ALTER DATABASE open;

Database altered.

Sql> alter system set log_archive_dest_1= ' Location=/arch ';

System altered.

--Create standby Controlfile and pfile, and upload the password file to the standby side

sql> ALTER DATABASE create standby Controlfile as '/u01/app/oracle/standby.ctl ';

Database altered.

sql> create pfile= '/u01/app/oracle/init.ora ' from SPFile;

File created.

Sql>!scp/u01/app/oracle/*.ctl oracle@192.168.1.6:/u01/app/oracle

The authenticity of host ' 192.168.1.6 (192.168.1.6) ' can ' t be established.

RSA key fingerprint is 9c:7e:6b:4f:ad:6a:bd:2e:b0:34:ef:5c:a5:ff:69:1f.

Are you sure your want to continue connecting (yes/no)? Yes

warning:permanently added ' 192.168.1.6 ' (RSA) to the list of known hosts.

oracle@192.168.1.6 ' s Password:

Standby.ctl 100% 7152KB 7.0mb/s 00:00

Sql>!scp/u01/app/oracle/*.ora oracle@192.168.1.6:/u01/app/oracle

oracle@192.168.1.6 ' s Password:

Init.ora 100% 1225 1.2kb/s 00:00

sql>!SCP $ORACLE _HOME/DBS/ORAPWORCL oracle@192.168.1.6:/u01/app/oracle

oracle@192.168.1.6 ' s Password:

Orapworcl 100% 2048 2.0kb/s 00:00

*********************************************

Configure standby

--rename pfile and password files

[Oracle@dgstb ~]$ CD $ORACLE _home/dbs

[Oracle@dgstb dbs]$ MV/U01/APP/ORACLE/ORAPWORCL Orapwstandby

[Oracle@dgstb dbs]$ Mv/u01/app/oracle/init.ora Initstandby.ora

--Configure Standby environment variables

Alias ls= "Ls-fa"

Export Oracle_base=/u01/app/oracle

Export Oracle_home= $ORACLE _base/product/10.2.0/db_1

Export oracle_path= $ORACLE _base/common/oracle/sql:: $ORACLE _home/rdbms/admin

Export Oracle_sid=standby

Export Path=.:${java_home}/bin:${path}: $HOME/bin: $ORACLE _home/bin

Export Path=${path}:/usr/bin:/bin:/usr/bin/x11:/usr/local/bin

Export Path=${path}: $ORACLE _base/common/oracle/bin

Export Oracle_term=xterm

Export tns_admin= $ORACLE _home/network/admin

Export ora_nls10= $ORACLE _home/nls/data

Export Ld_library_path= $ORACLE _home/lib

Export Ld_library_path=${ld_library_path}: $ORACLE _home/oracm/lib

Export Ld_library_path=${ld_library_path}:/lib:/usr/lib:/usr/local/lib

Export Classpath= $ORACLE _home/jre

Export Classpath=${classpath}: $ORACLE _home/jlib

Export Classpath=${classpath}: $ORACLE _home/rdbms/jlib

Export Classpath=${classpath}: $ORACLE _home/network/jlib

Export Threads_flag=native

Export Temp=/tmp

Export Tmpdir=/tmp

Alias sqlplus= "Rlwrap Sqlplus"

Alias rman= "Rlwrap Rman"

Alias base= "CD $ORACLE _base"

Alias home= "CD $ORACLE _home"

--Create the appropriate directory, configure standby pfile,db_name do not need to change and primary consistent, add the necessary parameters of the library

[Oracle@dgstb oracle]$ pwd

/u01/app/oracle

[Oracle@dgstb oracle]$ mkdir-p Admin/standby/{a,b,c,u}dump

[Oracle@dgstb oracle]$ mkdir-p Oradata/standby

[Oracle@dgstb oracle]$ ls Admin/standby

adump/bdump/cdump/udump/

[Oracle@dgstb dbs]$ Cat Initstandby.ora

*.audit_file_dest= '/u01/app/oracle/admin/standby/adump '

*.background_dump_dest= '/u01/app/oracle/admin/standby/bdump '

*.compatible= ' 10.2.0.3.0 '

*.control_files= '/u01/app/oracle/standby.ctl '

*.core_dump_dest= '/u01/app/oracle/admin/standby/cdump '

*.db_block_size=8192

*.db_domain= '

*.db_file_multiblock_read_count=16

*.db_name= ' DBServer '

*.dispatchers= ' (protocol=tcp) (SERVICE=ORCLXDB) '

*.job_queue_processes=10

*.log_archive_format= ' arc%s_%r.%t '

*.nls_language= ' Simplified Chinese '

*.nls_territory= ' in '

*.open_cursors=300

*.pga_aggregate_target=203423744

*.processes=500

*.remote_login_passwordfile= ' EXCLUSIVE '

*.sessions=555

*.sga_target=612368384

*.undo_management= ' AUTO '

*.undo_tablespace= ' UNDOTBS1 '

*.user_dump_dest= '/u01/app/oracle/admin/standby/udump '

# #以下是standby添加参数

*.db_unique_name= ' standby '

*.db_file_name_convert= '/u01/app/oracle/oradata/dbserver ', '/u01/app/oracle/oradata/standby '

*.log_file_name_convert= '/u01/app/oracle/oradata/dbserver ', '/u01/app/oracle/oradata/standby '

*.log_archive_config= ' dg_config= (dbserver,standby) '

*.log_archive_dest_1= ' Location=/arch valid_for= (all_logfiles,all_roles) Db_unique_name=standby '

*.log_archive_dest_2= ' service=dbserver lgwr async valid_for= (online_logfiles,primary_role) db_unique_name= DBServer '

*.log_archive_dest_state_1=enable

*.log_archive_dest_state_2=enable

*.log_archive_max_processes=10

*.fal_server=dbserver

*.fal_client=standby

*.standby_file_management=auto

This column more highlights: http://www.bianceng.cn/database/Oracle/

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.