11g 12c

bootinfo -K
df -g /tmp
df -tg
for i in 3 4 5 6 7 
do
bootinfo -s hdiskpower$i
done

lsattr -E -l sys0 | egrep "maxuproc|ncargs|minpout|maxpout"
chdev -l sys0 -a 'minpout=4096 maxpout=8193' -a ncargs=1024 -a maxuproc=16384

vi /etc/security/limits
default:
fsize = -1
        core = -1
        cpu = -1
        data = -1
        rss = -1
        stack = -1
        nofiles = -1
        fsize_hard = -1
        cpu_hard = -1
        core_hard = -1
        data_hard = -1
        stack_hard = -1
        rss_hard = -1
        nofiles_hard = -1
        
        
ioo -o aio_maxreqs

lsdev | grep iocp

vmo -p -o minperm%=3
vmo -p -o maxperm%=90
vmo -p -o maxclient%=90
vmo -p -o strict_maxclient=1
vmo -p -o strict_maxperm=0
vmo -r -o page_steal_method=1


/usr/sbin/no -r -o ipqmaxlen=512
/usr/sbin/no -p -o udp_sendspace=266240
/usr/sbin/no -p -o udp_recvspace=2662400
/usr/sbin/no -p -o tcp_sendspace=65536
/usr/sbin/no -p -o tcp_recvspace=65536
/usr/sbin/no -p -o rfc1323=1
/usr/sbin/no -p -o sb_max=5324800
/usr/sbin/no -p -o tcp_ephemeral_low=9000 -o tcp_ephemeral_high=65500
/usr/sbin/no -p -o udp_ephemeral_low=9000 -o udp_ephemeral_high=65500


mkdir -p /usr/local
ln -s /etc/ssh /usr/local/etc
ln -s /usr/bin /usr/local/bin
ln -s /usr/bin/ksh /bin/bash


ssh-keygen -t rsa
ssh-keygen -t dsa

cat .ssh/id_rsa.pub >>.ssh/authorized_keys
cat .ssh/id_dsa.pub >>.ssh/authorized_keys
ssh node2 cat .ssh/id_rsa.pub >>.ssh/authorized_keys
ssh node2 cat .ssh/id_dsa.pub >>.ssh/authorized_keys

scp .ssh/authorized_keys node2:~/.ssh

ssh node2 date
ssh node2-priv date

cat /etc/hosts
11.22.33.103  ora12c1
11.22.33.104  ora12c1-vip
10.22.33.104 ora12c1-priv

22.185.183.106  ora12c2
22.185.183.107  ora12c2-vip
10.185.183.106  ora12c2-priv

11.22.33.105  ora12c-scan

echo "GETTOD_ADJ_MONOTONIC=1">>/etc/environment 
echo "slewalways yes"               >>/etc/ntp.conf 
echo "server X.X.X.X prefer"   >>/etc/ntp.conf 
echo "server X.X.X.X"          >>/etc/ntp.conf

cat /etc/rc.tcpip
start /usr/sbin/xntpd "$src_running" "-x"


mkgroup -'A' id='1023' adms='root' oinstall
mkgroup -'A' id='1024' adms='root' dba
mkgroup -'A' id='1025' adms='root' asmadmin
mkgroup -'A' id='1026' adms='root' asmdba

mkuser id='1023' pgrp='oinstall' groups='asmadmin,asmdba'       home='/home/grid'   grid
mkuser id='1024' pgrp='oinstall' groups='dba,asmdba,asmadmin'   home='/home/oracle' oracle

chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE grid
chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle

chuser rlogin=true grid
chuser rlogin=true oracle

vi /etc/ssh/sshd_config
LoginGraceTime 0


mkdir -p /oracle/app/12.2.0.1/grid --grid_home
mkdir -p /oracle/app/grid          --grid_base
mkdir -p /oracle/app/oracle        -oracle_base
chown -R grid:oinstall /oracle/app 
chown oracle:oinstall /oracle/app/oracle
chmod -R 775 /oracle/app

chdev -l hdiskpower* -a reserve_policy=no_reserve
chown grid:asmadmin /dev/rhdiskpower*
chmod 660 /dev/rhdiskpower*


vi /home/grid/.profile
#settings for grid user
if [ -t 0 ]; then
   stty intr ^C
fi
TEMP=/tmp
TMPDIR=/tmp
export AIXTHREAD_SCOPE=S
export ORACLE_BASE=/oracle/app/grid
export GI_HOME=/oracle/app/12.2.0.1/grid
export ORACLE_SID=+ASM2
export ORACLE_HOME=/oracle/app/12.2.0.1/grid
export NLS_LANG=American_America.ZHS16GBK
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_TERM=vt100
export OPATCH_PLATFORM_ID=212
export PATH=$GI_HOME/bin:$GI_HOME/OPatch:$PATH
set -o vi
export EDITOR=vi
NAME=`hostname`
PS1="[$NAME:$LOGNAME]:\${PWD}>"
umask 022


vi /home/oracle/.profile
if [ -t 0 ]; then
   stty intr ^C
fi

export AIXTHREAD_SCOPE=S
export ORACLE_BASE=/oracle/app/oracle
export ORACLE_SID=ORAC12C1
export ORACLE_HOME=/oracle/app/oracle/product/12.2.0.1/dbhome_1
export GI_HOME=/oracle/app/12.2.0.1/grid
export NLS_LANG=American_America.ZHS16GBK
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_TERM=vt100
export OPATCH_PLATFORM_ID=212
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:$PATH
set -o vi
export EDITOR=vi
NAME=`hostname`
PS1="[$NAME:$LOGNAME]:\${PWD}>"
umask 022

vi /home/root/.profile

if [ -t 0 ]; then
   stty intr ^C
fi
TEMP=/tmp
TMPDIR=/tmp
export AIXTHREAD_SCOPE=S
export ORACLE_BASE=/oracle/app/grid
export GI_HOME=/oracle/app/12.2.0.1/grid
export ORACLE_SID=+ASM2
export ORACLE_HOME=/oracle/app/12.2.0.1/grid
export NLS_LANG=American_America.ZHS16GBK
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_TERM=vt100
export OPATCH_PLATFORM_ID=212
export PATH=$GI_HOME/bin:$GI_HOME/OPatch:$PATH
set -o vi
export EDITOR=vi
NAME=`hostname`
PS1="[$NAME:$LOGNAME]:\${PWD}>"
umask 022

unzip –d /oracle/app/12.2.0.1/grid xxxx.zip
chown –R grid:oinstall /oracle/app/12.2.0.1/grid/
chmod –R 755 /oracle/app/12.2.0.1/grid

/oracle/app/12.2.0.1/grid/oui/prov/resources/scripts/sshUserSetup.sh -user grid -hosts "ora12c1 ora12c2" -advanced noPromptPassphrase
/oracle/ORACLE12C/grid]./runcluvfy.sh stage -pre crsinst -n ora12c1,ora12c2 -fixup -verbose


./rootpre.sh

$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oracle/image/26133434/26123830
$ORACLE_HOME/OPatch/opatch prereq CheckConflictAgainstOHWithDetail -phBaseDir /oracle/image/26133434/26002778

 

alter session set nls_date_format='yyyy-mm-dd hh24:mi:ss';
backup incremental level 0 database include current controlfile plus archivelog;

mkdir /tmp/oracle/recover
mkdir /tmp/oracle/dumpfiles
chown -R oracle:oinstall /tmp/oracle
RECOVER TABLE SCOTT.EMP, SCOTT.DEPT  UNTIL TIME 'SYSDATE-1' AUXILIARY DESTINATION '/tmp/oracle/recover' DATAPUMP DESTINATION '/tmp/recover/dumpfiles' DUMP FILE 'emp_dept_exp_dump.dat';
RECOVER TABLE "DDL_TEST"."TEST" OF PLUGGABLE DATABASE pdb2 UNTIL TIME "to_date('2018-08-01 17:25:04','YYYY-MM-DD HH24:MI:SS')" AUXILIARY DESTINATION '/oracle/auxiliary/recover' DATAPUMP DESTINATION '/oracle/auxiliary/dumpfile' DUMP FILE 'emp_dept_exp_dump.dat';

 

source /home/oracle/.profile
rman target / log=/home/orale/backup/backup.log< run
{
allocate channel ch1 device type disk;
allocate channel ch2 device type disk;
sql 'alter system archive log current';
backup database format '/oracle/backup/db_%d_%T_%U';
backup archivelog all format '/oracle/backup/arch_%t_%s' delete all input;
backup format '/oracle/backup/cont_%s_%p' current controlfile;
crosscheck backup;
crosscheck archivelog all;
delete noprompt expired backup;
delete noprompt obsolete;
delete noprompt backup of database completed before 'sysdate-15';
release channel ch1;
release  channel ch2;
}

你可能感兴趣的:(11g 12c)