Oracle 11gR2 使用RMAN Duplicate复制数据库(2)


if [ \$USER = "oracle" ]; then
    if [ \$SHELL = "/bin/ksh" ]; then
                ulimit -p 16384
                ulimit -n 65536
        else
                ulimit -u 16384 -n 65536
        fi
fi
EOF


cat >> /home/oracle/.bash_profile <<EOF
export TMP=/tmp
export TMPDIR=\$TMP
export EDIT=vi
alias  vi=vim
export ORACLE_HOSTNAME=$hostname
export ORACLE_UNQNAME=$db_name
export ORACLE_BASE=/DBSoft/oracle
export ORACLE_HOME=\$ORACLE_BASE/product/11.2.4/dbhome_1
export ORACLE_SID=$instance_name
export ORACLE_TERM=xterm
export PATH=/usr/sbin:\$PATH
export PATH=\$ORACLE_HOME/bin:\$PATH
export LD_LIBRARY_PATH=\$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=\$ORACLE_HOME/JRE:\$ORACLE_HOME/jlib:\$ORACLE_HOME/rdbms/jlib
export NLS_LANG=AMERICAN_AMERICA AL32UTF16
umask 022
EOF

四、安装软件并创建数据库

./runInstaller -silent -debug -force -responseFile /home/oracle/database/response/db_install.rsp

dbca -silent -responsefile /home/oracle/database/response/dbca.rsp

五、开启归档

SQL> alter system set log_archive_dest_1=\'location=+FRA001/archive\' scope=spfile sid=\'woo1\';

System altered.
SQL> alter database archivelog;

Database altered.
SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRA001/archive
Oldest online log sequence 978
Next log sequence to archive 979
Current log sequence 979
SQL> alter system switch logfile;
alter system switch logfile;

System altered.

SQL>

System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRA001/archive
Oldest online log sequence 980
Next log sequence to archive 981
Current log sequence 981

六、配置静态监听
RAC节点监听信息如下:

$ cd $ORACLE_HOME/network/admin
LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = scan.woo.com)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
 
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
        (GLOBAL_DBNAME = woo.com)
        (ORACLE_HOME = /DBSoft/oracle/product/11.2.0/db_1)
        (SID_NAME = woo)
      )
  )
ADR_BASE_LISTENER = /DBSoft/oracle

单节点监听信息如下:

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.55)(PORT = 1521))
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
  )
 
SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
        (GLOBAL_DBNAME = woo.com)
        (ORACLE_HOME = /DBSoft/oracle/product/11.2.0/db_1)
        (SID_NAME = woo)
      )
  )
ADR_BASE_LISTENER = /DBSoft/oracle

配置所有节点tnsname信息如下:

WOO =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = scan.woo.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = woo)
    )
  )
 
DUPLICATE =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.55)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = woo)
    )
  )

六、启动数据库到nomount状态

SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/b4d26be5fd526d440c84378fec77732e.html