Thursday, May 27, 2010

10g Questions and Answers

www.allwalkin.blogspot.com www.allwalkin.blogspot.com
Page 1
10g Questions and AnswersAlejandro Vargas, Oracle Israel, Principal Support Consultant1) Are there 10+ TB production databases working with Dataguard? ..................................................................... 22) How many production sites are using RAC + Dataguard?................................................................................... 23) Are uncommitted transactions written to flashback redologs?............................................................................. 24) Can flashback database be implemented more than once after resetlogs? ........................................................... 25) How to get SCN numbers on 9i, 10g.................................................................................................................... 36) How to Migrate of 10TB database from 9i to 10g + 10 standby sites.................................................................. 37) Trigger related information .................................................................................................................................. 48) Public references of 10g production Customer using ASM, Dataguard .............................................................. 49) 10g RAC + Data Guard Physical Standby reference-able production sites ......................................................... 410) 10g + ASM reference-able production sites....................................................................................................... 411) Strategies for migration from FS to ASM .......................................................................................................... 512) Are flashback recovery parameters dynamic?.................................................................................................... 513) Which is the difference for the statistics level parameter in 9i and 10g............................................................. 514) Is it possible to do flashback after truncate?....................................................................................................... 715) Can we restore a dropped table after a new table with the same name has been created?................................. 716) Can we export a dropped table? ......................................................................................................................... 817) v$sql_bind_capture, when it samples? ............................................................................................................... 818) Can bind capture be activated on purpose? ........................................................................................................ 819) Is Times Ten incorporated into 10g?.................................................................................................................. 920) How Oracle 10g decides the # of processes to drop a partition table?............................................................. 1021) Are outline_parameters needed on 10g? .......................................................................................................... 1122) How to check a profile definition explain plan ................................................................................................ 1223) Useful 10g Links .............................................................................................................................................. 13
--------------------------------------------------------------------------------
Page 2 www.allwalkin.blogspot.com
1) Are there 10+ TB production databases working with Dataguard?Yes, there are several production sites using dataguard that are bigger than 10TB2) 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 40Solaris 57Linux 83Other 71This 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:00at 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?
--------------------------------------------------------------------------------
Page 3
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 canbe implemented to an SCN that is smaller than that of the first flashback, the database incarnation will be setaccordingly.2) No With flashbackYes. Using log mining.5) How to get SCN numbers on 9i, 10gselect sys.dbms_flashback.get_system_change_number from dual;6) How to Migrate of 10TB database from 9i to 10g + 10 standby sites1. Stop the standby database from applying redo logs2. Stop the redo logs from being shipped3. Upgrade the executables for the primary database server4. Upgrade the executables for the standby database server5. Upgrade the primary database (see Note 316889.1)6. Mount the standby database7. Re-enable the shipping of redo from primary to standby8. Restart the managed recovery process on the standby database to progress redo applyReferences:http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14239/upgrades.htm#sthref2055Note 407040.1: How To Upgrade A Primary Database And A Physical Standby To Oracle10gR2 (10.2)
--------------------------------------------------------------------------------
www.allwalkin.blogspot.comPage 4
7) Trigger related informationhttp://www.psoug.org/reference/table_trigger.htmlhttp://www.psoug.org/reference/ddl_trigger.htmlhttp://www.psoug.org/reference/system_trigger.html http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_triggers.htm#ADFNS0128) 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.htmlhttp://www.oracle.com/customers/products/rac.html9) 10g RAC + Data Guard Physical Standby reference-able production sitesThere are 65 reference-able Dataguard + RAC production sites.Reference able customers may be contacted through your Oracle Sales Manager or SDM10) 10g + ASM reference-able production sitesThere are 64 reference-able ASM + RAC production sites.Reference able customers may be contacted through your Oracle Sales Manager or SDM
--------------------------------------------------------------------------------
Page 5
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 referredmethods.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 10gOn 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,
--------------------------------------------------------------------------------
www.allwalkin.blogspot.comPage 6
SESSION_STATUS,SYSTEM_STATUS,ACTIVATION_LEVEL,SESSION_SETTABLEFROM v$statistics_levelORDER BY 1/10g statistics_level control the following features(highlighted options available on 9i):Session System Activation SessionStatistics Name Status Status Level Settable------------------------------ ---------- ---------- ---------- ----------Active Session History ENABLED ENABLED TYPICAL NOBind Data Capture ENABLED ENABLED TYPICAL NOBuffer Cache Advice ENABLED ENABLED TYPICAL NOGlobal Cache Statistics ENABLED ENABLED TYPICAL NOLongops Statistics ENABLED ENABLED TYPICAL NOMTTR Advice ENABLED ENABLED TYPICAL NOModification Monitoring ENABLED ENABLED TYPICAL NOPGA Advice ENABLED ENABLED TYPICAL NOPlan Execution Statistics DISABLED DISABLED ALL YESSegment Level Statistics ENABLED ENABLED TYPICAL NOShared Pool Advice ENABLED ENABLED TYPICAL NOStreams Pool Advice ENABLED ENABLED TYPICAL NOThreshold-based Alerts ENABLED ENABLED TYPICAL NOTimed OS Statistics DISABLED DISABLED ALL YESTimed Statistics ENABLED ENABLED TYPICAL YESUltrafast Latch Statistics ENABLED ENABLED TYPICAL NOUndo Advisor, Alerts and Fast ENABLED ENABLED TYPICAL NORamp up17 rows selected.
--------------------------------------------------------------------------------
Page 7
9i statistics_level control the following features:Session System Activation SessionStatistics Name Status Status Level Settable------------------------------ ---------- ---------- ---------- ----------Buffer Cache Advice ENABLED ENABLED TYPICAL NOMTTR Advice ENABLED ENABLED TYPICAL NOPGA Advice ENABLED ENABLED TYPICAL NOPlan Execution Statistics DISABLED DISABLED ALL YESSegment Level Statistics ENABLED ENABLED TYPICAL NOShared Pool Advice ENABLED ENABLED TYPICAL NOTimed OS Statistics DISABLED DISABLED ALL YESTimed Statistics ENABLED ENABLED TYPICAL YES8 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 beencreated?Yes, using the sintax:Restore table to before drop rename to ;
--------------------------------------------------------------------------------

www.allwalkin.blogspot.comPage 8
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, movetable, 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, useDBMS_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 56References :
--------------------------------------------------------------------------------
www.allwalkin.blogspot.com
Page 9
Note 273121.1 - How To Find The Value of a Bind Variable Without TracingNote 296765.1 - Solutions for possible AWR Library Cache Latch Contention Issues in Oracle 10gNote 43808.1 - VIEW: "V$SQL_BIND_DATA" Reference Note19) Is Times Ten incorporated into 10g?Times Ten is a different product, it's last releast, Version 7, was completely developed inside Oracle, and atighter 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 manageinformation significantly faster, including:* Data type compatibility — familiar Oracle Database 10g data types are now available in OracleTimesTen 7 for easier application development and caching data in memory;* New SQL features — Oracle TimesTen 7 includes enhanced SQL functionality, with similar semanticsand behaviors as Oracle Database 10g;* Globalization functionality — more than 50 database character sets and 80 languages are now supportedwith Oracle TimesTen 7;* Automatic data aging and on-demand data loading — when used as a cache, data in Oracle TimesTen 7can be dynamically loaded and automatically aged out of memory; and,* Cross-tier high availability — data can be automatically synchronized across replicated Oracle TimesTendatabases and Oracle DatabasesThe new real-time caching capabilities of Oracle TimesTen 7 support a wide variety of applications whereinstant 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:
--------------------------------------------------------------------------------
Page 10
* Dynamic, on-demand caching — often used in customer-facing applications to load data for a specificcustomer when they first arrive and add or update data as the interaction progresses. In a call-center orcustomer portal application, this helps speed access to information for the specific group of customerscurrently being served;* Sliding time window caching — useful in business intelligence and analytics applications, where the last10 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, whereproduct catalogs, business rules and metadata are heavily accessed.In each of these scenarios, Oracle TimesTen 7 automatically manages the data movement between the cacheand the underlying enterprise Oracle database, simplifying application development. In addition, OracleTimesTen 7 also supports Oracle Real Application Clusters (RAC), Oracle Fusion Middleware, Oracle SQLDeveloper 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 SQLReference Manuals. This is compilation of the available information:Resource Optimized DROP TABLE for Partitioned TablesWhen dropping a large partitioned table in the no recoverable PURGE mode, the DROP operation isinternally split to drop chunks of partitions.Dropping large partitioned tables can affect tens of thousands of partitions that all have to be logicallyremoved from the system. The capability of transparently dropping such an object in an incremental fashionoptimizes the resource consumption and positively affects the run-time behavior.
--------------------------------------------------------------------------------
Page 11
To avoid running into resource constraints, the DROP TABLE...PURGE command for a partitioned tabledrops the table in multiple transactions, where each transaction drops a subset of the partitions orsubpartitions and then commits. The table becomes completely dropped at the conclusion of the finaltransaction.If the DROP TABLE...PURGE command fails, you can take corrective action, if any, and then restart thecommand. 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 ofsubtransactions, each of which drops a subset of partitions or subpartitions and their metadata. This divisionof 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 thefirst subtransaction commits, the table is marked UNUSABLE. If any of the subtransactions fails, the onlyoperation allowed on the table is another DROP TABLE ... PURGE statement. Such a statement will resumework from where the previous DROP TABLE statement failed, assuming that you have corrected any errorsthat 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, asappropriate.References:http://st-doc.us.oracle.com/10/102/server.102/b14231/partiti.htm#ADMIN10062http://st-doc.us.oracle.com/10/102/server.102/b14214/chapter1.htm#sthref360http://st-doc.us.oracle.com/10/102/server.102/b14200/statements_9003.htm#i2061306http://st-doc.us.oracle.com/10/102/server.102/b14231/partiti.htm#sthref274621) Are outline_parameters needed on 10g?user_stored_outlines and create_stored_outlines parameters are needed to control outline behaviour.
--------------------------------------------------------------------------------
Page 12
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 planSQL 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 signaturethat is generated using a hash function. This hash function normalizes the SQL statement for case (changesthe entire SQL statement to upper case) and white spaces (removes all extra whites spaces) beforegenerating the signature. The same SQL Profile thus will work for all SQL statements that are essentiallythe same, where the only difference is in case usage and white spaces. However, by setting force_match totrue, the SQL Profile will additionally target all SQL statements that have the same text after normalizingliteral values to bind variables. This may be useful for applications that use literal values rather than bindvariables, since this will allow SQL with text differing only in its literal values to share a SQL Profile. Ifboth literal values and bind variables are used in the SQL text, or if this parameter is set to false (the defaultvalue), 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 doneby stored outlines. As tables grow or indexes are created or dropped, the execution plan can change with thesame SQL Profile. The information stored in it continues to be relevant even as the data distribution oraccess path of the corresponding statement change. However, over a long period of time, its content canbecome outdated and would have to be regenerated. This can be done by running Automatic SQL Tuningagain on the same statement to regenerate the SQL Profile.Aditional tuning information can be found on
--------------------------------------------------------------------------------
Page 13
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, andDBA_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 theDBA_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
--------------------------------------------------------------------------------
Page 14
• Enterprise Linux Download• Real Application Clusters Virtual Book• ASM Virtual Book• Enterprise Manager Virtual Book• RMAN Virtual Book• Grid Computing Vitrual Book
Post a Comment

Receive All Free Updates Via Facebook.