2、baeIP:192.168.18.1ORACLE_SID=db1db_unique_name=db13.standbydatabaseIP:192.168.18.2ORACLE_SID=standbydb_unique_name=standby二,主数据库(db1)做准备1.设置主数据库为Forcelogging1.SQL> alter database force logging; 2.创建密码文件1.cd $ORACLE_HOME/dbs/ 2.orapwdfile=orapwdb1 pas
3、sword= force=y 3.修改主库的初始化参数1.alter system set log_archive_config='dg_config=(db1,standby)' scope=both; 1.alter system set log_archive_dest_1='location=/u01/db1/arch' scope=both; 2.alter system set db_unique_name='db1' scope=both; 4.生成数据库备份1.RMAN> co
4、nnect target sys/ 2.RMAN> backup database format='/oracle/rmanback/%d_%s.dbf' plus archivelog; 3.[oracle@oracle rmanback]$ ls 4.DB1_1.dbfDB1_2.dbf 5.生成备库的controlfile1.SQL>alter database create standby controlfile as '/oracle/rmanback/ctontrl01.ctl 6
5、.配置listener.ora和tnsnames.ora文件启动lintener.ora,1.[oracle@oracle dbs]$ lsnrctl status 2.LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 14-JUN-2009 02:54:29 3.Service "db1" has 1 instance(s). 4.Instance "db1", status READY, has 1 handler(s) for thi
6、s service... 5.Service "db1_XPT" has 1 instance(s). 6.Instance "db1", status READY, has 1 handler(s) for this service... 7.The command completed successfully 配置rnsnames.ora1.vi $ORACLE_HOME/network/admin/tnsnames.ora 2.db1 = 3. (DESCRIPTION = 4.