четверг, 19 февраля 2009 г.

Oracle for SAP

 

Solaris



# more /etc/system

exclude: drv/ohci
*
set md:mirrored_root_flag=1
set md_mirror:md_resync_bufsz=2048
*
set autoup=300
set tune_t_fsflushr=50
set ce:ce_taskq_disable=1
set ce:ce_ring_size=1024
set ce:ce_comp_ring_size=4096
set lgrp_mem_default_policy=1
set ssd:ssd_io_time=0x3c
* Begin MDD root info (do not edit)
rootdev:/pseudo/md@0:0,1,blk
* End MDD root info (do not edit)
* vxvm_START (do not remove)
forceload: drv/vxdmp
forceload: drv/vxio
forceload: drv/vxspec
* vxvm_END (do not remove)

* vxfs_START -- do not remove the following lines:
* VxFS requires a stack size greater than the default 8K.
* The following value allows the kernel stack size to be
* increased to 24K.
set lwp_default_stksize=0x6000
* vxfs_END


* vxfs_START -- do not remove the following lines:
* VxFS requires a stack size greater than the default 8K.
* The following value allows the kernel stack size to be
* increased to 24K.
set rpcmod:svc_default_stksize=0x6000
* vxfs_END
*Parameters For SAP
set rlim_fd_cur=8192
set noexec_user_stack=1
*End Parameters for SAP

#

Создаем группы и пользователей

groupadd -g 204 dba
groupadd -g 205 oper
groupadd -g 203 sapsys

psqadm 206 g 203
orapsq 207 g 204

setadm 208 g 203
oraset 209 g 204

useradd -c 'SAP System Administrator' -d /export/home/psqadm -g 203 -m -u 206 -s /bin/csh psqadm
useradd -c 'SAP Database Administrator' -d /oracle/PSQ -g 204 -m -u 207 -s /bin/csh orapsq
useradd -c 'SAP System Administrator' -d /export/home/setadm -g 203 -m -u 208 -s /bin/csh setadm
useradd -c 'SAP Database Administrator' -d /oracle/SET -g 204 -m -u 209 -s /bin/csh oraset


Создание проекта

projadd -p 300 -c "SAPPROJECT" -U phdadm,oraphd,phqadm,oraphq \
-K 'project.max-sem-ids=(priv,1024,deny)' \
-K 'project.max-sem-nsems=(priv,2048,deny)' \
-K 'project.max-shm-ids=(priv,256,deny)' \
-K "project.max-shm-memory=(priv,18446744073709551615,deny)" \
SAP_PROJ1

# cd /etc
# more project
system:0::::
user.root:1::::
noproject:2::::
default:3::::
group.staff:10::::
SAP_PROJ:300:SAP:psqadm,orapsq,setadm,oraset::project.max-sem-ids=(priv,1024,deny);project.max-sem-nsems=(priv,2048,deny);project.max-shm-i
ds=(priv,256,deny);project.max-shm-memory=(priv,18446744073709551615,deny)
#


# vi user_attr

adm::::profiles=Log Management
lp::::profiles=Printer Management
root::::auths=solaris.*,solaris.grant;profiles=Web Console Management,All;lock_after_retries=no
psqadm::::project=SAP_PROJ
orapsq::::project=SAP_PROJ
setadm::::project=SAP_PROJ
oraset::::project=SAP_PROJ
#


vxassist -g SAP_DG make SEV_sapdata1 35g;
vxassist -g SAP_DG make SEV_sapdata2 35g;
vxassist -g SAP_DG make SEV_sapdata3 40g;
vxassist -g SAP_DG make SEV_sapdata4 40g;
vxassist -g SAP_DG make SEV_mirrlogA 282m;
vxassist -g SAP_DG make SEV_mirrlogB 282m;
vxassist -g SAP_DG make SEV_origlogA 282m;
vxassist -g SAP_DG make SEV_origlogB 282m;
vxassist -g SAP_DG make SEV_sap_sev 6g;
vxassist -g SAP_DG make SEV_sapmnt_sev 4g;
vxassist -g SAP_DG make SEV_oraarch 6g;
vxassist -g SAP_DG make SEV_102_64 4g;

newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_sapdata1
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_sapdata2
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_sapdata3
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_sapdata4
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_mirrlogA
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_mirrlogB
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_origlogA
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_origlogB
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_sap_sev
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_sapmnt_sev
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_oraarch
newfs -b 8192 /dev/vx/rdsk/SAP_DG/SEV_102_64

В /etc/dfstab добавляем строки

/dev/vx/dsk/SAP_DG/SEV_sapdata1 /dev/vx/rdsk/SAP_DG/SEV_sapdata1 /oracle/SEV/sapdata1 ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_sapdata2 /dev/vx/rdsk/SAP_DG/SEV_sapdata2 /oracle/SEV/sapdata2 ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_sapdata3 /dev/vx/rdsk/SAP_DG/SEV_sapdata3 /oracle/SEV/sapdata3 ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_sapdata4 /dev/vx/rdsk/SAP_DG/SEV_sapdata4 /oracle/SEV/sapdata4 ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_mirrlogA /dev/vx/rdsk/SAP_DG/SEV_mirrlogA /oracle/SEV/mirrlogA ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_mirrlogB /dev/vx/rdsk/SAP_DG/SEV_mirrlogB /oracle/SEV/mirrlogB ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_origlogA /dev/vx/rdsk/SAP_DG/SEV_origlogA /oracle/SEV/origlogA ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_origlogB /dev/vx/rdsk/SAP_DG/SEV_origlogB /oracle/SEV/origlogB ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_sap_sev /dev/vx/rdsk/SAP_DG/SEV_sap_sev /usr/sap/SEV ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_sapmnt_sev /dev/vx/rdsk/SAP_DG/SEV_sapmnt_sev /sapmnt/SEV ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_oraarch /dev/vx/rdsk/SAP_DG/SEV_oraarch /oracle/SEV/oraarch ufs 0 yes largefiles,suid
/dev/vx/dsk/SAP_DG/SEV_102_64 /dev/vx/rdsk/SAP_DG/SEV_102_64 /oracle/SEV/102_64 ufs 0 yes largefiles,suid


создаем директории:

mkdir -p /oracle/PHP/sapdata1
mkdir -p /oracle/PHP/sapdata2
mkdir -p /oracle/PHP/sapdata3
mkdir -p /oracle/PHP/sapdata4
mkdir -p /oracle/PHP/mirrlogA
mkdir -p /oracle/PHP/mirrlogB
mkdir -p /oracle/PHP/origlogA
mkdir -p /oracle/PHP/origlogB
mkdir -p /usr/sap/PHP
mkdir -p /sapmnt/PHP
mkdir -p /oracle/PHP/oraarch
mkdir -p /oracle/PHP/102_64


Монтируем

mount /oracle/SEV/sapdata1;
mount /oracle/SEV/sapdata2;
mount /oracle/SEV/sapdata3;
mount /oracle/SEV/sapdata4;
mount /oracle/SEV/mirrlogA;
mount /oracle/SEV/mirrlogB;
mount /oracle/SEV/origlogA;
mount /oracle/SEV/origlogB;
mount /usr/sap/SEV;
mount /sapmnt/SEV;
mount /oracle/SEV/oraarch;
mount /oracle/SEV/102_64;

# su orapsq


ORACLE_HOME=/oracle/PSQ/102_64
ORACLE_SID=PSQ
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib
PATH=/bin:/usr/bin:/usr/sbin:/usr/openwin/bin:$ORACLE_HOME/bin:$PATH:/usr/local/bin
export ORACLE_HOME ORACLE_SID LD_LIBRARY_PATH PATH

../SAPCAR -xvf OR210264.SAR -R ../../ORADISTR

ставим oracle
ставим patch

Создаем каталоги:

/oracle/SEV/sapdata1

mkdir cntrl;
mkdir sr3700_1;
mkdir sr3700_2;
mkdir sr3700_3;
mkdir sr3700_4;
mkdir sr3_1;
mkdir sr3_2;
mkdir sr3_3;
mkdir sr3_4;
mkdir sr3_5;
mkdir sr3usr_1;
mkdir sysaux_1;
mkdir system_1;

cd /oracle/SEV/sapdata2

mkdir sr3700_5;
mkdir sr3700_6;
mkdir sr3700_7;
mkdir sr3700_8;
mkdir sr3_10;
mkdir sr3_6;
mkdir sr3_7;
mkdir sr3_8;
mkdir sr3_9;
mkdir temp_1;

cd /oracle/SEV/sapdata3

mkdir sr3700_10;
mkdir sr3700_11;
mkdir sr3700_12;
mkdir sr3700_9;
mkdir sr3_11;
mkdir sr3_12;
mkdir sr3_13;
mkdir sr3_14;
mkdir sr3_15;
mkdir undo_1;

cd /oracle/SEV/sapdata4

mkdir sr3700_13;
mkdir sr3700_14;
mkdir sr3700_15;
mkdir sr3700_16;
mkdir sr3_16;
mkdir sr3_17;
mkdir sr3_18;
mkdir sr3_19;
mkdir sr3_20;
mkdir sr3db_1;
mkdir sr3db_2;
mkdir sr3db_3;
mkdir sr4db_1;
mkdir sr4db_2;
mkdir sr4db_3;

И еще такие:

/oracle/PSD/origlogA/cntrl
/oracle/PSD/origlogB/cntrl
/oracle/PSD/sapdata1/cntrl
/oracle/PSD/saptrace/background'
/oracle/PSD/saptrace/usertrace'
/oracle/PSD/oraarch/PSDarch'


#########################################################

CREATE PROFILE UNLIMITED_PROFILE LIMIT
SESSIONS_PER_USER UNLIMITED
CPU_PER_SESSION UNLIMITED
CPU_PER_CALL UNLIMITED
CONNECT_TIME UNLIMITED
IDLE_TIME UNLIMITED
LOGICAL_READS_PER_SESSION UNLIMITED
LOGICAL_READS_PER_CALL UNLIMITED
COMPOSITE_LIMIT UNLIMITED
PRIVATE_SGA UNLIMITED
FAILED_LOGIN_ATTEMPTS UNLIMITED
PASSWORD_LIFE_TIME UNLIMITED
PASSWORD_REUSE_TIME UNLIMITED
PASSWORD_REUSE_MAX UNLIMITED
PASSWORD_LOCK_TIME UNLIMITED
PASSWORD_GRACE_TIME UNLIMITED
PASSWORD_VERIFY_FUNCTION NULL;




CREATE USER ops$oracle
IDENTIFIED EXTERNALLY
DEFAULT TABLESPACE USERS
TEMPORARY TABLESPACE TEMP
PROFILE UNLIMITED_PROFILE
/
GRANT ALTER DATABASE TO ops$oracle
/
GRANT ALTER SYSTEM TO ops$oracle
/
GRANT ALTER TABLESPACE TO ops$oracle
/
GRANT ANALYZE ANY TO ops$oracle
/
GRANT ANALYZE ANY DICTIONARY TO ops$oracle
/
GRANT UNLIMITED TABLESPACE TO ops$oracle
/
GRANT CONNECT TO ops$oracle
/
GRANT RESOURCE TO ops$oracle
/
ALTER USER ops$oracle DEFAULT ROLE ALL

################################################

grant SELECT on SYS.ALL_OBJECTS to OPS$ORACLE;
grant SELECT on SYS.DBA_USERS to OPS$ORACLE;
grant SELECT on SYS.V_$BACKUP to OPS$ORACLE;
grant SELECT on SYS.V_$LOG_HISTORY to OPS$ORACLE;
grant SELECT on SYS.V_$DATAFILE to OPS$ORACLE;
grant SELECT on SYS.V_$TEMPFILE to OPS$ORACLE;
grant SELECT on SYS.V_$SORT_USAGE to OPS$ORACLE;
grant SELECT on SYS.DBA_DATA_FILES to OPS$ORACLE;
grant SELECT on SYS.DBA_TABLESPACES to OPS$ORACLE;
grant EXECUTE on SYS.DBMS_STATS to OPS$ORACLE;
grant SELECT on SYS.V_$CONTROLFILE to OPS$ORACLE;
grant SELECT on SYS.V_$PROCESS to OPS$ORACLE;
grant SELECT on SYS.V_$SESSION to OPS$ORACLE;
grant SELECT on SYS.V_$LOCK to OPS$ORACLE;
grant SELECT on SYS.V_$LOGFILE to OPS$ORACLE;
grant SELECT on SYS.V_$PARAMETER to OPS$ORACLE;
grant SELECT on SYS.V_$DATABASE to OPS$ORACLE;
grant SELECT on SYS.V_$INSTANCE to OPS$ORACLE;
grant SELECT on SYS.V_$SQLTEXT to OPS$ORACLE;

#######################################################

grant EXECUTE on BBR._DBA_TRUNCATE to OPS$ORACLE;
grant EXECUTE on WH._DBA_DELETE to OPS$ORACLE;
grant EXECUTE on OD._PLASTIC to OPS$ORACLE;
grant EXECUTE on OD._DBA_TRUNCATE to OPS$ORACLE;
grant EXECUTE on OD._DBA_TRUNCATE_BSS to OPS$ORACLE;


TimeZone-обновления.
Текущая версия – v19 (Patch 15897859: DST 19 : HALF YEARLY DST PATCHES, DEC 2012).


Patch 15897859: DST 19 : HALF YEARLY DST PATCHES, DEC 2012
v19
p15897859_112030_SOLARIS64.zip


Patch 15897884: DST CHANGES FOR DSTV19 (TZDATA2012J) - NEED OJVM FIX
v19
p15897884_112030_Generic.zip



Отобразить SWAP на слайсы для загрузочных дисков:

/usr/lib/vxvm/bin/vxmksdpart -g rootdg rootdisk-02 1 0x03 0x01

/usr/lib/vxvm/bin/vxmksdpart -g rootdg rootmirror-02 1 0x03 0x01

Настроить DUMP Device на SWAP основного диска:

dumpadm -d /dev/dsk/c1t0d0s1

Исправить ошибку “no dump device configured”:

touch /etc/vx/.dumpadm



DST19



#
# Install Patch 13417321 (DST18)
# (p13417321_112030_Linux-x86-64.zip)

#
# MOS:
#
# Updated DST transitions and new Time Zones in Oracle Time Zone File patches [ID 412160.1]
# =========================================================================================
#
# The Latest DST update is version 19 tzdata2012j : note 1497158.1 Applying the DSTv19 update for the Oracle Database
# For DST update version 18 tzdata2012c           : note 1448706.1 Applying the DSTv18 update for the Oracle Database
# For DST update version 17 tzdata2011j           : Note 1362718.1 Applying the DSTv17 update for the Oracle Database
# For DST update version 16 tzdata2011g           : note 1319204.1 Applying the DSTv16 update for the Oracle Database


# Applying the DSTv19 update for the Oracle Database [ID 1497158.1]
#
Information in this document applies to any platform.
Bug 15897859 - DST 19 : HALF YEARLY DST PATCHES, DEC 2012
Bug 15897884 - DST CHANGES FOR DSTV19 (TZDATA2012J) - NEED OJVM FIX


Download Patch 15897859 (DST v19)
---------------------------------

su - oradb

cd /u09/distr/oradb/dst19/
ls -l

p15897859_112030_Linux-x86-64.zip

unzip p15897859_112030_Linux-x86-64.zip

ls -l

total 320
drwxr-xr-x. 4 oradb oinstall   4096 Dec 31 12:11 15897859
-rw-r--r--. 1 oradb oinstall 320078 Jan 16 11:00 p15897859_112030_Linux-x86-64.zip


cd /u09/distr/oradb/dst19/15897859
/u01/app/oradb/product/11.2.0.3/dbhome_1/OPatch/opatch apply

/u01/app/oradb/product/11.2.0.3/dbhome_1/OPatch/opatch lsinventory

# File: lsinventory_oradb_2012.01.16.txt

SQL> startup mount;
SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION
-------------------- ----------
timezlrg_19.dat              19


SQL> alter database open;
SQL> SELECT * FROM v$timezone_file;

FILENAME                VERSION
-------------------- ----------
timezlrg_14.dat              14


-- Проверка на наличие типов данных (DST):
select u.name || '.' || o.name || '.' || c.name TSLTZcolumn
from sys.obj$ o, sys.col$ c, sys.user$ u
where c.type# = 231
and o.obj# = c.obj#
and u.user# = o.owner#;

no rows selected


--
-- Check current DST version:
--

-- :
SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;

DST_PRIMARY_TT_VERSION                     14
DST_SECONDARY_TT_VERSION               0
DST_UPGRADE_STATE                 NONE


-- :
select TZ_VERSION from sys.registry$database;

14

5) 11gR2 : Applying the RDBMS DSTv19 patch 15897859 on Oracle RDBMS 11.2.0.1 or higher
======================================================================================

Update all databases using this home (977512.1)
===============================================

start from point 3) in Note 977512.1 Updating the RDBMS DST version in 11gR2 (11.2.0.1 and up) using DBMS_DST


Updating the RDBMS DST version in 11gR2 (11.2.0.1 and up) using DBMS_DST [ID 977512.1]
======================================================================================

3) Checks before doing the actual update of the RDBMS DST version using DBMS_DST:

3a) check current RDBMS DST version and "DST UPGRADE STATUS".

su - oradb
export ORACLE_SID=testdb

sqlplus / as sysdba

SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;

-- check that the output gives

-- PROPERTY_NAME VALUE
-- ------------------------------ ------------------------------
-- DST_PRIMARY_TT_VERSION
-- DST_SECONDARY_TT_VERSION 0 <<<<------ be="" br="" needs="" this="" to="">-- DST_UPGRADE_STATE NONE   <<<<------ be="" br="" needs="" this="" to="">
-- DST_PRIMARY_TT_VERSION should match the value found when selecting

SELECT version FROM v$timezone_file;


3b) Check UPFRONT using DBMS_DST if there is affected data that cannot be resolved automatically.

sqlplus / as sysdba

-- If there are objects containing TSTZ data in recycle bin,
-- please purge the bin now.
purge dba_recyclebin;

-- this alter session might speed up DBMS_DST on some db's
-- see Bug 10209691 / Bug 12658443
alter session set "_with_subquery"=materialize;

-- to avoid the issue in note 1407273.1
alter session set "_simple_view_merging"=TRUE;

-- start prepare window
-- these steps will NOT update any data yet.
exec DBMS_DST.BEGIN_PREPARE(19)


-- check for prepare status
SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;


-- truncate logging tables if they exist.
TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;
TRUNCATE TABLE sys.dst$affected_tables;
TRUNCATE TABLE sys.dst$error_table;


-- log affected data
set serveroutput on

BEGIN
DBMS_DST.FIND_AFFECTED_TABLES
(affected_tables => 'sys.dst$affected_tables',
log_errors => TRUE,
log_errors_table => 'sys.dst$error_table');
END;
/


-- check what tables have affected data in TSTZ columns.
-- if dst$affected_tables has no rows then there is no actual data to update by DBMS_DST
-- if dst$affected_tables has rows it simply means those rows need
-- to be updated by DBM_DST during the DST upgrade (= point 4)
-- because they contain timezones that are affected by the DST upgrade

SELECT * FROM sys.dst$affected_tables;


-- If dst$affected_tables has rows then you can see in dst$error_table
-- if there are any rows with a "problem" and what kind of problem there are in those rows
-- note that if there are rows in dst$affected_tables
-- this does not mean there need to be rows in dst$error_table

SELECT * FROM sys.dst$error_table;


-- error_on_overlap_time is error number ORA-1883
-- error_on_nonexisting_time is error number ORA-1878

-- for an explanation of the reported data please see
-- "Error Handling when Upgrading Time Zone File and Timestamp with Time Zone Data"
-- For the "error_on_overlap_time" and "error_on_nonexisting_time" you do not HAVE to
-- take action on this data to upgrade the DST version, but it is advised
-- to at least to check the results AFTER the update.


-- all "error_on_overlap_time" rows
SELECT * FROM sys.dst$error_table where ERROR_NUMBER= '1883';


-- all "error_on_nonexisting_time" rows
SELECT * FROM sys.dst$error_table where ERROR_NUMBER= '1878';


-- check for all other possible problems
SELECT * FROM sys.dst$error_table where ERROR_NUMBER not in ('1878','1883');


-- end prepare window, the rows above will stay in those tables.
EXEC DBMS_DST.END_PREPARE;


-- check if this is ended
SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;

-- output should be
-- PROPERTY_NAME VALUE
-- ---------------------------- ------------------------------
-- DST_PRIMARY_TT_VERSION
-- DST_SECONDARY_TT_VERSION 0
-- DST_UPGRADE_STATE NONE


4) Do the actual RDBMS DST version update of the database using DBMS_DST:
=========================================================================

-- the actual commands are listed in BOLD
-- the next steps use in the statements
-- simply replace it with the actual number ( 11, 15 etc)
-- of the RDBMS DST version you want to update to.

sqlplus / as sysdba
shutdown immediate;
startup upgrade;
set serveroutput on


-- check if previous prepare window is ended
SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;


-- If there are objects containing TSTZ data in recycle bin,
-- please purge the bin now.
-- Otherwise dbms_dst.begin_upgrade will report "ORA-38301: Can not perform DDL/DML over objects in Recycle Bin".

purge dba_recyclebin;

-- clean used tables
TRUNCATE TABLE SYS.DST$TRIGGER_TABLE;
TRUNCATE TABLE sys.dst$affected_tables;
TRUNCATE TABLE sys.dst$error_table;


-- this alter session might speed up DBMS_DST on some db's
-- see Bug 10209691 / Bug 12658443
alter session set "_with_subquery"=materialize;


-- to avoid the issue in note 1407273.1
alter session set "_simple_view_merging"=TRUE;

-- start upgrade window
EXEC DBMS_DST.BEGIN_UPGRADE(19);


-- check if this select
SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;


-- Optionally you can check what user tables still need to be updated using DBMS_DST.UPGRADE_DATABASE
-- BEGIN_UPGRADE upgrades system tables that contain TSTZ data and marks user tables (containing TSTZ data) with the UPGRADE_IN_PROGRESS property.
-- even if this select gives no rows you still need to do to the rest of the steps
-- it simply gives an indication of how many user objects need to processed in the later steps
-- some oracle provided users may be listed here, that is normal

SELECT OWNER, TABLE_NAME, UPGRADE_IN_PROGRESS FROM ALL_TSTZ_TABLES where UPGRADE_IN_PROGRESS='YES';


-- now restart the database
-- NOTE: Oracle support has seen SR's where some customers stop here, the upgrade is NOT finished yet - please DO follow the next steps !!!!!

shutdown immediate
startup


-- now upgrade the tables who need action
set serveroutput on
VAR numfail number
BEGIN
DBMS_DST.UPGRADE_DATABASE(:numfail,
parallel => TRUE,
log_errors => TRUE,
log_errors_table => 'SYS.DST$ERROR_TABLE',
log_triggers_table => 'SYS.DST$TRIGGER_TABLE',
error_on_overlap_time => FALSE,
error_on_nonexisting_time => FALSE);
DBMS_OUTPUT.PUT_LINE('Failures:'|| :numfail);
END;
/


-- if there where no failures then end the upgrade.
VAR fail number
BEGIN
DBMS_DST.END_UPGRADE(:fail);
DBMS_OUTPUT.PUT_LINE('Failures:'|| :fail);
END;
/


SELECT PROPERTY_NAME, SUBSTR(property_value, 1, 30) value
FROM DATABASE_PROPERTIES
WHERE PROPERTY_NAME LIKE 'DST_%'
ORDER BY PROPERTY_NAME;

-- needed output:
-- PROPERTY_NAME VALUE
-- ---------------------------- ------------------------------
-- DST_PRIMARY_TT_VERSION
-- DST_SECONDARY_TT_VERSION 0
-- DST_UPGRADE_STATE NONE


SELECT * FROM v$timezone_file;


-- if registry$database exists then update this static table also with the new DST version
-- the TZ_VERSION in registry$database is populated by Oracle's Database Pre-Upgrade Utility
-- wich is the utlu112i%.sql script
-- this table is ONLY used during upgrade and contains the DST version from before the upgrade
-- this update is mainly to avoid confusion when people notice registry$database has a lower DST version
-- listed than seen in DATABASE_PROPERTIES or v$timezone_file
sqlplus / as sysdba

SELECT VERSION FROM v$timezone_file;
select TZ_VERSION from registry$database;

--if they differ after an upgrade then updating registry$database can be done by

sqlplus / as sysdba
update registry$database set TZ_VERSION = (select version FROM v$timezone_file);
commit;




/////////////////////////////
FW: Install OJVM_FIX_DST18
/////////////////////////////

Bug 14112098 - Version 18 TIMEZONE data for Java VM (OJVM) - June 2012 [ID 14112098.8]
======================================================================================

See bug 13417321 for the server version 18 time zone data.

It is important to read Note:1448706.1 for instructions on
how to apply this timezone update patch.

Details of all timezone patches can be found in Note:412160.1


Your current OJVM DST version can be found using the procedure provided in Note 416860.1
========================================================================================

Testing your Oracle JVM Time Zone Setup [ID 416860.1]


create or replace and compile java source named "OffsetFromStandard" as
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.TimeZone;

public class OffsetFromStandard
{
   public static int getDSTOffset(
     String timezone,
     int year,
     int month,
     int mday,
     int hour,
     int min,
     int sec)
   {
     int RetVal = -360000000;
     String[] TZs = TimeZone.getAvailableIDs();
     for (int i = 0; i < TZs.length; i++)
     {
       if (timezone.equals(TZs[i]))
       {
         TimeZone tz = TimeZone.getTimeZone(timezone);
         GregorianCalendar c = new GregorianCalendar(tz);
         c.set(year, month-1, mday, hour, min, sec);
         RetVal = c.get(Calendar.DST_OFFSET);
       };
     }
     return RetVal;
   }
}
/

alter java class "OffsetFromStandard" resolve
/

CREATE OR REPLACE function get_dst_offset (timezone VARCHAR2,
                                                year NUMBER,
                                               month NUMBER,
                                                mday NUMBER,
                                                hour NUMBER,
                                                 min NUMBER,
                                                 sec NUMBER) RETURN NUMBER AS
LANGUAGE JAVA NAME 'OffsetFromStandard.getDSTOffset (java.lang.String, int, int, int, int, int, int) return int';
/


CREATE OR REPLACE function test_dst(timezone VARCHAR2,
                                                 year NUMBER,
                                                month NUMBER,
                                                 mday NUMBER,
                                                 hour NUMBER,
                                                  min NUMBER,
                                                  sec NUMBER) RETURN varchar2 as
   retval varchar2(40);
begin
   select case get_dst_offset (timezone,year,month,mday,hour,min,sec)
     when 3600000 then 'Timestamp is *in* DST'
     when 0 then 'Timestamp is *not* in DST'
     when -360000000 then 'Time Zone not valid'
     else 'Error' end into retval from dual;
   return retval;
end;
/


set serveroutput on
begin
   if test_dst('America/New_York', 2007, 3, 11, 11, 0, 0)= 'Timestamp is *in* DST' then
     dbms_output.put_line('V3 (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V3 (or later) Time Zone Update is not applied');
   end if;
   if test_dst('America/Edmonton', 2007, 3, 11, 11, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V4 (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V4 (or later) Time Zone Update is not applied');
   end if;
   if test_dst('Pacific/Auckland', 2008, 4, 5, 11, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V6 tzdata2007f (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V6 tzdata2007f (or later) Time Zone Update is not applied');
   end if;
   if test_dst('Australia/Adelaide', 2008, 4, 5, 11, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V7 tzdata2007k (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V7 tzdata2007k (or later) Time Zone Update is not applied');
   end if;
   if test_dst('Africa/Casablanca', 2008, 6, 1, 23, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V9 tzdata2008f (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V9 tzdata2008f (or later) Time Zone Update is not applied');
   end if;
     if test_dst('Asia/Damascus', 2008, 10, 15, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V10 tzdata2008i (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V10 tzdata2008i (or later) Time Zone Update is not applied');
   end if;
   if test_dst('Asia/Karachi', 2009, 04, 16, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V11 tzdata2009g (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V11 tzdata2009g (or later) Time Zone Update is not applied');
   end if;
-- DSTv13 check changed since this gave a false negative when DSTv14 is applied
   if test_dst('Pacific/Fiji', 2009, 11, 30, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V13 tzdata2009s (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V13 tzdata2009s (or later) Time Zone Update is not applied');
   end if;
   if test_dst('Pacific/Fiji', 2010, 11, 16, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V14 tzdata2010i (or later) Time Zone Update is applied');
   else
     dbms_output.put_line('V14 tzdata2010i (or later) Time Zone Update is not applied');
   end if;
  if test_dst('Asia/Hong_Kong', 1977, 07, 01, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V15 tzdata2010o (or later) Time Zone Update is not applied');
   else
     dbms_output.put_line('V15 tzdata2010o (or later) Time Zone Update is applied');
   end if;
  if test_dst('Europe/Istanbul', 2011, 03, 27, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V16 tzdata2011g (or later) Time Zone Update is not applied');
   else
     dbms_output.put_line('V16 tzdata2011g (or later) Time Zone Update is applied');
   end if;
  if test_dst('Europe/Moscow', 2012, 06, 20, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V17 tzdata2011i (or later) Time Zone Update is not applied');
   else
     dbms_output.put_line('V17 tzdata2011i (or later) Time Zone Update is applied');
   end if;
  if test_dst('Europe/Minsk', 2012, 06, 20, 10, 0, 0) = 'Timestamp is *in* DST' then
     dbms_output.put_line('V18 tzdata2012c (or later) Time Zone Update is not applied');
   else
     dbms_output.put_line('V18 tzdata2012c (or later) Time Zone Update is applied');
   end if;
   dbms_output.put_line('The TEST_DST function can be used to test your ''own'' time zones');
end;
/

-- DROP function get_dst_offset;
-- DROP function test_dst;
-- DROP java source "OffsetFromStandard"; 


how to check if the Oracle JVM is installed correctly you may refer to: Note 397770.1
=====================================================================================

How to Check Oracle JVM is Installed in the Database [ID 397770.1]
------------------------------------------------------------------

SQL> select comp_name, version, status from dba_registry;

14           JServer JAVA Virtual Machine   11.2.0.3.0            VALID


SQL> connect / as sysdba
SQL> select owner, status, count(*) from all_objects where object_type like '%JAVA%' group by owner, status;

OWNER                          STATUS    COUNT(*)
------------------------------ ------- ----------
MDSYS                          VALID          538
SYS                            VALID        21798
EXFSYS                         VALID           48
ORDSYS                         VALID         1948


SQL> select role from dba_roles where role like '%JAVA%';

6 rows selected.

SQL> select currently_used, name from  dba_feature_usage_statistics where name like '%Java%';

CURRE NAME
----- ----------------------------------------------------------------
FALSE Oracle Java Virtual Machine (user)
TRUE  Oracle Java Virtual Machine (system)



Superseeded
===========
Bug 15897884  Version 19 TIMEZONE data for Java VM (OJVM) - Dec 2012

You can check for existing interim patches here: Patch:15897884

See bug 15897859 for the server version 19 time zone data.

It is important to read Note:1497158.1 for instructions on
how to apply this timezone update patch.

Details of all timezone patches can be found in Note:412160.1


#
# Install OJVM_FIX_DST18
#


su - oradb
export ORACLE_SID=testdb
sqlplus / as sysdba
SQL> shutdown immediate

cd /u09/distr/oradb/dst18_fix_ojvm
unzip p14112098_112030_Generic.zip

cd /u09/distr/oradb/dst18_fix_ojvm/14112098
$ORACLE_HOME/OPatch/opatch apply

sqlplus / as sysdba
SQL> startup
SQL> @?/javavm/admin/fixTZa.sql
SQL> shutdown immediate
SQL> startup migrate
SQL> @?/javavm/admin/fixTZb.sql

Step5 : shutdown the database: SQL> shutdown
Step6 : If needed, edit init.ora back to cluster_database=TRUE
Step7 : Start Database without startup migrate: SQL> startup

SQL> shutdown immediate
SQL> startup
 



Для ОС AIX


Check Memory and SWAP:

lsattr -El sys0 | grep realmem
prtconf | grep -i memory
bootinfo -r
prtconf -m
lsps –a


Get hardware and kernel mode:

# getconf  KERNEL_BITMODE
64
# getconf  HARDWARE_BITMODE
64

# bootinfo -y
64

bootinfo -K displays the current kernel wordsize of "32" or "64"
bootinfo -y tells if hardware is 64 - bit capable

prtconf -k

# oslevel -s
7100-03-05-1524


Необходимо убедиться, что УЗ oracle имеет установленные атрибуты:

CAP_NUMA_ATTACH, CAP_BYPASS_RAC_VMM, and CAP_PROPAGATE

Для проверки выполните команду из под root:

# /usr/bin/lsuser -a capabilities oracle

Для установки атрибутов выполните команду из под root:

# /usr/bin/chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle

Установка Oracle 11g/12c на AIX 7.1

Базовая версия AIX 7.1 TL 0 SP1 ("7100-00-01-1037") или выше, 64-bit kernel

Для 12с
Базовая версия AIX 7.1 TL 1 SP3 ("7100-01-03-1207") или выше, 64-bit kernel
Желательно чтобы версия AIX 7.1 была не ниже ("7100-03-04-1441")

Установить необходимые патчи на ОС:

IZ87216
IZ87564
IZ89165
IZ97035

# /usr/sbin/instfix -i -k "IZ42940 IZ49516 IZ52331 IZ41855 IZ52319"


Для 12с
# /usr/sbin/instfix -i -k "IV21116 IV21235 IV16737 IV28925 IV35057 IV34869 IV37790 IV41415 IV41380 IV39136 IV45072 IV45073 IV19836 IV33857 IV41302"
# /usr/sbin/instfix -i -k "IV42025 IV42024 IV41380 IV37790"


Директории для установки По Oracle

/u01 объемом не менее 100Gb и желательно не в rootvg (для упрощения обновления ОС)
/tmp должно быть минимум 2 Гб свободного места.

Желательно выделять под /tmp хотя бы 5 Гб.
Домашний каталог пользователя oracle сделать /home/oracle


Установить пакеты для ПО Oracle

bos.adt.base
bos.adt.lib
bos.adt.libm
bos.perf.libperfstat
bos.perf.perfstat
bos.perf.proctools

Для 11g
xlC.aix61.rte.10.1.0.0 or later
xlC.rte.10.1.0.0 or later

Для 12c
xlC.aix61.rte.11.1.0.4 or later
xlC.rte.11.1.0.4 or later


Проверка установленных пакетов

$ lslpp -l bos.adt.base bos.adt.lib bos.adt.libm bos.perf.perfstat bos.perf.libperfstat bos.perf.proctools
$ lslpp -l xlC.aix61.rte
$ lslpp -l xlC.rte



Tuning AIX System Environment

Setup Asynchronous Input Output Processes.

/usr/sbin/ioo -r -o aio_maxreqs=65536
/usr/sbin/ioo -r -o aio_minservers=3
/usr/sbin/ioo -r -o aio_maxservers=80
(aio_maxservers не более 80)

Используется значение по умолчанию AIX 7.1 (aio_maxservers = 30 на CPU).
(можно оставить по умолчанию, если что потом увеличим)


Tuning Virtual Memory Manager (VMM)

minperm%=3
maxperm%=90
maxclient%=90
lru_file_repage=0
strict_maxperm=0
strict_maxclient=1
page_steal_method=1

lru_file_repage is default to 0 in AIX 7.1, no change required

Script for setting these parameters is as:

#!/usr/bin/ksh
vmo -p -o maxperm%=90;
vmo -p -o minperm%=3;
vmo -p -o maxclient%=90;
vmo -p -o strict_maxperm=0;
vmo -p -o strict_maxclient=1;
vmo -p -o lru_file_repage=0;
vmo -r -o page_steal_method=1;

Configuring Network Tuning Parameters

/usr/sbin/no -p -o use_isno=0
/usr/sbin/no -p -o udp_sendspace=65536
/usr/sbin/no -p -o udp_recvspace=655360
/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 -r -o ipqmaxlen=512
/usr/sbin/no -p -o sb_max=4194304

Verifying UDP and TCP Kernel Parameters

$ /usr/sbin/no -a | fgrep ephemeral
/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


Для 12с
Verifying UDP and TCP Kernel Parameters

$ /usr/sbin/no -a | fgrep ephemeral
tcp_ephemeral_low = 32768 должно быть 9000
tcp_ephemeral_high = 65535 должно быть 65500
udp_ephemeral_low = 32768 должно быть 9000
udp_ephemeral_high = 65535 должно быть 65500

$ /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


Configuring Shell Limits

Setup ARG_MAX to max value >= 128 - во избежание ошибок "list too long" на уровне ОС

В документации приведены минимально необходимые параметры ncargs=128,
иногда этого недостаточно

getconf ARG_MAX
/usr/sbin/chdev -l sys0 -a ncargs=1024

getconf ARG_MAX
Set Max Number processes per user >=16384

lsattr -l sys0 -E | grep maxuproc
chdev -l sys0 -a maxuproc='16384'
lsattr -l sys0 -E | grep maxuproc


Configuring SSH LoginGraceTime Parameter for AIX.

On AIX systems, the OpenSSH parameter LoginGraceTime by default is commented out,
and the default behavior of OpenSSH on AIX can sometimes result in timeout errors.
To avoid these errors, complete the following procedure:

1 Log in as root.
2 Using a text editor, open the OpenSSH configuration file /etc/ssh/sshd_config.
3 Locate the comment line #LoginGraceTime 2m.
4 Uncomment the line, and change the value to 0 (unlimited). For example:
LoginGraceTime 0
5 Save /etc/ssh/sshd_config.
6 Restart SSH.

Network Time Protocol Setting ("-x")

$ su - root
$ stopsrc -s xntpd
Open the /etc/rc.tcpip file, and locate the following line:
start /usr/sbin/xntpd "$src_running"
Change the line to the following:
start /usr/sbin/xntpd "$src_running" "-x"
Save the file.
$ startsrc -s xntpd -a "-x"


Для 12с
Enabling I/O Completion Ports
$ lsdev | grep iocp
iocp0 Defined I/O Completion Ports
By default, IOCP is set to Defined. To enable IOCP, set IOCP to Available using the following procedure:
1.Log in as root and run the following command: $ smitty iocp
2.Select Change / Show Characteristics of I/O Completion Ports.
3.Change configured state at system restart from Defined to Available.
4.Run the lsdev command to confirm the IOCP status is set to Available:
$ lsdev | grep iocp
iocp0 Available I/O Completion Ports

Perform a system restart to make the changes permanent.


Configuring Software Owner User Environments | oracle
Ensure that the Oracle Grid Infrastructure software installation owner (oracle)
has the capabilities CAP_NUMA_ATTACH, CAP_BYPASS_RAC_VMM, and CAP_PROPAGATE.

/usr/bin/lsuser -a capabilities oracle
/usr/bin/chuser capabilities=CAP_NUMA_ATTACH,CAP_BYPASS_RAC_VMM,CAP_PROPAGATE oracle



Снятие ограничения для встроенной учётной записи root

/usr/bin/chuser
 nofiles='-1' nofiles_hard='-1' rss='-1' rss_hard='-1' fsize='-1'
data='-1' stack='-1' core='-1' fsize_hard='-1' cpu_hard='-1'
data_hard='-1' stack_hard='-1' core_hard='-1' root

Снятие ограничения для встроенной учётной записи oracle

/usr/bin/chuser
nofiles='-1' nofiles_hard='-1' rss='-1' rss_hard='-1' fsize='-1'
data='-1' stack='-1' core='-1' fsize_hard='-1' cpu_hard='-1'
data_hard='-1' stack_hard='-1' core_hard='-1' oracle


AIXTHREAD_SCOPE be set to 'S' on AIX
Администратор может выбрать ту модель нитей, которая лучше всего подходит для выполнения приложения.
Проведенные в AIX тесты показывают, что некоторые приложения работают быстрее в рамках модели 1:1.
В AIX 6.1 по умолчанию применяется модель 1:1 вместо модели M:N.
В AIX 7.1 для этих целей предусмотрена переменная среды AIXTHREAD_SCOPE=S,
которая задает модель нитей 1:1 и сравнивает производительность с той, которая была в рамках модели M:N.end of change

vi /etc/environment
# Add new parameter
export AIXTHREAD_SCOPE=S


Настойка профайла пользователя oracle для интерпретатора bash или ksh

$vi .bashrc
- or -
$vi .profile

##################################################
# Setup Oracle standard env
##################################################
export ORACLE_SID=SID
export ORACLE_BASE=/u01/app/oracle
export PATH=$PATH:/usr/local/bin
ORAENV_ASK=NO
. /usr/local/bin/oraenv > /dev/null 2>&1
ORAENV_ASK=YES
##################################################
# Setup Oracle extended env
##################################################
#export NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export NLS_DATE_FORMAT=YYYY-MM-DD:HH24:MI:SS
export LIBPATH=$ORACLE_HOME/lib:/usr/lib
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/OPatch:/sbin:/usr/sbin:/bin:/usr/local/bin:/usr/bin:$PATH
umask 022
unset TMOUT
if [ `uname` = "AIX" ]; then
export AIXTHREAD_SCOPE=S
fi


Документы по Exata

Exadata Database Machine and Exadata Storage Server Supported Versions (Doc ID 888828.1)
Exadata Patching Overview and Patch Testing Guidelines (Doc ID 1262380.1)
Exadata Database Machine Software and Hardware Maintenance Planning Guide (Doc ID 1461240.1)
Exadata Starter Kit (Doc ID 1244344.1)
Information Center: Upgrading Oracle Exadata Database Machine (Doc ID 1364356.2)
Patch Requirements for Setting up Monitoring and Administration for Exadata (Doc ID 1323298.1)
dbnodeupdate.sh and dbserver.patch.zip: Updating Exadata Database Server Software using the DBNodeUpdate Utility and patchmgr (Doc ID 1553103.1)
Oracle Exadata Database Machine Automatic Storage Management Best Practices (Doc ID 2049911.1)

Комментариев нет:

Отправить комментарий