1.

[root@sf01 ~]# cat /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=sf01

[root@sf01 ~]# cat /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.130  sf01



2.安装依赖包

yum install oracle-rdbms-server-11gR2-preinstall -y


3.环境变量


export TMP=/tmp

export TMPDIR=$TMP     

export ORACLE_BASE=/u01/oracle

export ORACLE_HOME=/u01/oracle/product/11.2.0/db_1

export ORACLE_SID=FIXFL

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 EDITOR=vi    

export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'   



[root@sf01 yum.repos.d]# mkdir -p /u01/oracle/product/11.2.0/db_1

[root@sf01 yum.repos.d]# chown -R oracle:oinstall /u01/oracle

[root@sf01 yum.repos.d]# chmod -R 775 /u01/oracle



[oracle@sf01 ~]$ cd /u01/oracle/soft/

[oracle@sf01 soft]$ ls



打包oracle 家目录


tar -czvf /u01/oracle/soft/oracle_home.tar.gz /u01/oracle/product/11.2.0/db_1/


tar zxvf /u01/oracle/soft/oracle_home.tar.gz -C /u01/oracle/product/11.2.0/


perl clone.pl ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/product/11.2.0/db_1 ORACLE_HOME_NAME=OraDb11g_home1 



[oracle@sf02 bin]$ perl clone.pl ORACLE_BASE=/u01/oracle ORACLE_HOME=/u01/oracle/product/11.2.0/db_1 ORACLE_HOME_NAME=OraDb11g_home1 

./runInstaller -clone -waitForCompletion  "ORACLE_BASE=/u01/oracle" "ORACLE_HOME=/u01/oracle/product/11.2.0/db_1" "ORACLE_HOME_NAME=OraDb11g_home1" -silent -noConfig -nowait 

Starting Oracle Universal Installer...


Checking swap space: must be greater than 500 MB.   Actual 4095 MB    Passed

Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-04-10_08-31-36AM. Please wait ...Oracle Universal Installer, Version 11.2.0.4.0 Production

Copyright (C) 1999, 2013, Oracle. All rights reserved.


You can find the log of this install session at:

 /home/oracle/oraInventory/logs/cloneActions2016-04-10_08-31-36AM.log

.................................................................................................... 100% Done.




Installation in progress (Sunday, April 10, 2016 8:32:04 AM CST)

..............................................................................                                                  78% Done.

Install successful


Linking in progress (Sunday, April 10, 2016 8:32:45 AM CST)

Link successful


Setup in progress (Sunday, April 10, 2016 8:34:50 AM CST)

Setup successful


End of install phases.(Sunday, April 10, 2016 8:35:23 AM CST)

WARNING:A new inventory has been created in this session. However, it has not yet been registered as the central inventory of this system.

To register the new inventory please run the script '/home/oracle/oraInventory/orainstRoot.sh' with root privileges. 

If you do not register the inventory, you may not be able to update or patch the products you installed.

The following configuration scripts need to be executed as the "root" user.

/home/oracle/oraInventory/orainstRoot.sh

/u01/oracle/product/11.2.0/db_1/root.sh

To execute the configuration scripts:

    1. Open a terminal window

    2. Log in as "root"

    3. Run the scripts

    

The cloning of OraDb11g_home1 was successful.

Please check '/home/oracle/oraInventory/logs/cloneActions2016-04-10_08-31-36AM.log' for more details.





rman target /<<eof

run

{

allocate channel C1 device type disk;

allocate channel C2 device type disk;

sql 'alter system switch logfile';

crosscheck archivelog all;

delete noprompt expired archivelog all;

backup incremental level=0 tag='DB0'as compressed backupset database format '/u01/oracle/soft/backup/data_%U.bak';

backup current controlfile for standby format '/u01/oracle/soft/backup/ctl_%U.bak';

crosscheck backup;

delete noprompt obsolete;

delete noprompt expired backup;

delete noprompt force archivelog until time 'sysdate-16';

sql 'alter system archive log current';

backup archivelog all format '/u01/oracle/soft/backup/arc_%n_%T_%U';

release channel C1;

release channel C2;}

eof


sqlplus / as sysdba<<eoh

set lines 200 pagesize 1000;

col file_name for a100;

select file_id,file_name from dba_data_files order by 1;

create pfile='/u01/oracle/soft/backup/pfile.ora' from spfile;

exit;

eoh


主库,

*.LOG_ARCHIVE_DEST_2='SERVICE=FIXFL_DG LGWR ASYNC VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)'

*.fal_server='FIXFL_PRI'

*.fal_client='FIX