Server Administration :: Difference In SQL Results From Oracle 9i To 11gR2?
Jan 2, 2011
I've migrated from Oracle 9i to Oracle 11gR2, when i'm checking my application on Oracle 11gR2, i found that some of the query result are differed from the previous version of Oracle 9i, which is very illogical to me. I've checked the data for all related tables which are involved in one of the query. I've checked all indexes also. Still i'm not convinced that Oracle is doing anything wrong. I cannot recreate the whole scenario here, because of many tables involved in that query.
One of the sample query code.
select 'ProductMaster' producttype,e.schemecd,e.SCHEMESHORTDESC as SCHEMEDESC,to_char(e.schemefrdate,'dd/MM/yyyy')as schemefrdate, to_char(e.schemetodate,'dd/MM/yyyy') as schemetodate,e.mkid ,e.countrycd,e.statecd,e.districtcd,f.schemetype, a.productcd,a.packsizecd,a.packtypecd,a.sortorder1, a.countrycd,a.statecd,a.districtcd,a.p_uniqueid,a.mrp, (a.productcd ||'-'||b.countryname||'-'||c.statename||'-'||d.districtname|| ' -pkt.prc:'||a.pktprice ||' -mrp:'||a.mrp) as pcode
from wb.wbproductdetails a
I have oracle 10g running on oracle ASM 11.1, I want to know that if i install oracle 11gr2 database , can i use oracle 11.1 ASM which is already installed ?
I am migrating an oracle 10g to 11gR2. i am a bit confused. The developers in my work place have a tablespace for storing table and a different tablespace for storing indexes.
For the migration i am using exp and imp. My question is how i am going to migrate the indexes from 10g to 11gR2?
My problem is when trying to use oradmin.exe. It doesn't exists apparently. I have Database Creation Assistant and Net Creation Assistant, I can open and run sqlplux.exe and run sql commands, but oradmin.exe seems to be missing.
This is a new install of Oracle EE 11gR2 on Windows 7 Pro.
I want to install Oracle EE 11gR2 on my Windows 7 Professional 64-bit laptop. Installed memory is 8GB.I need to install 32-bit server since Oracle Warehouse Builder will not run on a 64-bit o/s. Further, I use Toad 9.7.2 which will only recognise client 32-bit.
I had a few failed attempts, especially when the database was being created with the ORA-12560: TNS:protocol adapter error,
So here's what I did:
Changed C:WindowsSystem32driversetchosts so that it contains two lines 127.0.0.1 localhost & ::1 localhost Changed properties of setup.exe in the installation directory to be Windows XP SP2 compatible and run as administrator Selected "install database software only" (so I could figure out at what step the installation fails) Selected "single instance" Selected "Enterprise Edition" Selected oracle base "c:app" (instead of default location c:appd_seng)
Copy of files was completed successfully, log file was created in c:program files(x86)oracleinventorylogs & registry entries were added to "HKEY_LOCAL_MACHINESOFTWAREWow6432NodeORACLE" (with keys KEY_OraDb11g_home1, ODP.NET & OracleMTSRecoveryService), and the following services were created:
OracleMTSRecoveryService: Started/Automatic OracleOraDb11g_home1ClrAgent: Not started/Manual OracleRemExecService: Started/Disabled
There are no listener.ora & tnsnames.ora yet. Sqlnet.ora is created with the line SQLNET.AUTHENTICATION_SERVICES = (NTS)
Now I went to Start, All Programs, Oracle - OraDb11g_home1, Configuration and Migration Tools, right clicked on "Net Configuration Assistant" and changed the properties to be Windows XP SP2 compatible and run as administrator and ran it. I selected "Listener Configuration", added a listener called LISTENER, TCP protocol, port 1521 and finished. A service called "OracleOraDb11g_home1TNSListener" was created and started in automatic mode. The PATH was updated and listener.ora was created with the lines:
At the command prompt, lsnrctl.status shows: LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 15-APR-2012 12:42 :19
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DSG-HP6555b)(PORT=1521))
STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Produ ction Start Date 15-APR-2012 12:37:54
[code]...
At the command prompt, lsnrctl.services shows: LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 15-APR-2012 12:43:15
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=DSG-HP6555b)(PORT=1521)) ) Services Summary... Service "CLRExtProc" has 1 instance(s). Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:0 refused:0 LOCAL SERVER
The command completed successfully Now I went to start, all programs, Oracle - OraDb11g_home1, Configuration and Migration Tools, right clicked on "Database Configuration Assistant" and changed the properties to be Windows XP SP2 compatible and run as administrator and ran it.
I chose to create a databaseGeneral purpose Global database name ORCL SID ORCL Chose "Configure Enterprise Manager" & "Configure Database Control for local management" and disabled "Automatic maintenance tasks" Used the same password for all accounts
Selected storage type "File System" & "Use Database File Locations from Template" Unchecked Flash Recovery & Archiving Selected "Sample Schemas", "Typical" memory size (1228MB), "Use Automatic Memory Management" Left sizing/character sets/connection mode as default, and Selected "Generate Database Creation Scripts" in C:appadminORCLscripts (if I choose to Create Database, it fails with TNS Protocol Adapter Error).
I now open ORCL.bat in an editor, go to command prompt, create the directories as per the file, set ORACLE_SID=ORCL & path.
The next step C:appproduct11.2.0dbhome_1inoradim.exe -edit -sid ORCL -startmode auto -srvcstart system give an error "Unable to start service, OS Error 1056" (probably implies services already running), nothing is present in the windows alert logs about this. If I stop the service OracleVssWriterORCL, then this command completes, although no messages are returned.
The next step in the batch file starts sqplus /nolog and calls ORCL.sql.
ORCL.sql accepts passwords for sys, system, sysman & dbsnmp. It then executes host C:appproduct11.2.0dbhome_1inorapwd.exe file=C:appproduct11.2.0dbhome_1databasePWDORCL.ora force=y, which prompts me for the password for sys.
ORCL.sql then calls CloneRmanRestore.sql, which then tries to run connect "SYS"/"&&sysPassword" as SYSDBA
This is when I get the error ORA-12560: TNS:protocol adapter error, which has been haunting me for days.
My gut feel is that the database creation step at sqlplus is unable to recognise the listener...or probably it does not recognise the modified registry location (with Wow6432Node), the file oracle.key in C:appproduct11.2.0dbhome_1BIN shows the string SOFTWAREORACLEKEY_OraDb11g_home1.
I then changed oracle.key to point to SOFTWAREWow6432NodeORACLEKEY_OraDb11g_home1, restarted the listener and ORCL service, but connecting as sys returns the same error.
"How to Migrate Oracle 11gR2 32bit to 11gR2 64bit on Microsoft Windows"
Currently we are having Microsoft Windows Server 2003 standard Edition service pack 2 and we are trying to migrate it to microsoft windows server 2008 Release 2 standard Edition
We are having major differences in performance when accessing an Oracle 11gR2 database from two different environments.
I won't sadden you with the gory details of the full application but I will use an indicative example of our problem.
We have SQL Developer in both environments. In each of these SQL Developer instances is a defined a connection to the same database on another machine. So there is the PC looking at a database and a virtual instance looking at the same database.
Selecting the '+' sign next to 'tables' for that connection, on the PC the list of four tables comes back in 4 seconds but on the virtual instance the list of the same four tables comes back in 1 minute and 50 seconds.
This sort of timing issue is repeatable for all accesses to the Oracle database on the third machine.
We just upgraded to 11g and have run into incorrect results for some of our LEFT JOINs. If the table, view, subquery, or WITH clause that is being LEFT JOINed to contains any constants, the results are not correct.
For example, a test (nonsensical) view such as the following is created:
create or replace view fyvtst1 as select spriden_pidm as fyvtst1_pidm, 'Sch' as fyvtst1_test from spriden where spriden_last_name like 'Sch%' ;
When I run the following query, I get correct results; that is, only those with "Sch" starting their last name are listed.
select spriden_pidm, spriden_last_name, fyvtst1_pidm, fyvtst1_test from spriden join fyvtst1 on fyvtst1_pidm = spriden_pidm ;
However, when I change the JOIN to a LEFT JOIN, the last column contains "Sch" for all rows, instead of NULL:
select spriden_pidm, spriden_last_name, fyvtst1_pidm, fyvtst1_test from spriden left join fyvtst1 on fyvtst1_pidm = spriden_pidm ;
We've discovered other quirky things related to this. A WITH clause with similar logic as the above view, when LEFT JOINed to a table will also cause the constant to appear in each row, instead of NULL (and only the value where there is a join). But when additional columns are added to the WITH, it behaves correctly.
This is easy enough to rewrite - but we have WITHs and views containing constants in numerous places, and cannot hope to track down every single one successfully before the incorrect results are used.
Finally, the NO_QUERY_TRANSFORMATION hint will force the query to work correctly. Unfortunately, it has a huge negative performance impact (one query ran for an hour, vs. 1 second in 10g).
dbms_metadata is giving me code that will create more datafiles than the original, and furthermore won't run: firstly, because two files are named with a null string, and secondly because it includes RESIZE commands which won't work because they nominate OMF file names. Or is dbms_metadata unreliable?
LSNRCTL> status Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production Start Date 09-NOV-2012 19:55:06 Uptime 0 days 0 hr. 24 min. 26 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File C:oracleproduct11.2.0dbhome_1 etworkadminlistener.ora Listener Log File c:oraclediag nslsnrTESTQ51listeneralertlog.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=NDCORCKSDQ51.global.loc)(PORT=1521))) Services Summary... Service "testdb" has 1 instance(s). Instance "ksdtest", status READY, has 1 handler(s) for this service... Service "testdbXDB" has 1 instance(s). Instance "testdb", status READY, has 1 handler(s) for this service... The command completed successfully
i am trying to rename the logfile "c:oraclediag nslsnrTESTQ51listeneralertlog.xml" to "c:oraclediag nslsnrTESTQ51listeneralert estdb.log"
so far i tried
LSNRCTL> set log_file testdb.log Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521)) TNS-01251: Cannot set trace/log directory under ADR LSNRCTL>
difference between V$ and V_$ views. It looks same to me. lets take the example of V$LOG and V_$LOG , both views returns same set of columns when described.
SQL> desc V$LOG Name Null? Type ----------------------------------------- -------- ----------------- GROUP# NUMBER THREAD# NUMBER SEQUENCE# NUMBER BYTES NUMBER MEMBERS NUMBER ARCHIVED VARCHAR2(3) STATUS VARCHAR2(16) FIRST_CHANGE# NUMBER FIRST_TIME DATE
SQL> desc V_$LOG Name Null? Type ----------------------------------------- -------- ----------------- GROUP# NUMBER THREAD# NUMBER SEQUENCE# NUMBER BYTES NUMBER MEMBERS NUMBER ARCHIVED VARCHAR2(3) STATUS VARCHAR2(16) FIRST_CHANGE# NUMBER FIRST_TIME DATE
We want to find out difference of data for some tables between current day & previous day. We can use query with minus operation but it will take lot of time since table size is in range from 200 to 500 GB. We have to do this exercise every day.
I have Windows server working Oracle 8.0.5.I have to migrate to another server that is Oracle 11gR2 on Windows 2008.Some say I can't do Export and Import directly.And some say DBlink is not working from 11Gr2 to 8.
What can be fewest step to migrate?Somebody try to use 'Oracle directory' and VB and Powerbuilder program to send data and DDL from 8 to 11Gr2.
I am using 11gR2 on windows server. This is the query that runs many times a day and effect badly the performance of database. I don't have much idea about this query.
SELECT TO_CHAR(current_timestamp AT TIME ZONE 'GMT', 'YYYY-MM-DD HH24:MI:SS TZD') AS curr_timestamp, COUNT(username) AS failed_count FROM sys.dba_audit_session WHERE returncode != 0 AND TO_CHAR(timestamp, 'YYYY-MM-DD HH24:MI:SS') >= TO_CHAR(current_timestamp - TO_DSINTERVAL('0 0:30:00'), 'YYYY-MM-DD HH24:MI:SS')
In oracle 11g R2 , I face a problem when I export/import xml records in the tables . Everytime it takes huge time (like 2 or 3 days) to import or export the data . But the dump size is very small (4gb) and this dump comes from a vendor so that I dont understand that is it a data structure problem or it the normal behaviour to import xml records.
I am not used to with xml record with oracle database before. Here I am using datapump feature . I also mention that when I delete the schema (where I imported the xml data) , it also takes 2/3 days to delete.The import script will hang in the following stage :
Import: Release 11.2.0.1.0 - Production on Sun Jan 29 11:10:38 2012 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options Master table "SYSTEM"."SYS_IMPORT_SCHEMA_02" successfully loaded/unloaded Starting "SYSTEM"."SYS_IMPORT_SCHEMA_02": system/******** DIRECTORY=isb_dir DUMPFILE=jblbld_20110301_01.dmp,jblbld_20110301_02.dmp,jblbld_20110301_03.dmp logfile=JBLBLD_28Jan2012.log schemas=TBLD Processing object type SCHEMA_EXPORT/USER [code]...
The machine has 16 cpu , 32 gb RAM and during export/import most of the time maximum memory will free.
From some day I have this error during export data pump:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options ORA-31626: job does not exist ORA-31687: error creating worker process with worker id 1 ORA-31687: error creating worker process with worker id 1 ORA-31688: Worker process failed during startup.
This error is random, if I retry after few minutes the expdp work correctly.
Migrating the LIVE server to a NEW virtual machine.2 databases reside on the LIVE server, one runs in archivelog mode &other no archivelog modeOld server-Windows 2003 32 bit, oracle databases 11.1.0.7.0New-Windows 2008 64 bit,Oracle databases should be 11.2.0.3.0Just want to clarify the following1)When installing oracle, what would be the best option-create and configure a database / install software only(later create database using dbca) ?why? Just want to know if there will be a difference at all in these 2 methods.2)What is the best way to migrate the data in the database, datapump or rman (rman takes full backup in the present "live" so this can be moved to "new live" and can be recovered)? What would be the method with least downtime?(Once the data is transferred, the database in the "old server"will be deleted)3)The structure of the data files (folder path) are going to be different in the old and new servers, so I have to precreate the tablespaces, so will the impdp fail in this case?
Currently I am doing one Oracle installation.But very much confused where to start from. Since I am installing oracle on my personaly Laptop,do I need to install Oracle database server and Oracle client both or only installing database server is sufficient.
What is the exact difference between oracle database server and client.Only knowledge I have is that client is used to access database server remotely.are Oracle database server and client installable to be downloaded separately?
I've inherited a 10.2.0.1.0 instance running on a windows 2003 box; running fine, no problems other than system has been in production since 2005 and has gotten pretty old and tired. This old box has one tablespace on it... called "gateway".
I've installed 11.2.0.1 on a new (Windows 2008 R2 Enterprise 64-bit) server and created an empty database also called "gateway".
Now to move the data and views, objects, everything.
I've read up on a variety of migration techniques (oops, I mean "upgradation" LOL) and can follow the steps...
In short, I want to pull everything off of server a (10.2) and put it into production on server b (11.2). There seems to be quit a few options.
1. install 10.2 on my NEW server (server b), move the data over and get everything running, then install 11.2 and have it upgrade the database as part of the installation process. 2. drop the empty tablespace on server b, stop the database on server a, copy the files over from the old to the new home, run DBUA or set the compatibility attribute... 3. run some type of server a to server b utility that can bridge the two over the network. Some type of mirroring technique? 4. run file export scripts on server a, copy files to server b and run various import scripts
I tend to think that option 3 would be the best because both instances are in great health and are running right now. Is there a mechanism that allows the 11.2 instance to see and upgrade from a different server?
i am trying to install Oracle 10.10.2.0 on Windows Server 2003 standard x64 Edition Service Pack, but when i try to run the installer or open DVD it gives me below error.
"The image file D: is Valid, but is for a machine type other than the current machine."