视频1 视频21 视频41 视频61 视频文章1 视频文章21 视频文章41 视频文章61 推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37 推荐39 推荐41 推荐43 推荐45 推荐47 推荐49 关键词1 关键词101 关键词201 关键词301 关键词401 关键词501 关键词601 关键词701 关键词801 关键词901 关键词1001 关键词1101 关键词1201 关键词1301 关键词1401 关键词1501 关键词1601 关键词1701 关键词1801 关键词1901 视频扩展1 视频扩展6 视频扩展11 视频扩展16 文章1 文章201 文章401 文章601 文章801 文章1001 资讯1 资讯501 资讯1001 资讯1501 标签1 标签501 标签1001 关键词1 关键词501 关键词1001 关键词1501 专题2001
OracleDataGuard简单配置
2020-11-09 12:06:50 责编:小采
文档


Oracle DataGuard 太恶心了,弄了这么长时间~下面我来介绍一下最简单的安装方法~1,首先装两个相同目录的oracle(可以选择不同

Oracle DataGuard 太恶心了,弄了这么长时间~下面我来介绍一下最简单的安装方法~

1,首先装两个相同目录的oracle(可以选择不同的目录),因为我用的是虚机,,所以默认装在c:\app下

2,在primary库上配置client参数,tnsnames.ora 和 listener.ora, standby上面也是同理~

SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\product\11.2.0\dbhome_1)
(PROGRAM = extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
)
(SID_DESC =
(SID_NAME = orcl)
(ORACLE_HOME = C:\app\product\11.2.0\dbhome_1)
)

)

LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.70.254)(PORT = 1521))
)
)

ORCL254 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.70.254)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

ORCL253 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.70.253)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)

3, enable logging:

进入sqlplus,执行alter database force logging;

4,查看日志是否归档

archive log list;

如果没有的话就执行,

SQL> STARTUP MOUNT;
SQL> ALTER DATABASE ARCHIVELOG;
SQL> ALTER DATABASE OPEN;

5,重新定义pfile文件

create pfile='c:\pfile.ora' from spfile

修改对应的pfile文件(其他文档说还要备份,不用累他们~),在后面加上下面这些内容

DB_UNIQUE_NAME=orcl254
LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl254,orcl253)'
LOG_ARCHIVE_DEST_1='LOCATION=c:\app\oradata\orcl\ VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl254'
LOG_ARCHIVE_DEST_2='SERVICE=orcl253 LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl253'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
FAL_SERVER=orcl
FAL_CLIENT=orcl
DB_FILE_NAME_CONVERT='oradata\orcl253','oradata\orcl254'
LOG_FILE_NAME_CONVERT='oradata\orcl253','oradata\orcl254'
STANDBY_FILE_MANAGEMENT=AUTO

执行:

create spfile from pfile='c:\pfile.ora'

下载本文
显示全文
专题