使用镜像(Redhat7.0_en_x64_Oracle12.1.0.2.0)创建两个虚拟机,删除第二个虚拟机上的数据库(startup mount exclusive restrict; drop database; )
在这个文件中增加下面3行: /etc/hosts
192.168.17.13 dg121_1 192.168.17.94 dg121_2 192.168.87.156 jia
3台机器都加,cloud control 和两台dataGuard的机器。
修改listener的配置文件,将其中的hostname改成dg121_1或dg121_2:
vi /u01/app/oracle/product/12.1.0/db_1/network/admin/listener.ora vi /u01/app/oracle/product/12.1.0/db_1/network/admin/tnsnames.ora LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = dg121_2)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl.scutech) ) )
创建口令文件:
$ orapwd file=$ORACLE_HOME/dbs/orapwcdr1 password=dingjia
检查
SQL> select * from v$pwfile_users; USERNAME SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM CON_ID ------------------------------ ----- ----- ----- ----- ----- ----- ---------- SYS TRUE TRUE FALSE FALSE FALSE FALSE 0
删除相关文件
[oracle@dg121-2 ~]$ rm $ORACLE_HOME/demo/schema/sales_history/sale1v3.dat [oracle@dg121-2 ~]$ rm $ORACLE_HOME/QOpatch/qopiprep.bat rm: remove write-protected regular file ‘/u01/app/oracle/product/12.1.0/db_1/QOpatch/qopiprep.bat’? y
安装 Cloud Control的 Agent,然后选择availability-> add standby database
删除相关文件
[oracle@dg121-2 ~]$ rm $ORACLE_HOME/demo/schema/sales_history/sale1v3.dat [oracle@dg121-2 ~]$ rm $ORACLE_HOME/QOpatch/qopiprep.bat rm: remove write-protected regular file ‘/u01/app/oracle/product/12.1.0/db_1/QOpatch/qopiprep.bat’? y