You are on page 1of 14

10g Questions and Answers

Alejandro Vargas,
Oracle Israel,
Principal Support Consultant

1) Are there 10+ TB production databases working with Dataguard? ..................................................................... 2


2) How many production sites are using RAC + Dataguard?................................................................................... 2
3) Are uncommitted transactions written to flashback redologs?............................................................................. 2
4) Can flashback database be implemented more than once after resetlogs? ........................................................... 2
5) How to get SCN numbers on 9i, 10g.................................................................................................................... 3
6) How to Migrate of 10TB database from 9i to 10g + 10 standby sites.................................................................. 3
7) Trigger related information .................................................................................................................................. 4
8) Public references of 10g production Customer using ASM, Dataguard .............................................................. 4
9) 10g RAC + Data Guard Physical Standby reference-able production sites ......................................................... 4
10) 10g + ASM reference-able production sites ....................................................................................................... 4
11) Strategies for migration from FS to ASM .......................................................................................................... 5
12) Are flashback recovery parameters dynamic?.................................................................................................... 5
13) Which is the difference for the statistics level parameter in 9i and 10g............................................................. 5
14) Is it possible to do flashback after truncate?....................................................................................................... 7
15) Can we restore a dropped table after a new table with the same name has been created? ................................. 7
16) Can we export a dropped table? ......................................................................................................................... 8
17) v$sql_bind_capture, when it samples? ............................................................................................................... 8
18) Can bind capture be activated on purpose? ........................................................................................................ 8
19) Is Times Ten incorporated into 10g?.................................................................................................................. 9
20) How Oracle 10g decides the # of processes to drop a partition table?............................................................. 10
21) Are outline_parameters needed on 10g? .......................................................................................................... 11
22) How to check a profile definition explain plan ................................................................................................ 12
23) Useful 10g Links .............................................................................................................................................. 13
1) Are there 10+ TB production databases working with Dataguard?

Yes, there are several production sites using dataguard that are bigger than 10TB

2) How many production sites are using RAC + Dataguard?

I was able to find specific references for 251 Production sites using Dataguard Physical Standby + RAC
In terms of OS they are distributed in this way:

HPUX 40
Solaris 57
Linux 83
Other 71

This is not a complete list.

3) Are uncommitted transactions written to flashback redologs?

Yes uncommited transactions that are lately rolled-back will be written to flashback archived logs.

4) Can flashback database be implemented more than once after resetlogs?

Having this scenario:

an error was unnoticed at 01:00


at 16:00 error was reported and database is flashed back (by error) until 02:00
at 18:00 the error with the flashback is noticed.

1) can be the database flashed back to 01:00 again?


2) if yes can the txs applied from 02:00 to 18:00 be applied?

1) Yes. Once a flashback is implemented and the database opened using resetlogs, a second flashback can
be implemented to an SCN that is smaller than that of the first flashback, the database incarnation will be set
accordingly.

2) No With flashback
Yes. Using log mining.

5) How to get SCN numbers on 9i, 10g

select sys.dbms_flashback.get_system_change_number from dual;

6) How to Migrate of 10TB database from 9i to 10g + 10 standby sites

1. Stop the standby database from applying redo logs


2. Stop the redo logs from being shipped
3. Upgrade the executables for the primary database server
4. Upgrade the executables for the standby database server
5. Upgrade the primary database (see Note 316889.1)
6. Mount the standby database
7. Re-enable the shipping of redo from primary to standby
8. Restart the managed recovery process on the standby database to progress redo apply

References:
http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14239/upgrades.htm#sthref2055
Note 407040.1: How To Upgrade A Primary Database And A Physical Standby To Oracle10gR2 (10.2)
7) Trigger related information

http://www.psoug.org/reference/table_trigger.html
http://www.psoug.org/reference/ddl_trigger.html
http://www.psoug.org/reference/system_trigger.html
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_triggers.htm#ADFNS012

8) Public references of 10g production Customer using ASM, Dataguard

Public available Production Customer references can be found here:

http://www.oracle.com/customers/products/database.html
http://www.oracle.com/customers/products/rac.html

9) 10g RAC + Data Guard Physical Standby reference-able production sites

There are 65 reference-able Dataguard + RAC production sites.

Reference able customers may be contacted through your Oracle Sales Manager or SDM

10) 10g + ASM reference-able production sites

There are 64 reference-able ASM + RAC production sites.

Reference able customers may be contacted through your Oracle Sales Manager or SDM
11) Strategies for migration from FS to ASM

• Rman
• Dbms_file_transfer
• Online reconfiguration
• Ftp
• Alter table move.
• Gradual migration possible by having datafiles on both FS and ASM
• The data can be moved over using any available downtime windows and any of the referred
methods.

12) Are flashback recovery parameters dynamic?

Flashback database must be enabled with the database mounted.

All other parameters are dynamic.

13) Which is the difference for the statistics level parameter in 9i and 10g

On Both 9i and 10g statistics_level control auto tuning capabilities.


This sql can be used to check available features in both versions:

col statistics_name for a30 head "Statistics Name"


col session_status for a10 head "Session|Status"
col system_status for a10 head "System|Status"
col activation_level for a10 head "Activation|Level"
col session_settable for a10 head "Session|Settable"

SELECT STATISTICS_NAME,
SESSION_STATUS,
SYSTEM_STATUS,
ACTIVATION_LEVEL,
SESSION_SETTABLE
FROM v$statistics_level
ORDER BY 1
/

10g statistics_level control the following features


(highlighted options available on 9i):

Session System Activation Session


Statistics Name Status Status Level Settable
------------------------------ ---------- ---------- ---------- ----------
Active Session History ENABLED ENABLED TYPICAL NO
Bind Data Capture ENABLED ENABLED TYPICAL NO
Buffer Cache Advice ENABLED ENABLED TYPICAL NO
Global Cache Statistics ENABLED ENABLED TYPICAL NO
Longops Statistics ENABLED ENABLED TYPICAL NO
MTTR Advice ENABLED ENABLED TYPICAL NO
Modification Monitoring ENABLED ENABLED TYPICAL NO
PGA Advice ENABLED ENABLED TYPICAL NO
Plan Execution Statistics DISABLED DISABLED ALL YES
Segment Level Statistics ENABLED ENABLED TYPICAL NO
Shared Pool Advice ENABLED ENABLED TYPICAL NO
Streams Pool Advice ENABLED ENABLED TYPICAL NO
Threshold-based Alerts ENABLED ENABLED TYPICAL NO
Timed OS Statistics DISABLED DISABLED ALL YES
Timed Statistics ENABLED ENABLED TYPICAL YES
Ultrafast Latch Statistics ENABLED ENABLED TYPICAL NO
Undo Advisor, Alerts and Fast ENABLED ENABLED TYPICAL NO
Ramp up

17 rows selected.
9i statistics_level control the following features:

Session System Activation Session


Statistics Name Status Status Level Settable
------------------------------ ---------- ---------- ---------- ----------
Buffer Cache Advice ENABLED ENABLED TYPICAL NO
MTTR Advice ENABLED ENABLED TYPICAL NO
PGA Advice ENABLED ENABLED TYPICAL NO
Plan Execution Statistics DISABLED DISABLED ALL YES
Segment Level Statistics ENABLED ENABLED TYPICAL NO
Shared Pool Advice ENABLED ENABLED TYPICAL NO
Timed OS Statistics DISABLED DISABLED ALL YES
Timed Statistics ENABLED ENABLED TYPICAL YES

8 rows selected.

14) Is it possible to do flashback after truncate?

No, cannot do flashback after a ddl, because it invalidated undo data for the object.

Both flashback table and flashback query will fail with error:

ORA-01466: unable to read data - table definition has changed

15) Can we restore a dropped table after a new table with the same name has been
created?

Yes, using the sintax:

Restore table <tabname> to before drop rename to <newname>;


16) Can we export a dropped table?

No, export can be done for objects as of time using the flashback_time or flashback_scn export parameters.

Data Definition Language statements that alter the structure of a table, such as drop/modify column, move
table, drop partition, truncate table/partition, and so on, invalidate the old undo data for the table.
It is not possible to retrieve a snapshot of data from a point earlier than the time such DDLs were executed.

To export a dropped table you will need first to execute flashback drop on it.

17) v$sql_bind_capture, when it samples?

Sampling is comprehensive.

* In 10.2 the bind values used at parse time are available, in 9.2 and 10.1 they are not.
* The values for user binds are available, the values for system binds are not (cursor_sharing).
* Literals replaced by system binds are used for optimization even if _optim_peek_user_binds = false.

To display the values of user bind variables that were peeked when a statement was parsed, use
DBMS_XPLAN.DISPLAY_CURSOR with the undocumented 'ADVANCED' (or 'PEEKED_BINDS')
format. The peeked bind values are stored and extracted from the other_xml column of v$sql_plan.

18) Can bind capture be activated on purpose?

It will be activated when setting statistics_level = typical and deactivated setting them to basic.
It can be deactivated without affecting other awr activity using event awr_flush_table_off, level 56

References :
Note 273121.1 - How To Find The Value of a Bind Variable Without Tracing
Note 296765.1 - Solutions for possible AWR Library Cache Latch Contention Issues in Oracle 10g
Note 43808.1 - VIEW: "V$SQL_BIND_DATA" Reference Note

19) Is Times Ten incorporated into 10g?

Times Ten is a different product, it's last releast, Version 7, was completely developed inside Oracle, and a
tighter integration with the Oracle 10g Database was implemented on it.

It delivers real-time caching for critical enterprise Oracle Databases.

Oracle TimesTen 7 delivers several key enhancements to help customers capture, access, and manage
information significantly faster, including:

* Data type compatibility — familiar Oracle Database 10g data types are now available in Oracle
TimesTen 7 for easier application development and caching data in memory;
* New SQL features — Oracle TimesTen 7 includes enhanced SQL functionality, with similar semantics
and behaviors as Oracle Database 10g;
* Globalization functionality — more than 50 database character sets and 80 languages are now supported
with Oracle TimesTen 7;
* Automatic data aging and on-demand data loading — when used as a cache, data in Oracle TimesTen 7
can be dynamically loaded and automatically aged out of memory; and,
* Cross-tier high availability — data can be automatically synchronized across replicated Oracle TimesTen
databases and Oracle Databases

The new real-time caching capabilities of Oracle TimesTen 7 support a wide variety of applications where
instant access to specific types of data from an Oracle database is required. Oracle TimesTen 7 provides out-
of-the-box support for the most common caching scenarios:
* Dynamic, on-demand caching — often used in customer-facing applications to load data for a specific
customer when they first arrive and add or update data as the interaction progresses. In a call-center or
customer portal application, this helps speed access to information for the specific group of customers
currently being served;
* Sliding time window caching — useful in business intelligence and analytics applications, where the last
10 minutes of production data or the last 30 days of retail sales data are heavily used for real-time decision-
making; and,
* Reference data caching — useful for customer-facing Web sites or business process acceleration, where
product catalogs, business rules and metadata are heavily accessed.

In each of these scenarios, Oracle TimesTen 7 automatically manages the data movement between the cache
and the underlying enterprise Oracle database, simplifying application development. In addition, Oracle
TimesTen 7 also supports Oracle Real Application Clusters (RAC), Oracle Fusion Middleware, Oracle SQL
Developer and Oracle JDeveloper.

20) How Oracle 10g decides the # of processes to drop a partition table?

I was not able to find this information on the 10g R2 Administration, New Features, Reference or SQL
Reference Manuals.
This is compilation of the available information:

Resource Optimized DROP TABLE for Partitioned Tables

When dropping a large partitioned table in the no recoverable PURGE mode, the DROP operation is
internally split to drop chunks of partitions.

Dropping large partitioned tables can affect tens of thousands of partitions that all have to be logically
removed from the system. The capability of transparently dropping such an object in an incremental fashion
optimizes the resource consumption and positively affects the run-time behavior.
To avoid running into resource constraints, the DROP TABLE...PURGE command for a partitioned table
drops the table in multiple transactions, where each transaction drops a subset of the partitions or
subpartitions and then commits. The table becomes completely dropped at the conclusion of the final
transaction.

If the DROP TABLE...PURGE command fails, you can take corrective action, if any, and then restart the
command. The command resumes at the point where it failed.

When you drop a partitioned table with the PURGE keyword, the statement executes as a series of
subtransactions, each of which drops a subset of partitions or subpartitions and their metadata. This division
of the drop operation into subtransactions optimizes the processing of internal system resource consumption
(for example, the library cache), especially for the dropping of very large partitioned tables. As soon as the
first subtransaction commits, the table is marked UNUSABLE. If any of the subtransactions fails, the only
operation allowed on the table is another DROP TABLE ... PURGE statement. Such a statement will resume
work from where the previous DROP TABLE statement failed, assuming that you have corrected any errors
that the previous operation encountered.

You can list the tables marked UNUSABLE by such a drop operation by querying the status column of the
*_TABLES, *_PART_TABLES, *_ALL_TABLES, or *_OBJECT_TABLES data dictionary views, as
appropriate.

References:
http://st-doc.us.oracle.com/10/102/server.102/b14231/partiti.htm#ADMIN10062
http://st-doc.us.oracle.com/10/102/server.102/b14214/chapter1.htm#sthref360
http://st-doc.us.oracle.com/10/102/server.102/b14200/statements_9003.htm#i2061306
http://st-doc.us.oracle.com/10/102/server.102/b14231/partiti.htm#sthref2746

21) Are outline_parameters needed on 10g?

user_stored_outlines and create_stored_outlines parameters are needed to control outline behaviour.


A good article explaining this functionality is found here:

http://www.ardentperf.com/2007/03/23/tuning-sql-statement-execution-in-10g-part-2/

22) How to check a profile definition explain plan

SQL Profile information is displayed in the DBA_SQL_PROFILES view.

Typically, an accepted SQL Profile is associated with the SQL statement through a special SQL signature
that is generated using a hash function. This hash function normalizes the SQL statement for case (changes
the entire SQL statement to upper case) and white spaces (removes all extra whites spaces) before
generating the signature. The same SQL Profile thus will work for all SQL statements that are essentially
the same, where the only difference is in case usage and white spaces. However, by setting force_match to
true, the SQL Profile will additionally target all SQL statements that have the same text after normalizing
literal values to bind variables. This may be useful for applications that use literal values rather than bind
variables, since this will allow SQL with text differing only in its literal values to share a SQL Profile. If
both literal values and bind variables are used in the SQL text, or if this parameter is set to false (the default
value), literal values will not be normalized.

It is important to note that the SQL Profile does not freeze the execution plan of a SQL statement, as done
by stored outlines. As tables grow or indexes are created or dropped, the execution plan can change with the
same SQL Profile. The information stored in it continues to be relevant even as the data distribution or
access path of the corresponding statement change. However, over a long period of time, its content can
become outdated and would have to be regenerated. This can be done by running Automatic SQL Tuning
again on the same statement to regenerate the SQL Profile.

Aditional tuning information can be found on


Advisor information views, such as DBA_ADVISOR_TASKS, DBA_ADVISOR_FINDINGS,
DBA_ADVISOR_RECOMMENDATIONS, and DBA_ADVISOR_RATIONALE views.

SQL tuning information views, such as DBA_SQLTUNE_STATISTICS, DBA_SQLTUNE_BINDS, and


DBA_SQLTUNE_PLANS views.

SQL Tuning Set views, such as DBA_SQLSET, DBA_SQLSET_BINDS, DBA_SQLSET_STATEMENTS,


and DBA_SQLSET_REFERENCES views.

Information on captured execution plans for statements in SQL Tuning Sets are displayed in the
DBA_SQLSET_PLANS and USER_SQLSET_PLANS views.

Advisor execution progress information is displayed in the V$ADVISOR_PROGRESS view.

Dynamic views containing information relevant to the SQL tuning, such as V$SQL, V$SQLAREA,
V$SQLSTATS, and V$SQL_BINDS views.

23) Useful 10g Links

• OTN RAC
• OTN ASM
• OTN High Availability
• OTN Grid Control
• OTN Recovery Manager
• 10g R2 Online Documentation
• 10g R2 Documentation Download
• RAC Customer References
• Oracle RAC on VMware
• Oracle Software Download
• Enterprise Linux Download
• Real Application Clusters Virtual Book
• ASM Virtual Book
• Enterprise Manager Virtual Book
• RMAN Virtual Book
• Grid Computing Vitrual Book

You might also like