10G deployment uard configuration in Centos 4.4

Source: Internet
Author: User

Environment:

OS: CentOS4.4

Oracle: oracle10gr1(the installation software is 10201_database_linux32.zip. It has not been upgraded to R2 and does not affect the following configuration)

Primary: 192.168.0.5 (host name RAC1)

Standby: 192.168.0.7 (host name RAC3)



1) configure the profile of the dual host (including rac1 and rac3.

#. Sh_profile

# Get the aliases and functions

# If [-f ~ /. Bashrc]; then

#.~ /. Bashrc

# Fi

# User specific environment and startup programs

# Export BASH_ENV = $ HOME/. bashrc

Export PATH = $ ORACLE_HOME/bin: $ HOME/bin: $ PATH:/sbin:/usr/local/bin:/usr/local/sbin

PATH = $ PATH:/sbin:/home/oracle/product/10.2.0/db_1/bin: $ oracle_home/jre/bin:/usr/bin: /usr/bin:/etc:/usr/local/bin:

Export PATH

Unset USERNAME

ORACLE_OWNER = oracle

Export ORACLE_BASE =/home/oracle

Export ORACLE_HOME =/home/oracle/product/10.2.0/db_1

Export ORACLE_SID = rac

TNS_ADMIN =/home/Oracle/config/10.2.0; export TNS_ADMIN

NLS_LANG = american_america.ZHS16GBK; export NLS_LANG

# ORA_NLS33 = $ Oracle_HOME/ocommon/nls/admin/data; export ORA_NLS33

CLASSPATH = $ Oracle_HOME/JRE: $ Oracle_HOME/jlib: $ Oracle_HOME/rdbms/jlib:/opt/j2sdk_nb/j2sdk1.4.2/bin

Export CLASSPATH

TMPDIR =/tmp; export TMPDIR

Umask 022

Export LD_LIBRARY_PATH = $ ORACLE_HOME/lib:/usr/lib

# Export LD_PRELOAD =/home/oracle/libcwait. so;

LD_ASSUME_KERNEL = 2.6.9; export LD_ASSUME_KERNEL

# NLS_LANG = "Simplified Chinese_china". ZHS16GBK; export NLS_LANG

LC_CTYPE = zh_CN.GB2312

NLS_LANG = american_america.ZHS16GBK; export NLS_LANG

Export NLS_DATE_FORMAT = "YYYY-MM-DD HH24: MI: SS"

LANG =

LC_ALL =

DISPLAY = 192.168.0.3: 0.0; export DISPLAY;

Export PS1 = "\ u @ \ H $"

If [$ USER = "oracle"]; then

If [$ SHELL = "/bin/sh"]; then

Ulimit-p 16384

Ulimit-n 65536

Else

Ulimit-u 16384-n 65536

Fi

Fi



2) Check Required Software

Perform the same operation on each node:

Run the following command: rpm-q binutils compat-db control-center gcc-c ++ glibc gnome-libs libstdc ++-devel make openmotif21

Install the missing package.



3) Configure Kernel Parameters

Perform the same operation on each node:

Edit the/etc/sysctl. conf file and add the following content:

# For Oracle

Kernel. sem = 250 32000 100 128

Kernel. shmmni = 4096

Kernel. shmall = 2097152

Kernel. shmmax = 2147483648

Net. ipv4.ip _ local_port_range = 1024 65000

Net. core. rmem_default = 1048576

Net. core. rmem_max = 1048576

Net. core. wmem_default = 262144

Net. core. wmem_max = 262144

Then execute:

Sysctl-p or restart the system



4) set Shell restrictions on Oracle users

Perform the same operation on each node:

Edit/etc/security/limits. conf and add the following content:

Oracle soft nofile 65536

Oracle hard nofile 65536

Oracle soft nproc 16384

Hard nproc 16384



Edit/etc/pam. d/login and add the following content:

Session required/lib/security/pam_limits.so



5) install the 10gr1 software on the master database (rac1) without installing the database.

Package the product and oraInventory directories to the oracle_home directory (I .e./home/oracle) of the auxiliary (rac3) and unbind them on rac3.



6) Create a database through dbca on the master database (rac1) and select the default configuration.

As specified in Sid and profile, it is rac.



7) Close the master database and copy the files in/home/oracle/oradata/rac/to the same location on rac3.



SQL> startup

ORACLE instance started.



Total System Global Area 167772160 bytes

Fixed Size 1218292 bytes

Variable Size 67111180 bytes

Database Buffers 92274688 bytes

Redo Buffers 7168000 bytes

Database mounted.

Database opened.

SQL> archive log list

Database log mode Archive Mode

Automatic archival Enabled

Archive destination/home/oracle/product/10.2.0/db_1/dbs/arch

Oldest online log sequence 0

Next log sequence to archive 1

Current log sequence



SQL> alter system set log_archive_dest_1 = 'location =/home/oracle/oradata/rac/archive ';



System altered.



SQL> alter system set log_archive_format = 'Log _ % t _ % s _ % r. arc' scope = spfile;



System altered.

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.



SQL> startup

ORACLE instance started.

-----------------------------

Database mounted.

Database opened.



SQL> archive log list;

Database log mode Archive Mode

Automatic archival Enabled

Archive destination/home/oracle/oradata/rac/archive

Oldest online log sequence 0

Next log sequence to archive 1

Current log sequence 1



Create a standby Control File

SQL> alter database create standby controlfile as '/home/oracle/standby. ctl ';

Database altered.



Upload standby. ctl to/home/oracle/oradata/rac/of rac3



Configure listener. ora tnsnames. ora of the master database



Oracle @ rac1 $ cat listener. ora

LISTENER_RAC1 =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.5) (PORT = 1521 ))

)



SID_LIST_LISTENER_RAC1 =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = rac)

(ORACLE_HOME =/home/oracle/product/10.2.0/db_1)

(SID_NAME = rac)

)

)



All tnsnames. ora of rac1 and rac3 are

RAC3 =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.7) (PORT = 1521 ))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = rac)

)

)



RAC1 =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.5) (PORT = 1521 ))

)

(CONNECT_DATA =

(SERVER = DEDICATED)

(SERVICE_NAME = rac)

)

)



Listener. ora of the auxiliary Library

Oracle @ rac3 $ vi listener. ora

# Listener. ora Network Configuration File:/home/oracle/product/10.2.0/db_1/network/admin/listener. ora

# Generated by Oracle configuration tools.



SID_LIST_LISTENER =

(SID_LIST =

(SID_DESC =

(GLOBAL_DBNAME = rac)

(ORACLE_HOME =/home/oracle/product/10.2.0/db_1)

(SID_NAME = rac)

)

)



LISTENER =

(DESCRIPTION =

(ADDRESS = (PROTOCOL = TCP) (HOST = rac3) (PORT = 1521 ))

)



If it is easy to manually edit the above files, we recommend that you use netca to create them.



Start the istener of the master database

Oracle @ rac1 $ lsnrctl start

-----------------------------------

(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = rac1) (PORT = 1521 )))

The listener supports no services

The command completed successfully

Start the istener of the slave Database

Oracle @ rac3 $ lsnrctl start

----------------------------------

Instance "rac", status UNKNOWN, has 1 handler (s) for this service...

The command completed successfully

Use tnsping to check the tns Configuration

Oracle @ rac3 $ tnsping rac1

Oracle @ rac3 $ tnsping rac3

Oracle @ rac1 $ tnsping rac1

Oracle @ rac1 $ tnsping rac3

Create a pfile on the master database rac1 and upload it to the corresponding location $ oracle_home/dbs on the secondary database rac3.

Oracle @ rac1 $ sqlplus '/as sysdba'

SQL> create pfile = '/home/oracle/initrac. ora' from spfile;

File created.

Upload/home/oracle/initrac. ora ftp on rac1 to the corresponding location on the secondary database rac3 $ oracle_home/dbs

Modify the initrac. ora file on rac3.

Oracle @ rac3 $ more initrac. ora

Rac. _ db_cache_size = 92274688

Rac. _ java_pool_size = 4194304

Rac. _ large_pool_size = 4194304

Rac. _ shared_pool_size = 58720256

Rac. _ streams_pool_size = 0

*. Audit_file_dest = '/home/oracle/admin/rac/adump'

*. Background_dump_dest = '/home/oracle/admin/rac/bdump'

*. Compatible = '10. 2.0.1.0'

*. Control_files = '/home/oracle/oradata/rac/standby. ctl'

*. Core_dump_dest = '/home/oracle/admin/rac/cdump'

*. Db_block_size = 8192

*. Db_domain =''

*. Db_file_multiblock_read_count = 16

*. Db_name = 'rac'

*. Dispatchers = '(PROTOCOL = TCP) (SERVICE = racXDB )'

*. Job_queue_processes = 10

*. Log_archive_dest_1 = 'location =/home/oracle/oradata/rac/archive'

*. Log_archive_format = 'Log _ % t _ % s _ % r. arc'

*. Open_cursors = 300

*. Pga_aggregate_target = 16777216

*. Processses = 150

*. Remote_login_passwordfile = 'clusive'

*. Sga_target = 167772160

*. Undo_management = 'auto'

*. Undo_tablespace = 'undotbs1'

*. User_dump_dest = '/home/oracle/admin/rac/udump'

*. STANDBY_ARCHIVE_DEST = '/home/oracle/oradata/rac/standbyarchive'

*. Fal_server = 'rac1'

*. Fal_client = 'rac3'

*. STANDBY_FILE_MANAGEMENT = 'auto'

*. DB_FILE_NAME_CONVERT = '/home/oracle/oradata/rac/', '/home/oracle/oradata/rac /'

*. LOG_FILE_NAME_CONVERT = '/home/oracle/oradata/rac/archivelog', '/home/oracle/oradata/rac/archivelog'



/Home/oracle/oradata/rac/standbyarchive must be created.

Upload the password file orapwrac from the master database to the corresponding location on the secondary database rac3.



Start secondary database rac3

Oracle @ rac3 $ sqlplus '/as sysdba'



SQL> startup nomount;

ORACLE instance started.



SQL> alter database mount standby database;

Database altered.



SQL> alter database recover managed standby database disconnect from session;

Database altered.

Archive path set on the master database to the secondary database rac3

Oracle @ rac1 $ sqlplus '/as sysdba'

SQL> alter system set log_archive_dest_2 = 'service = rac3 mandatory reopen = 60 ';

System altered.

Defines the master database to transmit logs to the slave Database

# Define archiving to the slave database, force archiving, and retry time 60 seconds.
# If it is defined as an optional state (optional), archive will not be attempted again after the archive fails. Definition
# If the archiving fails after the status is madatory, the next log will be archived again.



SQL> select * from v $ log;

GROUP # THREAD # SEQUENCE # bytes members archiv status FIRST_CHANGE # FIRST_TIME

1 1 0 52428800 1 YES UNUSED

2 1 0 52428800 1 yes unused 0

3 1 1 52428800 1 no current 446075 13:41:10



SQL> alter system switch logfile;

System altered.



SQL> select * from v $ log;

GROUP # THREAD # SEQUENCE # bytes members archiv status IRST_CHANGE # FIRST_TIME

----------------------------------------------------------------

1 1 2 52428800 1 no current 457776 23:47:06

2 1 0 52428800 1 yes unused 0

3 1 1 52428800 1 no active 446075 13:41:10



View alert logs on the secondary Database

Oracle @ rac3 $ tail-f alert_rac.log

Mon Jul 9 18:50:51 2007

Completed: alter database recover managed standby database disconnect from session

Mon Jul 9 18:50:51 2007

Clearing online redo logfile 3 complete

Media Recovery Log/home/oracle/oradata/rac/standbyarchive/log_00000000626449270.arc

Media Recovery Log/home/oracle/oradata/rac/standbyarchive/log_1_2_626449270.arc

Media Recovery Log/home/oracle/oradata/rac/standbyarchive/log_1_3_626449270.arc

Media Recovery Log/home/oracle/oradata/rac/standbyarchive/log_1_4_626449270.arc

Media Recovery Log/home/oracle/oradata/rac/standbyarchive/log_rj5_626449270.arc

Media Recovery Waiting for thread 1 sequence 6



Mon Jul 9 18:54:03 2007

Redo Shipping Client Connected as PUBLIC

-- Connected User is Valid

RFS [1]: Assigned to RFS process 3025

RFS [1]: Identified database type as 'physical standby'

Mon Jul 9 18:54:03 2007

RFS LogMiner: Client disabled from further notification

  • 1
  • 2
  • Next Page
[Content navigation]
Page 1st: 10G deployment uard configuration under Centos 4.4 (on) Page 2nd: 10G deployment uard configuration under Centos 4.4 (lower)

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.