Vous êtes sur la page 1sur 87

<Insert Picture Here>

Managing Oracle Database Configuration for large SAP


system
Oracle Advanced Customer Services
Agenda

<Insert Picture Here>


Managing 11g database Performance in SAP
Oracle RAC in SAP
RAC concepts in SAP
RAC network setup
RAC performance
Using ASM in SAP
ABAP SQL tuning
Q &A
Managing 11g database Performance

Typical performance tuning in Oracle:


SGA sizing
Application SQL tuning

Rather than explain the details on tuning mechanics, our intent


is to discuss the best practice on how to keep a good
performance baseline in SAP environment.
Managing 11g database Performance:
Understand CBO

SQL tuning in SAP environment.

Patches

Parameters

Statistics

Cost Based Optimizer


Managing 11g database Performance:
Patches
Any Oracle patches has to be certified by CoE team through SAP OSS
message.
Recommended list maintained by SAP CoE team.
Updates released monthly around 10th.
Check for Hot Notes regularly.
New _fix_control parameters to match the OMF patches.
Maintain your optimizer merge patch. Stay as current as possible to
reduce the impact of poor optimization.
Try to stay within 2-3 month cycles.
11.2.0.2 bug fix ended Nov. 2013.

SAP Note 1503709 - Oracle 11.2.0: Patches / Patch collections for 11.2.0.2
SAP Note 1631931 - Oracle 11.2.0: Patches / Patch collections for 11.2.0.3
Managing 11g database Performance:
Parameters
Part of SAP recommends base lines
It changes whenever necessary
CBO related parameters
Events and underscore parameters
Can be different from BI to R/3

SAP note 1431798 - Oracle 11.2.0: Database Parameter Settings


SAP note 1171650 - Automated Oracle DB parameter check
Managing 11g database Performance:
Statistics

DBSTATC table controls BR-TOOL stats collection


Since 10g stats can be locked
Always use DBMS_STATS packages
SAP delivered stats for certain tables
Disable 11g default scheduled jobs: gather_stats_job,
auto_space_advisor_job
How often should we collect stats?

SAP note 1020260 - Delivery of Oracle statistics (Oracle 10g, 11g)


SAP note 1057511 - Collecting statistis - An alternative approach
SAP note 1374807 - Freezing single kinds of statistics
Managing 11g database Performance:
SQL Tuning
What we can do in packaged application?

Utilize tools at your disposal to create a workaround at database


level.
Create new index if necessary
Set statistics (column,clustering factor,)
Provide hint through view.
Look to OSS notes for other potential workarounds
<Insert Picture Here>

11g RAC for SAP


Real Application Clusters In SAP
Cluster interconnect

Instance Instance
1 2
Executables and
Node A archive logs on Node B
shared disks

Database files
on shared disks
Benefits of Oracle Real Application
Clusters
RAC is a natural extension for 3-tier SAP architecture.
For top-end users: High Availability
Fully use the existing hardware-based HA solution.
Have a control of hardware upgrade cycle.
Avoid certain OS limitation.
Dont forget the DG.
More cost-sensitive users: Scalability
Use Linux to replace more expensive UNIX system.
Can run multiple landscapes in a Linux based RAC system.
TAF in SAP environment

In general Oracle transparent application failover works for


query without application code change.
In SAP with the help of the application server connection
pooling, TAF can provide more protection.
Only active-committing transaction will get error out in
SAP.
Test with su01
Test with sgen
Requires 9.2 OCI and up. (46D_EX2)
SAP specific requirements

All work processes in one application server should


always connect to same instances.
No client side load balancing or connection load
balancing allowed.
Dedicated service defined for each instance to
provide easy maintenance and guaranty application
server to database instance mapping.
SAP specific requirements

Oracle development provided two whitepapers on how to


implement RAC on SAP:
Configuration of SAP NetWeaver for Oracle Database 11g Real
Application Clusters
Providing High Availability for SAP Resources (SAPCTL)
RAC certification Matrix: SAP note 527843
"Oracle RAC support in the SAP environment".
SAP note 971289, the SAPCTL is attached to the note.
RAC implementation

RAC is considered as part of infrastructure.


It can be part of other SAP project, implemented in parallel
with other project tasks.
Normal enablement project takes 3 months to 6 months.
majority of the time is spent on testing phase.
<Insert Picture Here>

Oracle Grid with RAC 11g Release 2 for SAP


SQL Net setup
New Components in 11.2
Single Client Access Name (SCAN)

Siebel Used by clients to connect to


PSFT any database in the cluster

RAC Oracle Grid Infrastructure Removes the requirement to


change the client connection
DB1 ClusterSCANname if cluster changes

RAC Load balances across the


DB2
instances providing a service

Provides failover between


moved instances
FREE

RAC
One
2 Listener level providing SCAN

Application
Server

Oracle RAC
Database
SCAN Local
Cluster
Listener
Listener
s
Clients s
2 Listener level providing SCAN

Application
Server

1
2
3
Oracle RAC
SCAN Local Database
Listeners Cluster
Clients Listeners
1. client asks the scan-listener adressed by one of the 3 scan ips for TNS
service
2. scan listener responds to client with right node-listener address
3. client asks node listener for service
11.2 network DNS connect
3

corporate
DNS
1 domain
2 DNS 4
SCAN listeners
client

Local listeners
SCAN address
Resolved by 3 fix IPs
returned in a round
robin fashion
Oracle RAC cluster - GRIDA
SCAN internal features used

Always 3 SCAN listeners provided by 3 SCAN IPs


SCAN IPs are new class of VIPs
Local instance registration with local listener
Remote instance registration with remote listener using SCAN
address
Client asks SCAN listener for TNS-service. SCAN responds with
redirect message to right node listener
Client asks node listener for TNS-service and is getting
connected
SCAN listeners are CRS protected resources, which may be
relocated to other nodes in event of failure
Local / node listeners are also CRS protected but do not fail over
SCAN management

Verifying SCAN setup


[oracle@dherac1 ~]$ cluvfy comp scan

Verifying scan

Checking Single Client Access Name (SCAN)...

Checking TCP connectivity to SCAN Listeners...


TCP connectivity to SCAN Listeners exists on all cluster nodes

Checking name resolution setup for "scan.clu1.saptest.pub"...

Verification of SCAN VIP and Listener setup passed

Verification of scan was successful.


SCAN management

Config of SCAN Listeners


[oracle@VMKB1 ~]$ srvctl config scan_listener
SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521

Config of SCAN VIPs


[oracle@VMKB1 ~]$ srvctl config scan
SCAN name: scan.gns.privat.net, Network: 1/10.10.0.0/255.255.255.0/eth2
SCAN VIP name: scan1, IP: /10.10.0.208/10.10.0.208
SCAN VIP name: scan2, IP: /10.10.0.207/10.10.0.207
SCAN VIP name: scan3, IP: /10.10.0.206/10.10.0.206

More srvctl commands available for SCAN (add, remove,


relocate, enable, disable, start, stop, )
SCAN management
Start, stop, getting status of SCAN Listeners
[oracle@VMKB1 ~]$ srvctl status scan_listener
SCAN Listener LISTENER_SCAN1 is enabled
SCAN listener LISTENER_SCAN1 is running on node vmkb4
SCAN Listener LISTENER_SCAN2 is enabled
SCAN listener LISTENER_SCAN2 is running on node vmkb1
SCAN Listener LISTENER_SCAN3 is enabled
SCAN listener LISTENER_SCAN3 is running on node vmkb3

Start, stop, status of SCAN VIPs


[oracle@VMKB1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node vmkb4
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node vmkb1
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node vmkb3
SQL*net EZconnect

New naming convention without need for tnsname.ora file


Syntax:
<user>/<password>@//<IP-name>:<port>/<service>
Or short: //<IP-name>:<port>/<service>
To be used in spfile:
local_listener, Remote_listener
Environment : dbs_ora_tnsname
SAP profiles:
dbs_ora_tnsname, dbs/ora/tnsname
IP-Name: SCAN-VIP is used only!!
Network Setup

GNS / No GNS
IP Adresses
Listener configuration
TNS configuration
11.2 network
Hint:
check for identical MTU size on all network adapters,
1500 bytes recommended during GRID and RAC
installation
MTU can be set to 9000 after installation finished
2 posible ways to reach new SCAN listeners to connect
to database:
1. Configure new GNS service : cluster-DNS-subdomain
plus one fix IP is needed (strongly recommended)
2. Configure current DNS server to resolve SCAN address
to 3 fix IPs, many fix IPs needed!
IP adresses
GNS setup needs:
One hostname per host
One GNS-vip
One abap-vip, one java-vip
One asinst-vip per asinst
and DNS subdomain
DHCP configured
Static (DNS) setup needs
One hostname, rac-vip per host
One abap-vip, one java-vip
One asinst-vip per asinst
3 SCAN IPs (one name and 3 IPs)
Single Client Access Name
Network Configuration for SCAN - DNS
Requires a DNS adress entry to be used
In DNS, SCAN is a single name defined to resolve to 3 IP-addresses:
saprac-scan IN A 192.168.119.202
IN A 192.168.119.203
IN A 192.168.119.204

Each cluster will have 3 SCAN-Listeners,


combined with a SCAN-VIP defined as cluster resources
The SCAN VIP/LISTENER combination will failover
to another node in the cluster, if the current node fails
Cluster Resources
--------------------------------------------
ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE saprac1
ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE saprac2
ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE saprac1
Single Client Access Name
Network Configuration for SCAN - GNS
Requires a DNS subnet entry if GNS to be used, plus one address
3 IP-addresses are requested from DHCP, no manual definition for
scan.clu1.saptest.pub
$ORIGIN clu1.saptest.pub.
@ IN NS gns.clu1.saptest.pub.

gns.clu1.saptest.pub. IN A 192.168.180.60
Verify setting of scans:
$ srvctl config scan
SCAN name: scan.clu1.saptest.pub, Network:
1/192.168.180.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /192.168.180.122/192.168.180.122
SCAN VIP name: scan2, IP: /192.168.180.123/192.168.180.123
SCAN VIP name: scan3, IP: /192.168.180.124/192.168.180.124
Listeners

Per cluster 3 SCAN listeners


SCAN listeners are first connection target and route
connection requests to node listeners
In 10.2 RAC and Non-RAC it is a must to have dedicated
listeners per SAP system
In 11.2 Non-RAC you can still follow this rule
In 11.2 RAC, each node runs a node-listener, which
provides access to all running SAP systems and databases
Second public network requires a second node listener for
this particular network
Listeners

Listeners are configured automatically during GRID


installation
All listeners are started from within $GRID_HOME
No general need for a listener.ora file in (RDBMS)
$ORACLE_HOME/network/admin (or $TNS_ADMIN)
RDBMS instances automatically register with the listeners
and publish available TNS services
Only brtools require static instance setup in listener.ora (in
$GRID_HOME/network/admin)
Example (ONE line !!!):
SID_LIST_LISTENER=(SID_LIST=(SID_DESC=(SI
D_NAME=NW4002)(ORACLE_HOME=/oracle/NW4/11
202)))
Tnsnames.ora

No general need for tnsnames.ora anymore!!


EZconnect can be used:
<user>/<password>@//<IP-
name>:<port>/<service>
Or short: //<IP-name>:<port>/<service>
Example:
[oracle@VMKB2 admin]$ tnsping //10.10.0.206:1521/NW4

TNS Ping Utility for Linux: Version 11.2.0.2.0 - Production on 14-


JUL-2011 08:10:12

Copyright (c) 1997, 2010, Oracle. All rights reserved.

Used parameter files:

Used HOSTNAME adapter to resolve the alias


Attempting to contact
(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=NW4))(ADDRESS=(PROTOCOL=TCP
)(HOST=10.10.0.206)(PORT=1521)))
OK (0 msec)
Tnsnames.ora

If there is any requirement for using tnsnames.ora, its still


possible
Must reside in $GRID_HOME/network/admin and
RDBMS home/network/admin or $TNS_ADMIN
Remove TNS aliases used for 10g local_listener and
remote_listener DB parameters from tnsnames.ora
TNS name resolution
Connect sapr3/sap@rac001
Sqlnet.ora
NAMES.DEFAULT_DOMAIN=de.oracl

Init.ora Init.ora
Db_domain=world
Service_names=...,RAC001,...
TNS-Setup (tnsnames.ora) 11g
EDU.WORLD =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan-vip)(PORT = 1527))
(CONNECT_DATA =
(SERVICE_NAME = EDU.WORLD)
(GLOBAL_NAME = EDU.WORLD) - ERASE!!!!
) )

Not necessary
No address list
Scan address used only
No TAF or failover entries, provided in CRS TNS service definition
srvctl add service -d <db_unique_name> -s <service_name> -r "<preferred_instance>" -a
"<failover_instances>" -P BASIC -k <net_num> -l PRIMARY -e SELECT -z
<failover_retries> -w <failover_delay>
TNS-Setup / Services (11g)

Connect to a TNS-Service via SCAN listeners which is


also a CRS-Resource
EZCONNECT
Advantage: Services can be dynamically relocated and
switched with CRS-commands on SAP instance level
No more tnsnames.ora entries
listener.ora in GRID-Home
TNS-Setup (SAP) with 11g
Sqlnet.ora:
NAMES.DIRECTORY_PATH=(EZCONNECT,TNSNAMES)
SAP-Instance connects with
sqlplus sapr3/sap@//<scan-vip>:<port>/<service>
sqlplus sapr3/sap@//saprac-scan/D04 (default port# 1521)
SAP-Start profile
EZCONNECT = //saprac-scan.de.oracle.com/EDU_D04.world
SETENV_03 = dbs_ora_tnsname=$(EZCONNECT)
( .world coming from db_domain!!)
SAP-Instance profile
//saprac-scan.de.oracle.com/EDU_D04.world
TNS-Setup (Listener)

lsnrctl status:
Service "EDU_DVEBMGS00_saprac1" has 1 instance(s).
Instance "EDU001", status READY, has 1 handler(s) for this service...

lsnrctl needs GRID environment for all listeners (node


and scan)
TNS-Setup R3trans

R3trans is needed during SAP startup to check if DB,


i.e. at least one instance is up
It also connects with
connect sap<sid>/pwd@<service_name>
Service to check all instances
Uses dbs_ora_tnsname
service_names=EDU, ...
R3trans -x
TNS for brtools
Init.sap: parallel_instances
Init.sap: db_services
password files plus sysdba to system
Tnsnames entries for dedicated single instances
EDU001.WORLD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = saprac1-vip)(PORT = 1527))
)
(CONNECT_DATA =
(SERVICE_NAME = EDU001.WORLD)
)
)

Static instance definition in listener.ora


SID_LIST_LISTENER =(SID_LIST=(SID_DESC=(SID_NAME=<SID>001)
(ORACLE_HOME=/oracle/<SID>/11202)))
TNS-Settings for 11g
Parameter Name Value

local_listener //<node vip.domain>:<port>

remote_listener //<SCAN-vip.domain>:<port>

<ORACLE_SID>.service_names (<DBSID>,<ORACLE_SID>)

db_domain World (SAP default, but can also be


removed )

Instance Profile
SAPSYSTEMNAME=EDU
SAPDBHOST=<node vip>
INSTANCE_NAME=D04
dbs/ora/tnsname=//saprac-scan.de.oracle.com/EDU_D02.world

Start Profile
EZCONNECT = //saprac-scan.de.oracle.com/EDU_D02.world
SETENV_03 = dbs_ora_tnsname=$(EZCONNECT)
Performance

Are we supposed to be faster with RAC?


What is your methodology for tuning?
What does RAC buy us?

Scalability
High availability
Load Balancing?
Distribute work manually!
All work processes within same SAP application instance
should always connect to same Oracle database instance.
Performance

RAC will not help for an IO bound system.


The worst can happen to RAC is CPU overloaded.
Tuning on single instance DB to insure applications
scalable first
RAC protects from Single Point of Failure, BUT all left
nodes should have enough CPU power to handle all the
workload.
Turn on flow control on NIC to reduce the loss pack.
Jumbo frame MTU 9000 helps interconnect performance.
Where are the bottlenecks?

Concurrent Updates on same segments/blocks


Block Pinging
Typical times for block-transfers between 1 and 5 ms
Low Latency and High Bandwidth of interconnect
Where are the bottlenecks?

Unselective indexes
NRIV
VBDATA/VBHDR/VBMOD
ARFC*
EDI*
Range partition and hash partition
Drilldown

awrrpt and dbacockpit

Waits
IO
Network
Load (CPU)
Buffercache sizing
Additional CR and PI images
GRD
Need 10% more memory in buffercache
Check Buffercache:
select status, count(status)
from v$bh group by status;
RAC Performance

ASSM and LMTS


Partitioning: Hash and Range
Index Leaf Block Contention
Parallel Processing
ASM and ACFS
What is Automatic Storage
Management (ASM)?
Oracle ASM is a volume manager and a file system
for Oracle database files that supports single-instance
Oracle Database and Oracle Real Application
Clusters (Oracle RAC) configurations..
Starting with 11gR2 Oracle ASM is the preferred
storage platform for SAP systems running on Oracle
RAC and single instance
ASM is an alternative to conventional volume
managers, file systems, and raw devices.
ASM reduces Cost and Complexity Without
Compromising Performance or Availability
ASM facts
Large File Support
IO-Distribution/Load Balancing
Data redistribution after adding/removing disks
RAID functionality
RMAN required/supported
Command line interface asmcmd
GUI asmca
Consolidated ASM Storage
Infrastructure
Before ASM ASM

Tables Tables
Tablespace 0010 0010 0010 0010 0010 Tablespace
Files 0010 0010 0010 0010 0010
Files Automatic
File Systems Disk Group Storage
LVM Management
Disks Disks

Networked Storage
(SAN, NAS, DAS)
ASM Components
Disk Group
Disk A Disk B Disk C Disk D
1 2 3 4
File
5 6 7 8

Disk
Group

Disk

File
Allocation
Unit
Allocation Units
ASM disks are divided into allocation units (AU):
AU size is configurable at disk group creation
Default AU size is 1MB:
Small enough to be cached by database and large enough for
efficient sequential access
Allowable AU sizes:
1, 2, 4, 8, 16, 32, or 64 MB
Large AUs may be useful in very large database (VLDB)
scenarios or when using specialized storage hardware
Oracle recommends that the allocation unit (AU) size for
a disk group be set to 4 megabytes (MB) for large system.
SAP prefers to use default 1 MB.
4 MB on Exadata
ASM Files

ASM files:
Are a collection of AUs
Analogous to extents in a filesystem
Appear as normal files to the database kernel
Have file names that start with '+'
For example,
+DATA/P11/datafile/psapsr3.260.738399155
May be associated with an optional alias file name
For example, +DATA/P11/datafile/system01.dbf
Are evenly distributed across disks in a disk group
Are mirrored according to the policies defined in the disk group
ASM Disks

ASM disks:
Are the storage devices provisioned to ASM disk groups
Are accessed through normal O/S interfaces
Must be read and write accessible by the ASM owner
Must be accessible by all nodes in a cluster
May have different O/S names or paths on different nodes
May be:
An entire physical disk or partition of a physical disk
Logical volumes
Network-attached files (NFS)
ASM Disk Groups

Highest level data structure in ASM


Like LVMs volume groups
ASM file system layer created
Striping and mirroring
External Redundancy
Normal Redundancy
High Redundancy
Redundancy - Disk Group Mirroring

Redundancy describe how to mirror data within diskgroup.


Mirroring done on extent level between failuregroups
which belongs to same diskgroup
When you define a disk group, you specify its redundancy
characteristics (cant change dynamically):
EXTERNAL REDUNDANCY indicates that ASM does not
provide any redundancy for the disk group.
With NORMAL REDUNDANCY (the default), a disk group can
tolerate the loss of a single failure group without data loss.
HIGH REDUNDANCY provides a greater degree of protection
(three-way mirroring).
What is an ASM instance?

Oracle instance to manage the metadata for disk


groups
All metadata modifications are done by an ASM
instance to isolate failures
Database instances connect to ASM instance to
create, delete, resize, open, or close files
alter tablespace system add datafile +DATA
Database instances read/write directly to disk
One ASM instance per node in a cluster
ASM instance failure kills attached database
instances
ASM Instance Parameters
*.diag_dest='/opt/app/admin/+ASM/bdump
*.instance_type=asm
*.asm_diskgroups=+DATA
*.shared_pool_size=128M
*.db_cache_size=128M
*.large_pool_size=12M
*.asm_diskstring='/dev/mapper/data*'
*.remote_login_passwordfile='SHARED
Most Oracle init parameters not allowed:
ORA-15021: Parameter is not valid in ASM instance
ASM Instance Processes
oracle 2423 1 0 Apr30 ? 00:00:00 asm_pmon_+ASM1
oracle 2425 1 0 Apr30 ? 00:00:00 asm_diag_+ASM1
oracle 2434 1 0 Apr30 ? 00:00:00 asm_mman_+ASM1
oracle 2436 1 0 Apr30 ? 00:00:00 asm_dbw0_+ASM1
oracle 2438 1 0 Apr30 ? 00:00:00 asm_lgwr_+ASM1
oracle 2440 1 0 Apr30 ? 00:00:00 asm_ckpt_+ASM1
oracle 2442 1 0 Apr30 ? 00:00:00 asm_smon_+ASM1
oracle 2444 1 0 Apr30 ? 00:16:03 asm_rbal_+ASM1
ASM Traces and other Files
ASM uses 11g trace-file layout:
select * from v$diag_info;
Special files in $GRID_HOME/dbs
ab_<ASM SID>.dat - This file is generated when an
ASM instance starts, and is used by the RDBMS
instance to determine the appropriate environment
information whenever the RDBMS instance connects to
the ASM instance. If this file is removed, then RDBMS
instances will not be able to connect to ASM.
hc_<SID>.dat : EM uses this file for instance health-
check monitoring. If removed, healthcheck may not
work properly.
ASM Metadata
Metadata of each diskgroup are stored in the diskgroup
itself
Physical metadata are stored at fixed locations
Virtual metadata are spread evenly across the disks of a
diskgroup
Stored in 4k blocks with a block header and checksum
Cannot be accessed directly by RDBMS instance
ASM Physical Metadata

Stored at fixed locations on ASM DISKs, outside of


ASM files: Necessary for bootstrapping
Disk Header (AU0 BLK 0)
Allocation Table (AU0 BLK 1)
Free Space Table (AU0 REST BLKS)
Partnership Status Table (AU1)
ASM Virtual Metadata
Stored in ASM files
Virtual metadata is triple mirrored in normal and high
redundancy diskgroups
Virtual Metadata:
File Directory
Disk Directory
Active Change Directory (ACD)
Continuing Operations Directory (COD)
Template Directory
Alias Directory
Attribute Directory
Staleness Directory
Staleness Registry
ASM Files and Directories

ASM provides a filesystem


Set DB_CREATE_FILE_DEST and
DB_RECOVERY_FILE_DEST

SQL> create tablespace psapsr3;

RDBMS_SQL> SELECT NAME FROM V$DATAFILE;


NAME
----------------------------------------
+DATA/edu/datafile/system.260.769008483
+DATA/edu/datafile/sysaux.261.769008489
+DATA/edu/datafile/psapundo1.262.769008495
+DATA/edu/datafile/psapundo2.264.769008521
+DATA/edu/datafile/psapsr3.269.769015039
...
ASM Files and Directories
SQL> create database;

RDBMS_SQL> SELECT NAME FROM V$DATAFILE;


NAME
----------------------------------------
+DATA/edu/datafile/system.260.769008483
+DATA/edu/datafile/sysaux.261.769008489
+DATA/edu/datafile/psapundo1.262.769008495
+DATA/edu/datafile/psapundo2.264.769008521

SQL> SELECT MEMBER FROM V$LOGFILE;


MEMBER
------------------------------------
+DATA/edu/onlinelog/group_1.258.769008479
+DATA/edu/onlinelog/group_2.259.769008481
+DATA/edu/onlinelog/group_3.265.769013991
+DATA/edu/onlinelog/group_4.266.769013995
ASM Files and Directories
Create a directory
SQL> ALTER DISKGROUP DATA ADD DIRECTORY '+DATA/PRD/sapdata';
Or
ASMCMD> mkdir +DATA/PRD/sapdata

Rename directory
SQL> ALTER DISKGROUP DATA RENAME DIRECTORY '+DATA/PRD/sapdata' to
'+DATA/PRD/sapdata_old';
Or
ASMCMD> mv +DATA/PRD/sapdata +DATA/PRD/sapdata_old

Drop directory
SQL> ALTER DISKGROUP DATA DROP DIRECTORY '+DATA/PRD/sapdata;
Or
ASMCMD> rm +DATA/PRD/sapdata_old
ASM Files and Directories
Create and remove alias
ASMCMD> mkalias source target
ASMCMD>rmalias

Copy a file
ASMCMD>cp <ASM_FILE> <OS_FILE>

Can we copy OS_FILE into ASM_FILE?

Example: Rename or adding a controlfile


ASM Templates
ASM_SQL> ALTER DISKGROUP DATA ADD TEMPLATE NONCRITCAL_FILES ATTRIBUTES
(UNPROTECTED);

RDBMS_SQL> create tablespace PSAPSR3 datafile '+DATA/psapsr3(noncritcal_files)' size 200M;

ASM_SQL> ALTER DISKGROUP DATA ALTER TEMPLATE NONCRITICAL_FILES


ATTRIBUTES (COARSE);
ASM_SQL> ALTER DISKGROUP DATA DROP TEMPLATE NONCRITICAL_FILES;
ASM Management
ASM management DB Management
Provide Storage
Create LUNs
Discover LUNs
Create/Maintain diskgroups
Create ACFS
ASM Disk Discovery
Find mountable/ASM usable storage
What can be used by ASM?
Disk Partitions
Logical Unit Numbers (LUN)
Logical Volumes
Network File System (NFS)
Owner: oracle:asmadmin or oracle:oinstall
Device Persistency
ASM Rebalancing
If a new disk is added to a disk group ASM
redistributes extents
Extents will be evenly distributed on available disks
RBAL
ASM Preferred Read
Define failure groups to do local reads
ASM_PREFERRED_READ_FAILURE_GROUPS
Should contain only disks that are local
Issue add/drop commands from the local side: Rebalance
will be local
very useful in stretched RAC environment
ASM What can be stored in ASM

File Type Default Templates


Control files CONTROLFILE
Data files DATAFILE
Redo log files ONLINELOG
Archive log files ARCHIVELOG
Temporary files TEMPFILE
Data file backup pieces BACKUPSET
Data file incremental backup pieces BACKUPSET
Archive log backup piece BACKUPSET
Data file copy DATAFILE
Persistent initialization parameter file (SPFILE) PARAMETERFILE
ASM What can be stored in ASM
File Type Default Templates
Flashback logs FLASHBACK
Change tracking file CHANGETRACKING
Data Pump dumpset DUMPSET
Automatically generated control file backup AUTOBACKUP
Cross-platform transportable data files XTRANSPORT
Flash file FLASHFILE
Oracle ASM Persistent initialization ASMPARAMETERFILE
parameter file (SPFILE)
Oracle ASM Persistent initialization ASMPARAMETERFILEBACKUP
parameter file (SPFILE) backup
Oracle Cluster Registry file OCRFILE
Oracle ASM Dynamic Volume Manager n/a
volumes
SAP ASM and DB Layout (Small DB)
SAP ASM and DB Layout (Large DB)
SAP ASM and DB Layout (Exadata DB)

Oracle ASM Disk Group Name Stores


+DATA - All datafiles
- Control file (first copy)
- Online redo logs

+RECO - Control file (second copy)


- Archived logs
- All temp files
- RMAN backups (optional)
- Fast recovery area (optional)
ASM Management Tools
SQL
Native management interface
Familiar for DBAs
Enterprise Manager
Graphical user interface
Simple to use
ASM Command Tool (ASMCMD)
UNIX-like command interface
Easy for systems administrators to learn
ASMCA
Easy to use tool for configuration and deployment
ASM V$ASM Views

V$ASM_DISKGROUP
V$ASM_DISK
V$ASM_FILE
V$ASM_ALIAS
V$ASM_ATTRIBUTE
What is ASM Cluster File System
ACFS is multi-platform, scalable file system, and storage
management technology
ACFS extends Oracle Automatic Storage Management (Oracle
ASM) functionality to support customer files maintained outside of
Oracle Database
ACFS supports many database and application files, including
executables, database trace files, database alert logs, application
reports
Oracle ASM is the preferred storage manager for all database
files. It is optimized for best performance for Database files
Oracle ACFS is the preferred file manager for non-database files.
It is optimized for general purpose files.
Starting with 11gR2 Oracle ASM is the preferred storage
platform for SAP (single instance and RAC)
ASM Cluster File System
Oracle Management of File System Data

Manage both database homes


and file system data
Clustered or local file system
Data stored in ASM
Inherits all ASM manageability
benefits
Online disk add/drop/rebalance
Integrated mirroring
Cross-platform Shared File System
Read-Only Snapshots
up to 63 point-in-time space
efficient copies of file system
Available on all platforms except
HP-UX
Q&A

Vous aimerez peut-être aussi