特别重要: 在修改原端参数时,必须先create pfile='/home/oracle' from spfile
1:
select log_mode
from v$database;
archive log list;
2:
select FORCE_LOGGING from
v$database;
ALTER DATABASE FORCE
LOGGING;
3:最好在目标端创建密码文件,我从原端copy过来,这次遇到归档传不过来(以前都正常)(郁闷1个多小时!!!)
重新创建密码文件好了。
orapwd file=orapwtest11g password=sys ignorecase=y
orapwd file=orapwteststby password=sys ignorecase=y
4:
添加组:
ALTER DATABASE
ADD STANDBY LOGFILE GROUP 11 '/oradata/NEY/onlinelog/stredo11.log' SIZE 512M;
ALTER DATABASE
ADD STANDBY LOGFILE GROUP 12 '/oradata/NEY/onlinelog/stredo12.log' SIZE 512M;
ALTER DATABASE
ADD STANDBY LOGFILE GROUP 13 '/oradata/NEY/onlinelog/stredo13.log' SIZE 512M;
ALTER DATABASE
ADD STANDBY LOGFILE GROUP 14 '/oradata/NEY/onlinelog/stredo14.log' SIZE 512M;
5:配置原端和目标tns及目标监听:
目标:
[oracle@erp2016 admin]$ more listener.ora
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.89.2)(PORT=1521))
)
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=proddg)
(SID_NAME=proddg)
(ORACLE_HOME=/u01/app/oracle/product/11.2/db)
)
)
[oracle@erp2016 admin]$ more tnsnames.ora
proddg =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.89.2)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = proddg)
)
)
PROD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.89.163)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PROD)
)
)
原端tns添加相同内容
6:配置原和目标参数:
6.1:目标:
*.db_file_name_convert='/u01/app/oradata','+DATA/prod/datafile'
*.log_file_name_convert='/u01/app/oradata','+RECO/prod/onlinelog/'
*.db_unique_name=PRODDG
*.log_archive_config='dg_config=(PROD,PRODDG)'
*.log_archive_dest_1='location=/u01/app/arch valid_for=(all_logfiles,all_roles) db_unique_name=PRODDG'
log_archive_format='%t_%s_%r.dbf'
*.log_archive_dest_2='service=PROD lgwr async valid_for=(online_logfiles,primary_role) db_unique_name=PROD'
*.log_archive_dest_state_1=enable
*.log_archive_dest_state_2=enable
*.fal_server=PROD
*.fal_client=PRODDG
*.standby_file_management=auto
service_names=proddb
*.db_file_name_convert='+DATA/prod/datafile','/u01/app/oradata','+DATA/prod/tempfile','/u01/app/oradata'
*.log_file_name_convert='+RECO/prod/onlinelog/','/u01/app/oradata'
原端:
ALTER SYSTEM SET LOG_ARCHIVE_CONFIG='DG_CONFIG=(PROD,proddg)' scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+RECO/prod/archivelog LGWR VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=PROD' scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_2='SERVICE=proddg ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=proddg' scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1='ENABLE' scope=both sid='*';
ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2='ENABLE' scope=both sid='*';
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT='AUTO' scope=both sid='*';
alter system set FAL_SERVER=proddg scope=both sid='*';
alter system set FAL_CLIENT=PROD scope=both sid='*';
ALTER SYSTEM SET DB_FILE_NAME_CONVERT='+DATA/prod/datafile','/u01/app/oradata' scope=spfile sid='*';
ALTER SYSTEM SET LOG_FILE_NAME_CONVERT='+RECO/prod/onlinelog/','/u01/app/oradata' scope=spfile sid='*';
7:测试联通性:
原端:
sqlplus sys/****@PROD as sysdba
目标:
sqlplus sys/****@proddg as sysdba
8:
rman target sys/oracle auxiliary sys/oracle@CMSDBDG nocatalog
RMAN> duplicate target database for standby from active
database nofilenamecheck;
--如果源库和目标库目录相同,需要加上nofilenamecheck,不同则不需要加
9:完事后:
alter
database open read only;
SQL>recover managed standby database using current logfile disconnect from session;
10:使用语句验证:
****
遇到的问题:归档传不到目标端:
copy原端的密码文件不管用!!!!!!!!!!!
没有办法, 使用如下命令重新设置密码文件,并重新启动primary 及standby .
orapwd file=orapwtest11g password=sys ignorecase=y
orapwd file=orapwteststby password=sys ignorecase=y
报Error 1031 received logging on to the standby+ora-01031: insufficient privileges
sqlplus sys/oracle@proddg as sysdba 可以连接!!!!!
阅读(6666) | 评论(0) | 转发(0) |