PGA vs SGA
hi,
i read the documents which says that pga has individual user datas like bind variables.session info.
here oracle how the pga communicate with sga for execution.
what are the components for PGA
thanks
with regards
user3266490 wrote:
hi,
i totally confused about PGA and shared pool.is there any relation between librarcy cache and pga.
whether,when the user exeutes select,insert,update,delete these are in librarcy cache or PGA.
i read that parsing,optimzation,execution,fetching there are happening in Library cahe.
so why oracle created the runtime area in PGASo why there is a confusion? The parsing, execution, they are all happening in the SGA because what is needed is that if someone else also requires the same data, for example, the same execution plan, the same data buffers, it should all be accessible from the SGA which is going to be shared among the users. But the PGA contains the data structures which don't do this! Answer this, when you do an order by , does it mean that all the other users also start seeing teh data in the order by clause by default? The answer should be no. This sorted data is just kept in the pga of yours. Similarly, there is a bind variable which is shared among the users but two different users need to use two different values of it.Where it is best to keep those different values, in their own PGAs isn't it? Hence its the private memory of the sessions.
HTH
Aman....
Similar Messages
-
Where does a PL/SQL block run? PGA or SGA?
Hi all,
11g
I'm not familiar with the oracle memory structure, if I have a simple pl/sql block as below
DECLARE
v1 number;
BEGIN
v1:=100;
DBMS_OUTPUT.PUT_LINE(v1);
END;in my mind, even though it's a small block, when i execute it, it would also consume some memory, where does this memory come from, pga or sga?
in other words, when 'pl/sql engine' needs some memory, for example, for the local variables, where does this memory come from?
many thanks.in my mind, even though it's a small block, when i execute it, it would also consume some memory, where does this memory come from, pga or sga?
in other words, when 'pl/sql engine' needs some memory, for example, for the local variables, where does this memory come from?SGA
The SGA comprises a number of memory components, which are pools of memory used to satisfy a particular class of memory allocation requests. Examples of memory components include the shared pool (used to allocate memory for SQL and PL/SQL execution), the java pool (used for java objects and other java execution memory), and the buffer cache (used for caching disk blocks). All SGA components allocate and deallocate space in units of granules. Oracle Database tracks SGA memory use in internal numbers of granules for each SGA component.
for any sort operations, hash joings, it uses PGA.
Read http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/memory.htm -
Is result cache, part of PGA or SGA(Shared Pool)
Is result cache, part of PGA or SGA(Shared Pool). whats is its stand when is is in a dedicated server or a RAC environment
Server query result cache can only be in SGA otherwise it could not be shared: http://download.oracle.com/docs/cd/E11882_01/server.112/e16638/memory.htm#BGBGEACF
Edited by: P. Forstmann on 28 sept. 2010 09:30 -
Hi,
I have a plan to increase size of PGA and SGA. Please recommend me which metric in Statspack report I should monitor to check what is the impact of such change.
Best.Hi Lesak;
Please check below 2 thread:
How we size SGA
Re: Estimating SGA Size
SGA and PGA size
SGA and PGA size
Regard
Helios -
Difference between UGA, PGA and SGA in oracle
please tell me what is the difference between UGA, PGA and SGA in oracle in the simple layman language
thanx in advanceUGA
The User Global Area (UGA) is a memory area (RAM) that holds session-based information.
Shared Server Area
When running in [[Shared Server]] mode (MTS with shared servers and dispatchers), sessions can be served by multiple server processes. As a result, the UGA cannot be stored in the [[PGA]], and is moved to the [[SGA]] (shared global area).
Dedicated Server
When running in [[Dedicated Server]] mode (one session = one dedicated process), the UGA is stored in the [[PGA]] (process global area).
i have question......
how to check and monitor the cpu usage ,temporary and memory usage in db?
ple could any body explain me.................
Edited by: 821205 on Dec 20, 2010 7:59 AM -
When setting up Hugepages are both PGA and SGA sizes relevant or just SGA?
New servers with 32 gig of RAM running 64 bit OEL 5.1.
Going thru linux kernel config aka Red Hat/Puschitz Tuning guide. Will be supporting both 10.2 and 11.1 database.
I am thinking of using 24 gig of memory for Hugepages but not sure if the Hugepage memory is only for SGA or also PGA?
Thanks in advance!I recommend Christo Kutrovsky's "The Answer to Free Memory, Swap, Oracle, and Everything" presentation for several important Hugepages and Oracle points;
http://www.pythian.com/blogs/741/pythian-goodies-free-memory-swap-oracle-and-everything -
DBCA templates - PGA and SGA using "percentageMemTOSGA" parameter
Hi all,
I am trying to configure a DBCA template to perform silent database creations on servers at our client sites. The amount of RAM could vary from server to server. For this reason, I am specifying the following parameters:
customSGA=false
percentageMemTOSGA=70In principle, this works pretty well - my DB is created with a suitable value for SGA_TARGET based on the RAM available on the server. However, the value that it uses for PGA_AGGREGATE_TARGET is too small for our needs. From experience, we can get by with a smaller SGA, but we need a relatively large PGA.
I have tried specifying the parameter "pga_aggregate_target" in the template (and thus trying to "override" the decision of DBCA) but DBCA ignores my "hard-coded" value for this and sets pga_aggregate_target according to (presumably) some calculation based on:
- The amount of RAM available
- The value of "percentageMemTOSGA"
- Some "other" value which tells DBCA how to divide up the %age memory it will take between SGA and PGA
So, my question is:
Does anybody know how to effectively use both "percentageMemTOSGA", and:
EITHER:
* tell DBCA how to split the memory that it will use from RAM (in this case 70%) between pga_aggregate_target and sga_target (some parameter maybe like "percent_to_pga" and "percent_to_sga")
OR (not as useful but better than no control):
* specify explicitly a value (or percentage) for pga_aggregate_target, but leave the value of sga_target to be decided based on the percentageMemTOSGA
I hope I've explained that well enough...
Regards,
AdosI've checked the help for dbca (I'm currently running from the command prompt in "silent" mode) and don't see anything about recording the creation - how would I do that? Or are you referring to using the GUI, creating a database, and then saving the template? If it's that, that's what I did first, then editing the template for my tests - I don't see the parameter(s) that I'm looking for in the template.Ados,
I did the same what you did. Run dbca in GUI mode and generate template only now in template file I see there is a parameter to set these value. For your reference I am posting the content of that file:
<?xml version = '1.0'?>
<DatabaseTemplate name="orcl" description="" version="10.2.0.3.0">
<CommonAttributes>
<option name="ISEARCH" value="false"/>
<option name="OMS" value="false"/>
<option name="JSERVER" value="true"/>
<option name="SPATIAL" value="true"/>
<option name="ODM" value="true">
<tablespace id="SYSAUX"/>
</option>
<option name="IMEDIA" value="true"/>
<option name="XDB_PROTOCOLS" value="true">
<tablespace id="SYSAUX"/>
</option>
<option name="ORACLE_TEXT" value="true">
<tablespace id="SYSAUX"/>
</option>
<option name="SAMPLE_SCHEMA" value="true"/>
<option name="CWMLITE" value="true">
<tablespace id="SYSAUX"/>
</option>
<option name="EM_REPOSITORY" value="true">
<tablespace id="SYSAUX"/>
</option>
<option name="HTMLDB" value="false"/>
</CommonAttributes>
<Variables/>
<CustomScripts Execute="false"/>
<InitParamAttributes>
<InitParams>
*<initParam name="pga_aggregate_target" value="808" unit="MB"/>*
<initParam name="processes" value="150"/>
<initParam name="db_recovery_file_dest_size" value="1024" unit="MB"/>
<initParam name="control_files" value="("{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control01.ctl", "{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control02.ctl", "{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/control03.ctl")"/>
<initParam name="sga_target" value="1536" unit="MB"/>
<initParam name="compatible" value="10.2.0.3.0"/>
<initParam name="background_dump_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/bdump"/>
<initParam name="job_queue_processes" value="10"/>
<initParam name="db_name" value="orcl"/>
<initParam name="user_dump_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/udump"/>
<initParam name="dispatchers" value="(PROTOCOL=TCP) (SERVICE={SID}XDB)"/>
<initParam name="audit_file_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/adump"/>
<initParam name="db_domain" value=""/>
<initParam name="open_cursors" value="300"/>
<initParam name="db_block_size" value="8" unit="KB"/>
<initParam name="db_recovery_file_dest" value="{ORACLE_BASE}/flash_recovery_area"/>
<initParam name="undo_tablespace" value="UNDOTBS1"/>
<initParam name="core_dump_dest" value="{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/cdump"/>
<initParam name="remote_login_passwordfile" value="EXCLUSIVE"/>
<initParam name="undo_management" value="AUTO"/>
<initParam name="db_file_multiblock_read_count" value="16"/>
</InitParams>
<MiscParams>
<databaseType>MULTIPURPOSE</databaseType>
<maxUserConn>20</maxUserConn>
<percentageMemTOSGA>40</percentageMemTOSGA>
<customSGA>true</customSGA>
<archiveLogMode>false</archiveLogMode>
<initParamFileName>{ORACLE_BASE}/admin/{DB_UNIQUE_NAME}/pfile/init.ora</initParamFileName>
</MiscParams>
<SPfile useSPFile="true">{ORACLE_HOME}/dbs/spfile{SID}.ora</SPfile>
</InitParamAttributes>
<StorageAttributes>
<DataFiles>
<Location>{ORACLE_HOME}/assistants/dbca/templates/Seed_Database.dfb</Location>
<SourceDBName>seeddata</SourceDBName>
<Name id="1" Tablespace="SYSTEM" Contents="PERMANENT" Size="480" autoextend="true" blocksize="8192">{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/system01.dbf</Name>
<Name id="2" Tablespace="UNDOTBS1" Contents="UNDO" Size="25" autoextend="true" blocksize="8192">{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/undotbs01.dbf</Name>
<Name id="3" Tablespace="SYSAUX" Contents="PERMANENT" Size="240" autoextend="true" blocksize="8192">{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/sysaux01.dbf</Name>
<Name id="4" Tablespace="USERS" Contents="PERMANENT" Size="5" autoextend="true" blocksize="8192">{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/users01.dbf</Name>
</DataFiles>
<TempFiles>
<Name id="1" Tablespace="TEMP" Contents="TEMPORARY" Size="20">{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/temp01.dbf</Name>
</TempFiles>
<ControlfileAttributes id="Controlfile">
<maxDatafiles>100</maxDatafiles>
<maxLogfiles>16</maxLogfiles>
<maxLogMembers>3</maxLogMembers>
<maxLogHistory>1</maxLogHistory>
<maxInstances>8</maxInstances>
<image name="control01.ctl" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
<image name="control02.ctl" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
<image name="control03.ctl" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
</ControlfileAttributes>
<RedoLogGroupAttributes id="1">
<reuse>false</reuse>
<fileSize unit="KB">51200</fileSize>
<Thread>1</Thread>
<member ordinal="0" memberName="redo01.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
</RedoLogGroupAttributes>
<RedoLogGroupAttributes id="2">
<reuse>false</reuse>
<fileSize unit="KB">51200</fileSize>
<Thread>1</Thread>
<member ordinal="0" memberName="redo02.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
</RedoLogGroupAttributes>
<RedoLogGroupAttributes id="3">
<reuse>false</reuse>
<fileSize unit="KB">51200</fileSize>
<Thread>1</Thread>
<member ordinal="0" memberName="redo03.log" filepath="{ORACLE_BASE}/oradata/{DB_UNIQUE_NAME}/"/>
</RedoLogGroupAttributes>
</StorageAttributes>
</DatabaseTemplate>
Regards. -
With an XE limitation of 1GB for the PGA and SGA, how would one best preserve this limitation?
In other words, how would one minimise the PGA and SGA usage via ones interface with Oracle?
For instance, in a SQL query I was building I could either (The query has multiple aggregates on multiple tables in a 'one to many' join relationship):
1) Use WITH clauses
2) Use inline views
3) Use standard views
4) Use temporary tables
5) Maybe more possibilities
Without much of an insite into how Oracle 'works' it's difficult to gauge which of these is less 'resource hungry'.
Possibly there is a reference on how to use the PGA & SGA efficiently?
Or possibly a more definitive explanation on what's actually stored in these memory areas (rather than just 'prorgam' and 'system' data).
Regards all,SGA is used in 2 main areas: parsing the SQL and avoiding disk reads by having stuff in memory. There is one SGA for all of XE instance.
PGA is used heavily for sorting, hash joining and 'working stuff'. The PGA is created for each Dedicated Server process. Much of the PGA is inside the SGA for Shared Server processes
SGA: (There are exceptions to each of these 'Rules Of Thumb' or 'ROT' statements)
Good coding technique will allow reuse of SQL and avoid as much as possible reparsing;
Use bind variables;
Do not create SQL on the fly;
Avoid dynamic SQL (concat strings to create SQL on the fly);
Forget about tweakiing the buffer cache as it is mainly a performance thing that you can't do much about in XE;
WITH clause is nice as it may reduce the count of subqueries;
Leave it with 'automatic memory management' (again a perf hit, but it will attempt to optimize mem availability);
Don't reinvent - Use the features that are loaded as they will likely get statements out faster, releasing memory faster;
Stored Views may (often do) grab unneeded table data. When joining to stored views, see whether they can be replaced by cleaner code;
Do not create SQL on the fly.
PGA:
Use shared server when feasible (at risk of performance hit);
Global Temp Tables go into PGA, watch the use;
Maximize reuabale SQL, minimze all other languages (remote or in DB) including PL/SQL;
Watch for PGA wasters such as UNION vs the better UNION ALL, and unneeded sorts;
PGA is 'swapped out' to Temporary tablespace. Make sure temp tablespace big enough ... it's not counted in the 4GB disk;
Avoid using COMMIT except at end of transaction. Avoid COMMIT in loops. Make sure undo tablespace is big enough ... it's not counted in the 4GB disk ;
Did I mention it's not a good idea to create SQL on the fly? -
Hi
We're doing some performance testing on our database. The SGA is set to 1.5GB and PGA set to 0.5GB. At some point we are runnning out of memory as we ramp up the number of users and transactions .
What I'm looking for is to graph the PGA and SGA usage seperately regular intervals (a line graph) showing their increaase as users ramp up.
Anyone any ideas on how I can get this information whether through AWR or manually.
Thanks in advance.You have not posted the version you are on. You should use automatic pga management and unset the values for areasize parameters (if there is no specific reason for keeping them).
ORA-04030: out of process memory when trying to allocate 8389132 bytes (pga heap,redo read buffer)
Doing block recovery for file 3 block 76812
Resuming block recovery (PMON) for file 3 block 76812What are the OS level statistics of memory usage ?
It simply means that Oracle (rather OS...as Oracle is also going to request memory from OS only) is running out of memory. Most common reason behind that is use of features like bulk collect without any limit clause which causes the pga memory to grow beyond pga_aggregate_target...and finally sucking all the memory available. Further requests for memory allocation start failing with ORA-04030.
Also, please post the output from v$pgastat using tags.
Edited by: amardeep.sidhu on Nov 24, 2010 9:29 AM -
SGA, PGA and... little extra?
Will oracle process use some extra "non oracle" memory for OS related stuff?
Mean, not considering SGA, I connect a database process and I see:
SQL> select p.program,
2 p.spid, pm.category, pm.allocated/1024 allocated, pm.used/1024 used, pm.max_allocated/1024 max_allocated
3 from V$PROCESS p, V$PROCESS_MEMORY pm
4 where p.pid = pm.pid
5 and p.spid =2650;
Max
Allocated Usedd allocated
PROGRAM SPID CATEGORY Kb Kb Kb
oracle@uxlabhost11 2650 SQL 14 9 42
oracle@uxlabhost11 2650 PL/SQL 56 34 57
oracle@uxlabhost11 2650 Other 1501 1501That's allocated PGA after having connected and done nothing else
So it somehow allocated 1.4 Mb upon start-up...
Now question is. Do oracle processes use OS memory which cannot be considered as SGA or PGA?
Reason being my trying to estimate memory needs for a database server. Many I've read correct formula should be SGA + max allocated PGA + some_extra_just_in_case...
Is there an estimate on how much that "some_extra_just_in_case" would be per process?
If OS dependent, I'm implementing on RHEL 6...
thanksSo, I've used pmap...
Got 257 enties in the form "4096K rw-s- /dev/shm/"
since we are using AMM , that should do for PGA and SGA ... some 1052672 Kb, which process is attached to...
yet pmap then continues to display other entries....
0000002a95557000 4K r-x-- /opt/oracle/product/11g/lib/libodm11.so
0000002a95558000 1024K ----- /opt/oracle/product/11g/lib/libodm11.so
0000002a95658000 4K rw--- /opt/oracle/product/11g/lib/libodm11.so
0000002a95659000 4K rw--- [ anon ]
0000002a9565a000 392K r-x-- /opt/oracle/product/11g/lib/libcell11.so
0000002a956bc000 1024K ----- /opt/oracle/product/11g/lib/libcell11.so
0000002a957bc000 40K rw--- /opt/oracle/product/11g/lib/libcell11.so
0000002a957c6000 4K rw--- [ anon ]
0000002a957c7000 864K r-x-- /opt/oracle/product/11g/lib/libskgxp11.so
.. TRUNCATED...
0000003fb810a000 64K rw--- [ anon ]
0000003fbbd00000 84K r-x-- /lib64/libnsl-2.3.4.so
0000003fbbd15000 1020K ----- /lib64/libnsl-2.3.4.so
0000003fbbe14000 4K r---- /lib64/libnsl-2.3.4.so
0000003fbbe15000 4K rw--- /lib64/libnsl-2.3.4.so
0000003fbbe16000 8K rw--- [ anon ]
0000007fbffde000 136K rwx-- [ stack ]
ffffffffff600000 4K r-x-- [ anon ]
total 1276452KNotice "total 1276452K"
So you saying non SGA/PGA would be 1276452 - 1052672?
That would be too much... yet if pmap another process, almost all flags (hex column) but [ stack ] are the same....
So how to tell which of those are shared and which are "exclusive" to the process, i.e: The "some extra just in case" mem...
thanks -
We have a production Oracle 11g DB in which SGA_TARGET is 0 but ASSM is enabled but the documentation on Oracle says that if SGA_TARGET is 0 means that ASSM is disabled. Also, PGA_AGGREGATE_TARGET is 0 but Maximum PGA allocated is around 1 GB.
I hope, my question is clear that concept seems to be confusing where SGA_TARGET is 0 but ASSM is enabled and also PGA_AGGREGATE_TARGET is 0 but maximum PGA allocated is 1 GB.
Please revert with the reply to my query.
Regards972145 wrote:
Thanks for your reply but there is some confusion. ASMM is automatic shared memory management which seems to be similar to AMM which is automatic memory management. ASMM can be seen from OEM under Database Configuration->Memory Advisors. I guess, there is ASM which is automatic storage management to do with reduntant copies of data to provide fault tolerance.
ASMM - 10g setting for the automatic SGA using the parameter sga_target .
AMM - 11g setting for both SGA and PGA, uses the parameter memory_target
ASM - Automatic Storage Management, nothing to do with SGA or PGA
ASSM - Automatic Segment Space Management, for the tables and nothing to do with the PGA and SGA
Aman....
Edited by: Aman.... on Jan 21, 2013 3:53 PM corrected the typo -
Oracle version: 10g and 11g
How to monitor SGA size for tuning whether we need to increase the SGA size or notHi;
Please mention db versions.
Also Please see our previous discussion:
Estimating SGA Size
Re: Estimating SGA Size
SGA and PGA size
SGA and PGA size
Also see:
http://www.oracle-base.com/articles/11g/AutomaticMemoryManagement_11gR1.php
http://orafaq.com/wiki/SGA
Regard
Helios -
PGA Allocation on Windows/Linux
As linux is a process based architecture. Each client connection is treated as a separate
process on linux as compared to windows where client connection are implemented as threads within a single process.
Thread base model has limitations on 32-bit systems because all the threads share the same 3GB address space for SGA, PGA and other memory.
A PGA is created by oracle whenever a server process is started.
On windows PGA and SGA are created under oracle process and all threads share the same 3GB address space for SGA, PGA then how does a PGA is allocated against a singles session (which is treated as a separate process) on Linux. Does it come out of same 3GB address space as on windows.[email protected] wrote:
As linux is a process based architecture. Each client connection is treated as a separate
process on linux as compared to windows where client connection are implemented as threads within a single process.
Thread base model has limitations on 32-bit systems because all the threads share the same 3GB address space for SGA, PGA and other memory.
A PGA is created by oracle whenever a server process is started.
On windows PGA and SGA are created under oracle process and all threads share the same 3GB address space for SGA, PGA then how does a PGA is allocated against a singles session (which is treated as a separate process) on Linux. Does it come out of same 3GB address space as on windows.Yes it is part of the 3GB address space. -
Hello ,
we are currently experiencing heavy I/O problmes perfoming prrof of concept
testig for one of our customers. Our setup is as follows:
HP ProLiant DL380 with 24GB Ram and 8 15k 72GB SAS drives
An HP P400 Raid controller with 256MB cache in RAID0 mode was used.
Win 2k8r2 was installed on c (a physical Drive) and the database on E
(= two physical drives in RAID0 128k Strip Size)
With the remaining 5 drives read and write tests were performed using raid 0 with variing number of drives.
I/O performance, as measured with ATTO Disk benchmark, increased as expected linear with the number of drives used.
We expected to see this increased performance in the database, too and performed the following tests:
- with 3 different tables the full table scan (FTS) (Hint: /*+ FULL (s) NOCACHE (s) */)
- a CTAS statement.
The system was used exclusively for testing.
The used tables:
Table 1: 312 col, 12,248 MB, 11,138,561 rows, avg len 621 bytes
Table 2: 159 col, 4288 MB, 5,441,171 rows, avg len 529 bytes
Table 3: 118 col, 360MB, 820,259 rows, avg len 266 bytes
The FTS has improved as expected. With 5 physical drives in a RAID0, a performance of
420MB/s was achieved.
In the write test on the other hand we were not able to archieve any improvement.
The CTAS statement always works with about 5000 - 6000 BLOCK/s (80MB/s)
But when we tried running several CTAS statements in different sessions, the overall speed increased as expected.
Further tests showed that the write speed seems to depend also on the number of columns. 80MB/s were only
possible with Tables 2 and 3. With Table 1, however only 30MB/s were measured.
Is this maybe just an incorrectly set parameter?
What we already tried:
- change the number of db_writer_processes 4 and then to 8
- Manual configuration of PGA and SGA size
- setting DB_BLOCK_SIZE to 16k
- FILESYSTEMIO_OPTIONS set to setall
- checking that Resource Manager are really disabled
Thanks for any help.
V$PARAMETERS
1 lock_name_space
2 processes 150
3 sessions 248
4 timed_statistics TRUE
5 timed_os_statistics 0
6 resource_limit FALSE
7 license_max_sessions 0
8 license_sessions_warning 0
9 cpu_count 8
10 instance_groups
11 event
12 sga_max_size 14495514624
13 use_large_pages TRUE
14 pre_page_sga FALSE
15 shared_memory_address 0
16 hi_shared_memory_address 0
17 use_indirect_data_buffers FALSE
18 lock_sga FALSE
19 processor_group_name
20 shared_pool_size 0
21 large_pool_size 0
22 java_pool_size 0
23 streams_pool_size 0
24 shared_pool_reserved_size 93952409
25 java_soft_sessionspace_limit 0
26 java_max_sessionspace_size 0
27 spfile C:\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE\SPFILEORATEST.ORA
28 instance_type RDBMS
29 nls_language AMERICAN
30 nls_territory AMERICA
31 nls_sort
32 nls_date_language
33 nls_date_format
34 nls_currency
35 nls_numeric_characters
36 nls_iso_currency
37 nls_calendar
38 nls_time_format
39 nls_timestamp_format
40 nls_time_tz_format
41 nls_timestamp_tz_format
42 nls_dual_currency
43 nls_comp BINARY
44 nls_length_semantics BYTE
45 nls_nchar_conv_excp FALSE
46 fileio_network_adapters
47 filesystemio_options
48 clonedb FALSE
49 disk_asynch_io TRUE
50 tape_asynch_io TRUE
51 dbwr_io_slaves 0
52 backup_tape_io_slaves FALSE
53 resource_manager_cpu_allocation 8
54 resource_manager_plan
55 cluster_interconnects
56 file_mapping FALSE
57 gcs_server_processes 0
58 active_instance_count
59 sga_target 14495514624
60 memory_target 0
61 memory_max_target 0
62 control_files E:\ORACLE\ORADATA\ORATEST\CONTROL01.CTL, C:\ORACLE\FAST_RECOVERY_AREA\ORATEST\CONTROL02.CTL
63 db_file_name_convert
64 log_file_name_convert
65 control_file_record_keep_time 7
66 db_block_buffers 0
67 db_block_checksum TYPICAL
68 db_ultra_safe OFF
69 db_block_size 8192
70 db_cache_size 0
71 db_2k_cache_size 0
72 db_4k_cache_size 0
73 db_8k_cache_size 0
74 db_16k_cache_size 0
75 db_32k_cache_size 0
76 db_keep_cache_size 0
77 db_recycle_cache_size 0
78 db_writer_processes 1
79 buffer_pool_keep
80 buffer_pool_recycle
81 db_flash_cache_file
82 db_flash_cache_size 0
83 db_cache_advice ON
84 compatible 11.2.0.0.0
85 log_archive_dest_1
86 log_archive_dest_2
87 log_archive_dest_3
88 log_archive_dest_4
89 log_archive_dest_5
90 log_archive_dest_6
91 log_archive_dest_7
92 log_archive_dest_8
93 log_archive_dest_9
94 log_archive_dest_10
95 log_archive_dest_11
96 log_archive_dest_12
97 log_archive_dest_13
98 log_archive_dest_14
99 log_archive_dest_15
100 log_archive_dest_16
101 log_archive_dest_17
102 log_archive_dest_18
103 log_archive_dest_19
104 log_archive_dest_20
105 log_archive_dest_21
106 log_archive_dest_22
107 log_archive_dest_23
108 log_archive_dest_24
109 log_archive_dest_25
110 log_archive_dest_26
111 log_archive_dest_27
112 log_archive_dest_28
113 log_archive_dest_29
114 log_archive_dest_30
115 log_archive_dest_31
116 log_archive_dest_state_1 enable
117 log_archive_dest_state_2 enable
118 log_archive_dest_state_3 enable
119 log_archive_dest_state_4 enable
120 log_archive_dest_state_5 enable
121 log_archive_dest_state_6 enable
122 log_archive_dest_state_7 enable
123 log_archive_dest_state_8 enable
124 log_archive_dest_state_9 enable
125 log_archive_dest_state_10 enable
126 log_archive_dest_state_11 enable
127 log_archive_dest_state_12 enable
128 log_archive_dest_state_13 enable
129 log_archive_dest_state_14 enable
130 log_archive_dest_state_15 enable
131 log_archive_dest_state_16 enable
132 log_archive_dest_state_17 enable
133 log_archive_dest_state_18 enable
134 log_archive_dest_state_19 enable
135 log_archive_dest_state_20 enable
136 log_archive_dest_state_21 enable
137 log_archive_dest_state_22 enable
138 log_archive_dest_state_23 enable
139 log_archive_dest_state_24 enable
140 log_archive_dest_state_25 enable
141 log_archive_dest_state_26 enable
142 log_archive_dest_state_27 enable
143 log_archive_dest_state_28 enable
144 log_archive_dest_state_29 enable
145 log_archive_dest_state_30 enable
146 log_archive_dest_state_31 enable
147 log_archive_start FALSE
148 log_archive_dest
149 log_archive_duplex_dest
150 log_archive_min_succeed_dest 1
151 standby_archive_dest %ORACLE_HOME%\RDBMS
152 fal_client
153 fal_server
154 log_archive_trace 0
155 log_archive_config
156 log_archive_local_first TRUE
157 log_archive_format ARC%S_%R.%T
158 redo_transport_user
159 log_archive_max_processes 4
160 log_buffer 32546816
161 log_checkpoint_interval 0
162 log_checkpoint_timeout 1800
163 archive_lag_target 0
164 db_files 200
165 db_file_multiblock_read_count 128
166 read_only_open_delayed FALSE
167 cluster_database FALSE
168 parallel_server FALSE
169 parallel_server_instances 1
170 cluster_database_instances 1
171 db_create_file_dest
172 db_create_online_log_dest_1
173 db_create_online_log_dest_2
174 db_create_online_log_dest_3
175 db_create_online_log_dest_4
176 db_create_online_log_dest_5
177 db_recovery_file_dest c:\oracle\fast_recovery_area
178 db_recovery_file_dest_size 4322230272
179 standby_file_management MANUAL
180 db_unrecoverable_scn_tracking TRUE
181 thread 0
182 fast_start_io_target 0
183 fast_start_mttr_target 0
184 log_checkpoints_to_alert FALSE
185 db_lost_write_protect NONE
186 recovery_parallelism 0
187 db_flashback_retention_target 1440
188 dml_locks 1088
189 replication_dependency_tracking TRUE
190 transactions 272
191 transactions_per_rollback_segment 5
192 rollback_segments
193 undo_management AUTO
194 undo_tablespace UNDOTBS1
195 undo_retention 900
196 fast_start_parallel_rollback LOW
197 resumable_timeout 0
198 instance_number 0
199 db_block_checking FALSE
200 recyclebin on
201 db_securefile PERMITTED
202 create_stored_outlines
203 serial_reuse disable
204 ldap_directory_access NONE
205 ldap_directory_sysauth no
206 os_roles FALSE
207 rdbms_server_dn
208 max_enabled_roles 150
209 remote_os_authent FALSE
210 remote_os_roles FALSE
211 sec_case_sensitive_logon TRUE
212 O7_DICTIONARY_ACCESSIBILITY FALSE
213 remote_login_passwordfile EXCLUSIVE
214 license_max_users 0
215 audit_sys_operations FALSE
216 global_context_pool_size
217 db_domain
218 global_names FALSE
219 distributed_lock_timeout 60
220 commit_point_strength 1
221 global_txn_processes 1
222 instance_name oratest
223 service_names ORATEST
224 dispatchers (PROTOCOL=TCP) (SERVICE=ORATESTXDB)
225 shared_servers 1
226 max_shared_servers
227 max_dispatchers
228 circuits
229 shared_server_sessions
230 local_listener
231 remote_listener
232 listener_networks
233 cursor_space_for_time FALSE
234 session_cached_cursors 50
235 remote_dependencies_mode TIMESTAMP
236 utl_file_dir
237 smtp_out_server
238 plsql_v2_compatibility FALSE
239 plsql_warnings DISABLE:ALL
240 plsql_code_type INTERPRETED
241 plsql_debug FALSE
242 plsql_optimize_level 2
243 plsql_ccflags
244 plscope_settings identifiers:none
245 permit_92_wrap_format TRUE
246 java_jit_enabled TRUE
247 job_queue_processes 1000
248 parallel_min_percent 0
249 create_bitmap_area_size 8388608
250 bitmap_merge_area_size 1048576
251 cursor_sharing EXACT
252 result_cache_mode MANUAL
253 parallel_min_servers 0
254 parallel_max_servers 135
255 parallel_instance_group
256 parallel_execution_message_size 16384
257 hash_area_size 131072
258 result_cache_max_size 72482816
259 result_cache_max_result 5
260 result_cache_remote_expiration 0
261 audit_file_dest C:\ORACLE\ADMIN\ORATEST\ADUMP
262 shadow_core_dump none
263 background_core_dump partial
264 background_dump_dest c:\oracle\diag\rdbms\oratest\oratest\trace
265 user_dump_dest c:\oracle\diag\rdbms\oratest\oratest\trace
266 core_dump_dest c:\oracle\diag\rdbms\oratest\oratest\cdump
267 object_cache_optimal_size 102400
268 object_cache_max_size_percent 10
269 session_max_open_files 10
270 open_links 4
271 open_links_per_instance 4
272 commit_write
273 commit_wait
274 commit_logging
275 optimizer_features_enable 11.2.0.3
276 fixed_date
277 audit_trail DB
278 sort_area_size 65536
279 sort_area_retained_size 0
280 cell_offload_processing TRUE
281 cell_offload_decryption TRUE
282 cell_offload_parameters
283 cell_offload_compaction ADAPTIVE
284 cell_offload_plan_display AUTO
285 db_name ORATEST
286 db_unique_name ORATEST
287 open_cursors 300
288 ifile
289 sql_trace FALSE
290 os_authent_prefix OPS$
291 optimizer_mode ALL_ROWS
292 sql92_security FALSE
293 blank_trimming FALSE
294 star_transformation_enabled TRUE
295 parallel_degree_policy MANUAL
296 parallel_adaptive_multi_user TRUE
297 parallel_threads_per_cpu 2
298 parallel_automatic_tuning FALSE
299 parallel_io_cap_enabled FALSE
300 optimizer_index_cost_adj 100
301 optimizer_index_caching 0
302 query_rewrite_enabled TRUE
303 query_rewrite_integrity enforced
304 pga_aggregate_target 4831838208
305 workarea_size_policy AUTO
306 optimizer_dynamic_sampling 2
307 statistics_level TYPICAL
308 cursor_bind_capture_destination memory+disk
309 skip_unusable_indexes TRUE
310 optimizer_secure_view_merging TRUE
311 ddl_lock_timeout 0
312 deferred_segment_creation TRUE
313 optimizer_use_pending_statistics FALSE
314 optimizer_capture_sql_plan_baselines FALSE
315 optimizer_use_sql_plan_baselines TRUE
316 parallel_min_time_threshold AUTO
317 parallel_degree_limit CPU
318 parallel_force_local FALSE
319 optimizer_use_invisible_indexes FALSE
320 dst_upgrade_insert_conv TRUE
321 parallel_servers_target 128
322 sec_protocol_error_trace_action TRACE
323 sec_protocol_error_further_action CONTINUE
324 sec_max_failed_login_attempts 10
325 sec_return_server_release_banner FALSE
326 enable_ddl_logging FALSE
327 client_result_cache_size 0
328 client_result_cache_lag 3000
329 aq_tm_processes 1
330 hs_autoregister TRUE
331 xml_db_events enable
332 dg_broker_start FALSE
333 dg_broker_config_file1 C:\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE\DR1ORATEST.DAT
334 dg_broker_config_file2 C:\ORACLE\PRODUCT\11.2.0\DBHOME_1\DATABASE\DR2ORATEST.DAT
335 olap_page_pool_size 0
336 asm_diskstring
337 asm_preferred_read_failure_groups
338 asm_diskgroups
339 asm_power_limit 1
340 control_management_pack_access DIAGNOSTIC+TUNING
341 awr_snapshot_time_offset 0
342 sqltune_category DEFAULT
343 diagnostic_dest C:\ORACLE
344 tracefile_identifier
345 max_dump_file_size unlimited
346 trace_enabled TRUE961262 wrote:
The used tables:
Table 1: 312 col, 12,248 MB, 11,138,561 rows, avg len 621 bytes
Table 2: 159 col, 4288 MB, 5,441,171 rows, avg len 529 bytes
Table 3: 118 col, 360MB, 820,259 rows, avg len 266 bytes
The FTS has improved as expected. With 5 physical drives in a RAID0, a performance of
420MB/s was achieved.
In the write test on the other hand we were not able to archieve any improvement.
The CTAS statement always works with about 5000 - 6000 BLOCK/s (80MB/s)
But when we tried running several CTAS statements in different sessions, the overall speed increased as expected.
Further tests showed that the write speed seems to depend also on the number of columns. 80MB/s were only
possible with Tables 2 and 3. With Table 1, however only 30MB/s were measured.
If multiple CTAS can produce higher throughput on writes this tells you that it is the production of the data that is the limit, not the writing. Notice in your example that nearly 75% of the time of the CTAS as CPU, not I/O.
The thing about number of columns is that table 1 has exceeded the critical 254 limit - this means Oracle has chained all the rows internally into two pieces; this introduces lots of extra CPU-intensive operations (consistent gets, table access by rowid, heap block compress) so that the CPU time could have gone up significantly, resulting in a lower throughput that you are interpreting as a write problem.
One other thought - if you are currently doing CTAS by "create as select from {real SAP table}" there may be other side effects that you're not going to see. I would do "create test clone of real SAP table", then "create as select from clone" to try and eliminate any such anomalies.
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
Author: <b><em>Oracle Core</em></b> -
Cursor memory use in a background job
I am researching a solution for a client, and need help as I'm admittedly an Oracle greenhorn. They run 10g Enterprise Edition.
{color:navy}*The problem*{color}: create a low-priority background process that uses DB inactivity windows to read through a large table (over 25 million records) a row at a time, and perform some simple operations with a few fields from each row. The process needs to be running 24x7 by default, although able to be administratively paused/restarted at any time. It also needs to pause itself M hours after last row read, and restart after a subsequent N hours.
h3.
Oracle Jobs
First, I'm wondering whether this sounds like a task suitable for a "job" managed by the Scheduler (<tt>DBMS_SCHEDULER</tt>), which could be enabled or disabled to mimic pausing/restarting functionality.
h3.
Cursors and memory usage
My second, main question lies with memory usage. One of their main concerns is that the background process not occupy much memory on the server. The general flow I've worked up:
<li> Function1: declare and open a cursor for the main SELECT. This would be run once only. Call Function2.
<li> Function2: the second, main function would perform a fetch of one row on the cursor, and make a call to an auxiliary function to operate on the data. Function2 would be executed constantly as the main process.
<li> Function3: close the cursor. Would be executed upon reaching the last row of the table, or if for some reason the admin. should decide to abort the process prematurely.
<li> If the client decides such, this process may be constant, so it would be restarted automatically with a call back to Function1.
However, I don't understand cursors enough to know if that would occupy a lot of memory on the server throughout the life-cycle of the master process, knowing ahead of time that the resultset the cursor identifies is very large. I've attempted to research this both in manuals (the DB Administrator, SQL Reference, Application Developer's Guide) and these forums, but not able to track down a clear answer -- I got lost somewhere between PGA and SGA memory. The furthest I've gotten in understanding cursors is that they're a mere instruction set, not a copy of the resultset, and therefore don't occupy a substantial amount of resident memory. I would very much appreciate some verification about whether this is accurate or not.
I'm wide open to suggestions -- thanks in advance for the help!Wow, so many good questions make me only think of more questions! Part of the problem is I don't get to talk directly to the client -- any questions I have (such as statistical data about the main_table) must be formed to my manager, who relays them to the client and then we wait for an answer.
Toine wrote:
Are these 'DB inactivity windows' predictable time windows or do you mean that the process should only eat up resources when activity on the database server is low?Not predictable timeframes, but rather the process should take advantage of database server inactivity.
acadet wrote:
For the large table, how does it get its data and what happens to a row once it has been processed? Is the data static or constantly changing and if it does change, does it happen in a batch or in a series of small update/inserts etc.To my best knowledge, and without compromising the client's security: _the main table represent debts_. This is a financial institution, and it is their primary table. Each record contains about 100 fields which include various dates, amounts, rates, etc. Unfortunately, as I commented before, this table does not have a numeric primary key, but rather the 2 fields (one numeric and one varchar2) which serve together as unique identifiers. It's not a static table, as new debts are added a bit at a time for new clients, etc. Also, the existing debts are updated when rates change, etc. I've requested statistical information on the extent to which the data is updated.
Billy Verreynne wrote:
All SQLs that are parsed and executed in Oracle, is done as cursors. Do not confuse that with how the client deals with that cursor, explicitly, implicitly, via a cursor or ref cursor handle, etc. SQL = cursor.
Andre raised an important point - it sounds like what should be business/functional specifications having technical detail included that needs to be part of the solution. Been in a few boardroom brawls myself over that - telling clients that they must state WHAT needs to be done, and not technically HOW it will be done. Worse offenders usually are senior or executive management that used to be techies decades ago and still think that they are somehow still technically competent at a software engineering level.Of course I was referring to an explicit cursor when I asked about disabling consistent read. I'm very doubtful that this is a good idea any more.
Another challenge I have with this client is that since they are a large company and actually have their own development team, the requirements come from different members of that team. Depending who wrote them, they are better or more poorly stated, and often mix in detailed technical requirements framing a boxed solution. You would expect the management to revise these requirements and weed out the nonessentials that we should be able to propose ourselves... go figure. <steps down from soapbox>
I know it's hard for everyone to understand the main requirements when I've piece-mealed the problem description together. I'm just concerned about not revealing too much information that might even possibly compromise the client.
How does the following solution sound:
I've discarded the "explicit big-momma cursor that does it all ;)" possibility, as it presents way too many issues. Instead, we can propose to the client that we add a column to the debts_table which tracks processing status, 0 or 1. 0 if it hasn't been processed yet or errors occur in processing, and 1 once it's processed successfully. 0 would be the default for all existing records and on addition of new debts. In this way, all I would have to do is select one row at a time, possibly in order of the debt's addition date, and if its processing status is 0 then process it. If it completes successfully, update the status to 1. Flow would return back to the select statement, which would select the next row with status=0, and so on.
Edited by: CrackerJackhammer on Aug 5, 2009 2:43 AM
Maybe you are looking for
-
How do I insert a link to an internal page into .mucow
Hi, I am quite new to Muse and I want to build a .mucow Widget, to configure a an external JS file. As I am having some links to place, I was wandering, how to get a option for an internal link. The documentation is only talking about external links,
-
Widgets in table cells? Just one only?
I can get one textfield to respond to user input, but more than one widget in a table cell doesn't seem to work unfortunately. Anyone else get this to work?
-
"flipping" album info and artwork
how do I turn this off?
-
Hi experts! My scenerio is to get an idoc from r/3 mapp that idoc to required required and then store it as an xml i ftp folder. i got the idoc from r/3, converted that idoc to idoc structure, data is coming into the structure but whenever i am tryin
-
How to automatically update marked table
Hi Friends, I am using Oracle SQL Developer and want to set the in Preferences menu that my actual selected and viewed database table is marked automatically in Connections/Tables menu. How can I set this function in Oracle SQL Developer. Br, Ugur