搭建Oracle 11G单实例Active DataGuard

Oracle 11G单实例ActiveDataGuard

1.基础环境准备

1.1基础环境说明:

操作系统:RHEL 5.5 64bit

数据库版本:Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit

1.2数据库服务名称及目录说明:


主库


备库


IP地址


192.168.4.157


192.168.4.158


主机名称


primary01


standby01


db_name


testdb


testdb


db_unique_name


pri_db


std_db


service_names


pri_db


std_db


local_listener


pri_1522


std_1522


监听端口


1522


1522


基目录


/u01/app/oracle


/u01/app/oracle


数据文件目录


/u01/app/oradata/testdb


/u01/app/oradata/testdb


归档日志目录


/u01/app/archivelog/testdb


/u01/app/archivelog/testdb


RMAN备份目录


/u01/app/rman_backup/


/u01/app/rman_backup/

1.3环境准备:

1.3.1修改主、备库hosts文件:

# cat /etc/hosts

192.168.4.157   primary01

192.168.4.158   standby01

1.3.2修改主、备库监听文件:

$ cat tnsnames.ora

pri_1522 =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS =(PROTOCOL = TCP)(HOST = primary01)(PORT = 1522))

)

(CONNECT_DATA =

(SERVICE_NAME =pri_db)

)

)

std_1522 =

(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS =(PROTOCOL = TCP)(HOST = standby01)(PORT = 1522))

)

(CONNECT_DATA =

(SERVICE_NAME =std_db)

)

)

2.主库准备工作

2.1置于在mount状态,修改数据库force logging,开启归档。

SQL> SELECT name,log_mode, force_logging, open_mode FROM v$database;

NAME    LOG_MODE   FOR OPEN_MODE

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

TESTDB   NOARCHIVELOG NO MOUNTED

SQL> alterdatabase force logging;

SQL> alterdatabase archivelog;

SQL> alterdatabase open;

SQL> SELECT name,log_mode, force_logging, open_mode FROM v$database;

NAME    LOG_MODE   FOR OPEN_MODE

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

TESTDB   ARCHIVELOG  YES READ WRITE

2.2动态注册1522端口

SQL> show parameter local_listener;

NAME                 TYPE      VALUE

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

local_listener            string   pri_1522

[[email protected] ~]$ lsnrctl status

2.3主库确定采用口令认证

SQL> show parameter password;

NAME                 TYPE      VALUE

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

remote_login_passwordfile       string   EXCLUSIVE

2.4主库配置LOG_ARCHIVE_CONFIG参数

此参数用于控制发送归档日志到远程位置、接收远程归档日志,并指定Data Guard配置的惟一数据库名。

SQL> show parameter log_archive_config;

NAME                 TYPE      VALUE

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

log_archive_config          string

SQL> alter system set log_archive_config=‘dg_config=(pri_db,std_db)‘;

SQL> show parameter log_archive_config;

NAME                 TYPE      VALUE

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

log_archive_config          string   dg_config=(pri_db,std_db)

2.5配置log_archive_dest_1日志归档路径:

SQL> show parameter log_archive_dest_1;

NAME                 TYPE      VALUE

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

log_archive_dest_1          string

SQL> alter system setlog_archive_dest_1=‘location=/u01/app/archivelog/testdbvalid_for=(all_logfiles,all_roles) db_unique_name=pri_db‘;

SQL> show parameter log_archive_dest_1;

NAME                 TYPE      VALUE

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

log_archive_dest_1          string   location=/u01/app/archivelog/t

estdb valid_for=(all_logfiles,

all_roles) db_unique_name=pri_

db

SQL> SELECT group#, sequence#, archived, status FROM v$log;

GROUP#   SEQUENCE# ARC STATUS

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

1     4 YES INACTIVE

2     5 YES INACTIVE

3     6 NO CURRENT

SQL> alter system switch logfile;

SQL> alter system switch logfile;

SQL> alter system switch logfile;

SQL> SELECT group#, sequence#, archived, status FROM v$log;

GROUP#   SEQUENCE# ARC STATUS

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

1     7 YES INACTIVE

2     8 YES INACTIVE

3     9 NO CURRENT

2.6为备库准备pfile样例

SQL> show parameter spfile;

NAME                 TYPE      VALUE

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

spfile                string    /u01/app/oracle/product/11.2.0

/db_1/dbs/spfiletestdb.ora

SQL> create pfile from spfile;

2.7主库做RMAN全备

[[email protected] ~]$ rman target /

RMAN> list archivelog all;

using target database control file instead of recovery catalog

List of Archived Log Copies for database with db_unique_namePRI_DB

=====================================================================

Key   Thrd Seq   S Low Time

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

1    1  6    A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_6_905435865.dbf

2    1  7    A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_7_905435865.dbf

3    1  8    A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_8_905435865.dbf

RMAN> report need backup;

RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

Report of files with less than 1 redundant backups

File #bkps Name

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

1    0     /u01/app/oradata/testdb/system01.dbf

2    0     /u01/app/oradata/testdb/sysaux01.dbf

3    0     /u01/app/oradata/testdb/undotbs01.dbf

4    0     /u01/app/oradata/testdb/users01.dbf

5    0     /u01/app/oradata/testdb/example01.dbf

RMAN> run {

2>  allocatechannel c1 type disk;

3>  allocatechannel c2 type disk;

4>  allocatechannel c3 type disk;

5>  backup database format‘/u01/app/rman_backup/Full_%U.bak‘;

6>  backup archivelog all format‘/u01/app/rman_backup/Arc_%U.bak‘;

7>  releasechannel c1;

8>  releasechannel c2;

9>  releasechannel c3; }

2.8建立备库control文件

RMAN> backup device type disk format‘/u01/app/rman_backup/Standby_%U.ctl‘ current controlfile for standby;

2.9将主库的备份集、口令文件、pfile传至备库

说明主、备库的sys用户密码需要相同:

[[email protected] ~]$ ls -lh /u01/app/rman_backup/

total 1.2G

-rw-r----- 1 oracle oinstall 9.8M Mar  2 14:49 Arc_06qvfpo8_1_1.bak

-rw-r----- 1 oracle oinstall 3.5K Mar  2 14:49 Arc_07qvfpo8_1_1.bak

-rw-r----- 1 oracle oinstall 10K Mar  2 14:49Arc_08qvfpo8_1_1.bak

-rw-r----- 1 oracle oinstall 590M Mar  2 14:49 Full_01qvfpl5_1_1.bak

-rw-r----- 1 oracle oinstall 359M Mar  2 14:49 Full_02qvfpl5_1_1.bak

-rw-r----- 1 oracle oinstall 163M Mar  2 14:49 Full_03qvfpl6_1_1.bak

-rw-r----- 1 oracle oinstall 9.4M Mar  2 14:49 Full_04qvfpnr_1_1.bak

-rw-r----- 1 oracle oinstall 96K Mar  2 14:49Full_05qvfpo4_1_1.bak

-rw-r----- 1 oracle oinstall 9.4M Mar  2 14:53 Standby_09qvfpuo_1_1.ctl

$ scp /u01/app/rman_backup/* standby01:/u01/app/rman_backup/

$ scp /u01/app/oracle/product/11.2.0/db_1/dbs/orapwtestdb     standby01:/u01/app/oracle/product/11.2.0/db_1/dbs/orapwtestdb

$ scp /u01/app/oracle/product/11.2.0/db_1/dbs/inittestdb.ora  standby01:/u01/app/oracle/product/11.2.0/db_1/dbs/inittestdb.ora

3.备库准备工作:

3.1备库参数文件配置:

[[email protected] ~]$ cat/u01/app/oracle/product/11.2.0/db_1/dbs/initphydb.ora

testdb.__db_cache_size=197132288

testdb.__java_pool_size=4194304

testdb.__large_pool_size=4194304

testdb.__oracle_base=‘/u01/app/oracle‘#ORACLE_BASE set fromenvironment

testdb.__pga_aggregate_target=222298112

testdb.__sga_target=331350016

testdb.__shared_io_pool_size=0

testdb.__shared_pool_size=117440512

testdb.__streams_pool_size=0

*.audit_file_dest=‘/u01/app/oracle/admin/testdb/adump‘

*.audit_trail=‘db‘

*.compatible=‘11.2.0.0.0‘

*.control_files=‘/u01/app/oradata/testdb/control01.ctl‘,‘/u01/app/oradata/testdb/control02.ctl‘

*.db_block_size=8192

*.db_domain=‘‘

*.db_name=‘testdb‘

*.db_file_name_convert=‘/u01/app/oradata/testdb‘,‘/u01/app/oradata/testdb‘

*.db_recovery_file_dest=‘/u01/app/oracle/flash_recovery_area‘

*.db_recovery_file_dest_size=4294967296

*.db_unique_name=‘std_db‘

*.diagnostic_dest=‘/u01/app/oracle‘

*.dispatchers=‘(PROTOCOL=TCP) (SERVICE=testdbXDB)‘

*.fal_client=‘std_1522‘

*.fal_server=‘pri_1522‘

*.local_listener=‘std_1522‘

*.log_archive_config=‘dg_config=(pri_db,std_db)‘

*.log_archive_dest_1=‘location=/u01/app/archivelog/testdbvalid_for=(all_logfiles,all_roles) db_unique_name=std_db‘

*.log_file_name_convert=‘/u01/app/oradata/testdb‘,‘/u01/app/oradata/testdb‘

*.memory_target=553648128

*.open_cursors=300

*.processes=250

*.remote_login_passwordfile=‘EXCLUSIVE‘

*.standby_file_management=‘auto‘

*.service_names=‘std_db‘

*.sessions=280

*.undo_tablespace=‘UNDOTBS1‘

以上红色字段为新建目录,***并标红字段为新增内容。

db_unique_name可以与主库不同。

db_file_name_convert、log_file_name_convert参数是做数据文件、日志文件的路径转换用,本文档可以省略。

转换:

*.db_file_name_convert=‘/u01/app/oradata/testdb‘,‘/u01/app/oradata/phydb‘

fal是Fetch Archive Log的简写,它是dataguard主备之间GAP的处理机制。

当Primary Database的某些日志没有成功发送到Standby Database,这时候发生饿了归档裂缝(Archive Gap)。

Primary上不会有GAP,所以fal_server和fal_client也是只在standby上生效的参数,当然为了switch over需要同样会在primary端进行预设置。

缺失的这些日志就是裂缝(Gap),Data Guard能够自动检测,解决归档裂缝,不需要DBA的介入。

3.2创建相应目录及备份集文件检查:

[[email protected] ~]$ mkdir -p/u01/app/oracle/admin/testdb/adump

[[email protected] ~]$ mkdir -p /u01/app/oradata/testdb/

[[email protected] ~]$ mkdir -p/u01/app/oracle/flash_recovery_area

[[email protected] ~]$ mkdir -p /u01/app/archivelog/testdb

[[email protected] ~]$ ls -lh /u01/app/rman_backup/

total 1.2G

-rw-r----- 1 oracle oinstall 9.8M Mar  2 14:54 Arc_06qvfpo8_1_1.bak

-rw-r----- 1 oracle oinstall 3.5K Mar  2 14:54 Arc_07qvfpo8_1_1.bak

-rw-r----- 1 oracle oinstall 10K Mar  2 14:54Arc_08qvfpo8_1_1.bak

-rw-r----- 1 oracle oinstall 590M Mar  2 14:55 Full_01qvfpl5_1_1.bak

-rw-r----- 1 oracle oinstall 359M Mar  2 14:55 Full_02qvfpl5_1_1.bak

-rw-r----- 1 oracle oinstall 163M Mar  2 14:55 Full_03qvfpl6_1_1.bak

-rw-r----- 1 oracle oinstall 9.4M Mar  2 14:55 Full_04qvfpnr_1_1.bak

-rw-r----- 1 oracle oinstall 96K Mar  2 14:55Full_05qvfpo4_1_1.bak

-rw-r----- 1 oracle oinstall 9.4M Mar  2 14:55 Standby_09qvfpuo_1_1.ctl

3.3创建spfile文件,并将备库置于nomount状态

[[email protected] ~]$ sqlplus / as sysdba

SQL> create spfile from pfile;

SQL> startup nomount;

SQL> show parameter pfile;

NAME                 TYPE      VALUE

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

spfile                string   /u01/app/oracle/product/11.2.0

/db_1/dbs/spfiletestdb.ora

3.4恢复备库的控制文件,并将数据库至于mount状态,restore数据文件:

[[email protected] ~]$ rman target /

RMAN> restore standby controlfile from‘/u01/app/rman_backup/Standby_09qvfpuo_1_1.ctl‘;

RMAN> alter database mount;

RMAN> run {

2>  allocate channelc1 type disk;

3>  allocate channelc2 type disk;

4>  allocate channelc3 type disk;

5>  restore database;

6>  release channelc1;

7>  release channelc2;

8>  release channelc3; }

4.创建物理备库

4.1主库状态查看

SQL> column db_unique_name format a10;

SQL> SELECT db_unique_name, name, switchover_status,database_role, open_mode FROM v$database;

DB_UNIQUE_ NAME   SWITCHOVER_STATUS   DATABASE_ROLE  OPEN_MODE
---------- --------- -------------------- ---------------- --------------------
testdb   TESTDB  NOT ALLOWED      PRIMARY     READ WRITE

4.2备库状态查看

SQL> column db_unique_name format a10;

SQL> SELECT db_unique_name, name, switchover_status, database_role, open_mode FROM v$database;

DB_UNIQUE_ NAME   SWITCHOVER_STATUS   DATABASE_ROLE  OPEN_MODE
---------- --------- -------------------- ---------------- --------------------
std_db   TESTDB  NOT ALLOWED      TO PRIMARY    READ WRITE

4.3备库查看数据文件、控制文件、日志文件、确认开启日志归档

SQL> column name format a40;

SQL> SELECT name FROM v$datafile;

NAME

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

/u01/app/oradata/testdb/system01.dbf

/u01/app/oradata/testdb/sysaux01.dbf

/u01/app/oradata/testdb/undotbs01.dbf

/u01/app/oradata/testdb/users01.dbf

/u01/app/oradata/testdb/example01.dbf

SQL> SELECT name FROM v$controlfile;

NAME

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

/u01/app/oradata/testdb/control01.ctl

/u01/app/oradata/testdb/control02.ctl

SQL> col member format a45;

SQL> SELECT *FROM v$logfile order by group#;

GROUP# STATUS  TYPE  MEMBER                       IS_

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

1     ONLINE /u01/app/oradata/testdb/redo01.rdo      NO

2     ONLINE /u01/app/oradata/testdb/redo02.rdo      NO

3      ONLINE /u01/app/oradata/testdb/redo02.rdo      NO

SQL> archive log list;

Database log mode          Archive Mode

Automatic archival         Enabled

Archive destination        /u01/app/archivelog/testdb

Oldest online log sequence     8

Next log sequence to archive    10

Current log sequence        10

4.4备库创建Standby Redo Log组数

公式如下:

如果主库是单实例库:Standby Redo Log组数=主库日志组总数 + 1

如果主库是RAC环境:Standby Redo Log组数=(所有节点中日志组数最大值 + 1) * RAC节点数

SQL> alter database add standby logfile thread 1 group 4‘/u01/app/oradata/testdb/stdredo04.rdo‘ size 50m;

SQL> alter database add standby logfile thread 1 group 5‘/u01/app/oradata/testdb/stdredo05.rdo‘ size 50m;

SQL> alter database add standby logfile thread 1 group 6‘/u01/app/oradata/testdb/stdredo06.rdo‘ size 50m;

SQL> alter database add standby logfile thread 1 group 7‘/u01/app/oradata/testdb/stdredo07.rdo‘ size 50m;

SQL> SELECT *FROM v$logfile order by group#;

GROUP# STATUS  TYPE  MEMBER                       IS_

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

1     ONLINE /u01/app/oradata/testdb/redo01.rdo      NO

2     ONLINE /u01/app/oradata/testdb/redo02.rdo      NO

3      ONLINE /u01/app/oradata/testdb/redo02.rdo      NO

4     STANDBY /u01/app/oradata/testdb/stdredo04.rdo    NO

5     STANDBY /u01/app/oradata/testdb/stdredo05.rdo    NO

6     STANDBY /u01/app/oradata/testdb/stdredo06.rdo    NO

7     STANDBY /u01/app/oradata/testdb/stdredo07.rdo    NO

4.5备库listener注册状态查看

SQL> show parameter local_listener;

NAME                 TYPE     VALUE

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

local_listener            string   std_1522

[[email protected] ~]$ ps -ef | grep tns

oracle   10706 10665  0 15:42 pts/0    00:00:00 grep tns

[[email protected] ~]$ lsnrctl start

4.6主库修改归档参数LOG_ARCHIVE_DEST_2

SQL> show parameter log_archive_dest_1;

NAME                 TYPE     VALUE

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

log_archive_dest_1          string   location=/u01/app/archivelog/t

estdb valid_for=(all_logfiles,

all_roles) db_unique_name=pri_

db

SQL> show parameter log_archive_dest_2;

NAME                 TYPE     VALUE

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

log_archive_dest_2          string

SQL> alter system set log_archive_dest_2=‘service=std_1522 lgwr sync valid_for=(online_logfiles,primary_role) db_unique_name=std_db‘;

SQL> show parameter log_archive_dest_2;

NAME                 TYPE      VALUE

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

log_archive_dest_2          string    service=std_1522 lgwr sync val

id_for=(online_logfiles,primar

y_role) db_unique_name=std_db

4.7主库切换日志,让其产生归档日志:

SQL> SELECT group#, thread#, sequence#, members, archived, status FROM v$log;

GROUP#   THREAD#  SEQUENCE#  MEMBERS ARC STATUS

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

1     1     10      1 YES INACTIVE

2     1     11      1 NO CURRENT

3     1     9      1 YES INACTIVE

SQL> alter systemswitch logfile;

SQL> alter systemswitch logfile;

SQL> alter systemswitch logfile;

4.8主库查看归档日志传送状态:

SQL> SELECT process, client_process, sequence#, status FROMv$managed_standby;

PROCESS  CLIENT_P SEQUENCE# STATUS

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

ARCH     ARCH     13 CLOSING

ARCH     ARCH     10 CLOSING

ARCH     ARCH     0 CONNECTED

ARCH     ARCH     12 CLOSING

LGWR     LGWR     14 WRITING

SQL> SELECT group#, thread#, sequence#, members, archived,status FROM v$log;

GROUP#    THREAD# SEQUENCE#    MEMBERS ARC STATUS

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

1          1         13          1 YES INACTIVE

2          1         14          1 NO CURRENT

3          1         12          1 YES INACTIVE

5.验证Active Data Guard

5.1备库查看是否接受到来自主库的归档日志:

[[email protected] ~]$ rman target /

RMAN> list archivelog all;

using target database control file instead of recovery catalog

List of Archived Log Copies for database with db_unique_nameSTD_DB

=====================================================================

Key     Thrd Seq     S Low Time

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

3       1    9      A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_9_905435865.dbf

1       1    10     A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_10_905435865.dbf

2       1    11     A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_11_905435865.dbf

4       1    12     A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_12_905435865.dbf

5       1    13     A 02-MAR-16

Name:/u01/app/archivelog/testdb/1_13_905435865.dbf

5.2备库查看日志的应用状态:

SQL> column name format a50;

SQL> set line 200;

SQL> SELECT thread#, sequence#, name, applied FROMv$archived_log order by sequence#;

THREAD#  SEQUENCE# NAME                                               APPLIED

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

1         10 /u01/app/archivelog/testdb/1_10_905435865.dbf      NO

1         11 /u01/app/archivelog/testdb/1_11_905435865.dbf      NO

5.3备库应用日志

5.3.1应用日志

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

5.3.2查看备库日志的应用状态:

SQL> SELECT thread#, sequence#, name, applied FROMv$archived_log order by sequence#;

THREAD#  SEQUENCE# NAME                                               APPLIED

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

1         10 /u01/app/archivelog/testdb/1_10_905435865.dbf      NO

1         11 /u01/app/archivelog/testdb/1_11_905435865.dbf      NO

5.3.3备库查看日志传送状态:

SQL> SELECT process, client_process, sequence#, status FROMv$managed_standby;

PROCESS   CLIENT_P  SEQUENCE# STATUS

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

ARCH      ARCH             11 CLOSING

ARCH      ARCH              0 CONNECTED

ARCH      ARCH              0 CONNECTED

ARCH      ARCH             12 CLOSING

RFS       LGWR             13 IDLE

RFS       UNKNOWN           0 IDLE

RFS       N/A               0 IDLE

MRP0      N/A              13 APPLYING_LOG

RFS       UNKNOWN           0 IDLE

5.4将备库置于open状态(11G新特性redo only with apply)

5.4.1打开备库

SQL> columndb_unique_name format a10;

SQL> column nameformat a10;

SQL> alterdatabase open;

alter database open

*

ERROR at line 1:

ORA-10456: cannotopen standby database; media recovery session may be in progress

5.4.2备库取消应用日志,并打开(read only):

SQL> alterdatabase recover managed standby database cancel;

SQL> alterdatabase open;

SQL> SELECT dbid,db_unique_name, name, switchover_status, database_role, open_mode, current_scnFROM v$database;

DBID DB_UNIQUE_ NAME       SWITCHOVER_STATUS    DATABASE_ROLE    OPEN_MODE            CURRENT_SCN

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

2688763992std_db     TESTDB     NOT ALLOWED          PHYSICAL STANDBY READ ONLY                1032531

5.4.3备库应用日志(redo only with apply):

SQL> alterdatabase recover managed standby database using current logfile disconnect fromsession;

SQL> SELECT dbid,db_unique_name, name, switchover_status, database_role, open_mode, current_scnFROM v$database;

DBID DB_UNIQUE_ NAME       SWITCHOVER_STATUS    DATABASE_ROLE    OPEN_MODE            CURRENT_SCN

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

2688763992std_db     TESTDB     NOT ALLOWED          PHYSICAL STANDBY READ ONLY                1032722

SQL> SELECTthread#, sequence#, name, applied FROM v$archived_log order by sequence#;

THREAD# SEQUENCE# NAME                                              APPLIED

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

1          9/u01/app/archivelog/testdb/1_9_905435865.dbf       YES

1         10/u01/app/archivelog/testdb/1_10_905435865.dbf      YES

1         11/u01/app/archivelog/testdb/1_11_905435865.dbf      YES

1         12/u01/app/archivelog/testdb/1_12_905435865.dbf      YES

1         13/u01/app/archivelog/testdb/1_13_905435865.dbf      YES

5.4.5在主库上创建表做数据测试:

5.4.5.1主库建表,并插入数据:

SQL> SELECTusername, account_status FROM dba_users WHERE username=‘HR‘;

USERNAME                       ACCOUNT_STATUS

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

HR                             OPEN

SQL> create tablehr.table1(id int, name varchar2(20));

SQL> insert intohr.table1 values (01, ‘Active DataGuard‘);

SQL> SELECT *FROM hr.table1;

ID         NAME

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

1 Active DataGuard

SQL> commit;

5.4.5.2备库验证

SQL> SELECT *FROM hr.table1;

ID         NAME

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

1 Active DataGuard

时间: 2025-01-01 09:48:56

搭建Oracle 11G单实例Active DataGuard的相关文章

Linux平台oracle 11g单实例 安装部署配置 快速参考

1.重建主机的Oracle用户 组 统一规范 uid gid 以保证共享存储挂接或其他需求的权限规范 userdel -r oracle groupadd -g 500 oinstall groupadd -g 501 dba useradd -g oinstall -G dba -u 500 oracle #id oracle uid=500(oracle) gid=500(oinstall) 组=500(oinstall),501(dba) 2.安装好Oracle 需要的rpm包.安装rpm

VM虚拟机下在LINUX上安装ORACLE 11G单实例数据库

VM虚拟机下在LINUX上安装ORACLE 11G单实例数据库 1.环境及安装前规划:虚拟机及OS如下 环境:VMware Wordstation ACE版 6.0.2 操作系统:OracleLinux-R5-U8-Server-i386-dvd    3.2G 安装操作系统,这里需要注意的是磁盘空间要预留足够. 我的规划是: 虚拟机分配1024M内存,当然如果主机内存足够,安装时内存设置2048M可以更快. 虚拟机分配一块磁盘,30G磁盘空间. /boot 100M ext3 /    20G

Oracle 11g单实例RMAN恢复到Oracle 11g RAC

一.环境说明 操作系统版本: RHEL 6.5 x64 1. 源数据库服务器 Oracle版本: Oracle 11g 11.2.0.4 64位(单机)Oracle_SID: orcl db_name   : orcl 背景:一台生产oracle10g(10.2.0.5)数据库计划迁移到Oracle 11.2.0.4.0 RAC.1) 先oracle10g(10.2.0.5)升级到Oracle 11.2.0.4(过程略)2)再Oracle 11.2.0.4单实例迁移到Oracle 11.2.0.

在 Oracle Linux 6.5 上安装 Oracle 11g 单实例数据库

Oracle数据库预安装任务 检查硬件要求 系统必须满足下面最小的硬件要求 内存要求 Minimum: 1 GB of RAMRecommended: 2 GB of RAM or more To determine the RAM size, enter the following command: # grep MemTotal /proc/meminfo The following table describes the relationship between the installed

Oracle 11G单实例安装

最近因为工作原因需要使用到Oracle数据库,所以必须要使用Oracle的数据库,刚好需要安装Oracle数据库在此就简单的做一下整理.Oracle的安装无论是在Windows下还是在Unix系统下都建议使用图形界面安装,这样可以具体的看到报错信息,在Windows上安装没有什么难度,安装的资料也有很多,此处就以Linux环境来说说Oracle的安装.当然在Linux上安装Oracle建议使用VNC安装以免带来不必要的问题.Oracle的安装部署配置比较复杂,大致可以分为三个部分:一.软件安装:

ORACLE 11G 单实例 磁盘文件系统 DG 归档日志删除脚本 基于RED HAT LINUX 5.3 X86 64BIT

近期做个DG的归档日志删除, [[email protected] logs]crontab -l * 8 * * * sh /home/oracle/dbscripts/del_arc.sh 该脚本分别调用 生成 删除 校验 三个脚本 cat del_arc.sh #! /bin/bash source /home/oracle/.bash_profile sh /home/oracle/dbscripts/build_del_archivelog.sh >> /home/oracle/db

Oracle_lhr_CentOS 7.3 ECS上搭建RAC 18c+单实例DG+EMCC+DG

Oracle_lhr_CentOS 7.3 ECS上搭建RAC 18c+单实例DG+EMCC+DG的FSFO快速故障转移配置 [大型连续免费公开课]Oracle 18c rac+dg+13.3的emcc部署配置(2018年最后一次免费公开课) 报名连接:https://ke.qq.com/course/315575 讲师:小麦苗 预计课时:6课时 开课时间:11月9日20点 相关软件下载地址:https://share.weiyun.com/57HUxNi 听课福利: 1.获得讲课文档pdf和课

[oracle部署实施] 基于centos7静默安装oracle 11gr2单实例数据库

基于centos7静默安装oracle 11gr2单实例数据库 1.vmware最小化安装centos7 分配20G硬盘+2G内存+nat网络 400mboot+4Gswap 去除kdump 最小化安装 并配置网络cat /etc/sysconfig/network-scripts/ifcfg-ens32BOOTPROTO="static"DEVICE="ens32"ONBOOT="yes"IPADDR=192.168.188.11NETMASK

oracle单实例通过dataguard 迁移到RAC

One instance primary to RAC standbyDataGuard Configuration: Primary standby Clusterware Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit 11g R2 Grid Infrastructure (11.2.0.4) Cluster Nodes Cltrac1 Srvrac1,srvrac2 DB_UNIQUE_NAME Test1