物理dataguard傻瓜实战
物理dataguard傻瓜实战一、环境1、环境准备虚拟机连接方式:注意连接方式虚拟机net,同时点击edit,查看虚拟机网段操作系统:Red Hat Enterprise Linux Server release 5.1 (Tikanga)主库地址:192.168.220.3--虚拟机,安装数据库备库地址:192.168.220.4--虚拟机,未安装数据库,只安装软件检查数据库版本必须一致:select * from v$version;BANNER----------------------------------------------------------------Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - ProdPL/SQL Release 10.2.0.1.0 - ProductionCORE 10.2.0.1.0 ProductionTNS for Linux: Version 10.2.0.1.0 - ProductionNLSRTL Version 10.2.0.1.0 - Production检查db_name、sid必须一致select instance_name from v$instance;INSTANCE_NAME----------------orclSQL> show parameter db_nameNAME TYPE VALUE------------------------------------ ----------- ------------------------------db_name string ice二、主库配置1、open数据库,SQL> alter database force logging;2、确认归档:SQL> archive log list;数据库日志模式 存档模式自动存档 启用最早的联机日志序列 6下一个存档日志序列 10当前日志序列 103、修改主库tnsnames(增加备库服务命名只修改ip,数据库名和主库一致)# tnsnames.ora Network Configuration File: /home/app/oracle10/product/10.2.0.1/network/admin/tnsnames.ora# Generated by Oracle configuration tools.orcl =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.220.3)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))orcl2204 =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.220.4)(PORT = 1521)))(CONNECT_DATA =(SERVICE_NAME = orcl)))EXTPROC_CONNECTION_DATA =(DESCRIPTION =(ADDRESS_LIST =(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0)))(CONNECT_DATA =(SID = PLSExtProc)(PRESENTATION = RO)))4、监听配置:# listener.ora Network Configuration File: /home/app/oracle10/product/10.2.0.1/network/admin/listener.ora# Generated by Oracle configuration tools.SID_LIST_LISTENER =(SID_LIST =(SID_DESC =(SID_NAME = PLSExtProc)(ORACLE_HOME = /home/app/oracle10/product/10.2.0.1)(PROGRAM = extproc))(SID_DESC =(SID_NAME = orcl)(ORACLE_HOME = /home/app/oracle10/product/10.2.0.1)))LISTENER =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.220.3)(PORT = 1521))(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC0))))5、虚拟机上测试是否能连主库,注意连接方式虚拟机net,同时点击edit,查看虚拟机网段本次虚拟机ip:192.168.220.3[oracle@localhost ~]$ sqlplus /nologSQL*Plus: Release 10.2.0.1.0 - Production on Fri May 3 08:24:19 2013Copyright (c) 1982, 2005, Oracle. All rights reserved.SQL> conn system/orcl@orcl1Connected.6、创建pfile--主库SQL> conn sys/orcl@orcl1 as sysdba已连接。SQL> create pfile ='/home/app/oracle10/initorcl.ora' from spfile;文件已创建。7、修改参数文件:[oracle@localhost dbs]$ cat initorcl.oraorcl.__db_cache_size=92274688orcl.__java_pool_size=4194304orcl.__large_pool_size=4194304orcl.__shared_pool_size=62914560orcl.__streams_pool_size=0*.audit_file_dest='/home/app/oracle10/admin/ice/adump'*.background_dump_dest='/home/app/oracle10/admin/ice/bdump'*.compatible='10.2.0.1.0'*.control_files='/home/app/oracle10/oradata/ice/control01.ctl','/home/app/oracle10/oradata/ice/control02.ctl','/home/app/oracle10/oradata/ice/control03.ctl'*.core_dump_dest='/home/app/oracle10/admin/ice/cdump'*.db_block_size=8192*.db_domain='orcl'*.db_file_multiblock_read_count=16*.db_name='ice'*.db_recovery_file_dest='/home/app/oracle10/flash_recovery_area'*.db_recovery_file_dest_size=2147483648*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'*.job_queue_processes=10*.open_cursors=300*.pga_aggregate_target=16777216*.processes=150*.remote_login_passwordfile='EXCLUSIVE'*.sga_target=167772160*.undo_management='AUTO'*.undo_tablespace='UNDOTBS1'*.user_dump_dest='/home/app/oracle10/admin/ice/udump'*.LOG_ARCHIVE_CONFIG='DG_CONFIG=(orcl,orcl2204)'log_archive_dest_1='LOCATION=/home/app/oracle10/archive01 VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=orcl 'log_archive_dest_state_1=enablelog_archive_dest_2='SERVICE=orcl2204 LGWR ASYNC=40960 VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=orcl2204 'log_archive_dest_state_2=enablelog_archive_start=truelog_archive_format='%t_%s_%r.arc'log_archive_max_processes=2fal_server=orcl2204fal_client=orcldb_unique_name=orcl8、创建口令文件-主库orapwd file=/home/app/oracle10/orapworcl password=oracle entries=59、启动主库到mount,创建控制文件SQL> startup mountORA-32004: obsolete and/or deprecated parameter(s) specifiedORACLE 例程已经启动。Total System Global Area 612368384 bytesFixed Size 1292036 bytesVariable Size 411044092 bytesDatabase Buffers 192937984 bytesRedo Buffers &n上一个:oracle时间与字符串转换
下一个:oracle9i的sys用户登录