Oracle FULL EXP/IMP 11i Database - 911 SURENDER SARA NCOAUG

Slides:



Advertisements
Similar presentations
ITEC474 INTRODUCTION.
Advertisements

INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Introduction to Oracle Automatic Storage Management (ASM) Copyright System Managers LLC 2008.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Backup and Recovery Copyright System Managers LLC 2008 all rights reserved.
Prligence Empowering Intelligence All About Fine Grained Access Control by Arup Nanda.
Oracle Architecture. Instances and Databases (1/2)
ITEC474 Control File Maintenance
Page Footer Keed Education Oracle Database Administration Basic Copyright 2009 Keed Education BV Version Concept.
INTRODUCTION TO ORACLE Lynnwood Brown System Managers LLC Installation – Lecture 2 Copyright System Managers LLC 2007 all rights reserved.
1 Chapter 15 Duplicating Databases and Transporting Data.
1 Getting The Most Out of RMAN By: Charles Pfeiffer CIO, Remote Control DBA (888)
Harvard University Oracle Database Administration Session 10 Database Backups.
System Administration Accounts privileges, users and roles
Managing an Oracle Instance
Database Backup and Recovery
INTRODUCTION TO ORACLE Lynnwood Brown President System Managers LLC Data Loading & Backup And Recovery Lecture 5 Copyright System Managers LLC 2003 all.
INTRODUCTION TO ORACLE
RMAN Restore and Recovery
Backup and Recovery Part 1.
Chapter 12 Performing Incomplete Recovery. Background Viewed as one of the more difficult chapters to write Thought it was important to put in material.
Harvard University Oracle Database Administration Session 11 Database Recovery.
The Oracle Recovery Manager (RMAN)
Backup Concepts. Introduction Backup and recovery procedures protect your database against data loss and reconstruct the data, should loss occur. The.
Oracle backup and recovery strategy
Using RMAN to Perform Recovery
Backup Infrastructure – Additional Information Gordon D. Brown, RAL Carlos Fernando Gamboa, BNL 3D Workshop, CNAF, Bologna, Italy 13 th June 2007.
IS 4510 – Database Administration Module – 2 Database Backup 10/24/20141Compiled by: Zafar Iqbal Khan.
APPLYING INTEROPERABILITY PATCH FOR ORACLE APPLICATIONS By Ramkumar Srinivasan DBA/System Administrator Dreyer’s Grand Ice Cream Inc.
Backup & Recovery Concepts for Oracle Database
PPOUG, 05-OCT-01 Agenda RMAN Architecture Why Use RMAN? Implementation Decisions RMAN Oracle9i New Features.
11i Cloning Panel Panel Moderator: Sandra Vucinic March, NCOAUG Conference Presenter For Custom Solution – Surender Sara.
7 Copyright © 2006, Oracle. All rights reserved. Dealing with Database Corruption.
C Copyright © 2009, Oracle. All rights reserved. Using Diagnosis and Debugging Techniques.
Database Administration TableSpace & Data File Management
CHAPTER 2 Implementing a Database. Introduction to Creating Databases After you’ve installed the Oracle software, the next logical step is to create a.
Chapter 9 Scripting RMAN. Background Authors felt that scripting was a topic not covered well Authors wanted to cover both Unix/Linux and Windows environments.
1Introduction Objectives 1-2 Course Objectives 1-3 Oracle Products 1-4 Relational Database Systems 1-5 How the Data Is Organized 1-6 Integrity Constraints.
Backup & Recovery Backup and Recovery Strategies on Windows Server 2003.
4 Copyright © 2006, Oracle. All rights reserved. Recovering from Noncritical Losses.
© 2005 Solution Beacon, LLC. All Rights Reserved. Release 11i Workshop Migrate Your Release 11i Oracle Applications to Linux Session Leader Kevin Dahl,
January 21, 2009 Migrating an 11i Database to Linux – Tips, Tricks & Gotchas Mark Morgan DBA Consultant siMMian systems, inc
Copyright (c) by CNAPTICS Corporation. All rights reserved.1 INFO Oracle Database 11g: Administration II Presented By: Marc S. Paller,
03/07/05 NorCal OAUG Training Day Paper v2.0 Jeff Slavitz, Computer Creations Inc.1 Here We Go Again! Upgrading to Jeff Slavitz Computer Creations.
11 Copyright © 2004, Oracle. All rights reserved. Dealing with Database Corruption.
IT Database Administration Section 09. Backup and Recovery Backup: The available options Full Consistent (cold) Backup Database shutdown, all files.
Week 2 Lecture 1 Creating an Oracle Instance. Learning Objectives  Learn the steps for creating a database  Understand the prerequisites for creating.
Creating an Oracle Database. Considerations before creating a DB Planning for Database Creation –Select the standard database block size. –Use an undo.
10 Copyright © Oracle Corporation, All rights reserved. User-Managed Backups.
12 Copyright © Oracle Corporation, All rights reserved. User-Managed Complete Recovery.
6 Copyright © 2007, Oracle. All rights reserved. Performing User-Managed Backup and Recovery.
Starting with Oracle SQL Plus. Today in the lab… Connect to SQL Plus – your schema. Set up two tables. Find the tables in the catalog. Insert four rows.
8 Copyright © 2007, Oracle. All rights reserved. Using RMAN to Duplicate a Database.
3 Copyright © 2007, Oracle. All rights reserved. Using the RMAN Recovery Catalog.
Week 2 Lecture 2 Data Dictionary Views and Control Files.
03/07/05 NorCal OAUG Training Day Paper v1.0 Jeff Slavitz, Computer Creations Inc.1 Here We Go Again! Upgrading to Jeff Slavitz Computer Creations.
C Copyright © 2007, Oracle. All rights reserved. Security New Features.
 CONACT UC:  Magnific training   
Control File Information The database name The timestamp of database creation The names and locations of associated datafiles and redo log files Tablespace.
Oracle 10g Administration Database Control and Storage Structures Copyright ©2006 Custom Training Institute.
3 Copyright © Oracle Corporation, All rights reserved. 管理数据库事例.
RMAN Maintenance.
Backup and Recovery.
Managing Privileges.
Maintaining Online Redo Log Files
Using Data Dictionary and Dynamic Performance Views
Is 221: Database Administration
Recovering from Noncritical Losses
Duplicating a Database
Managing Privileges.
Performing Database Recovery
Oracle 12c Multitenant Database
Presentation transcript:

Oracle FULL EXP/IMP 11i Database SURENDER SARA NCOAUG

Export – Import Need As a last resort for resolving complex problems like fixing data dictionary Required when migrating from one platform to other, ex- from SUN SOLARIS to LINUX Can be used to fix mass fragmentation issues where tablespace is not locally managed yet !

Some Example of Why ? You have a data file what was corrupted that was offline dropped. Seems file is normal under dba_data_files select file_id, file_name, status from dba_data_files where file_id=437 FILE_ID FILE_NAME STATUS /u09/oradata/FINPROD/fndx05.dbf AVAILABLE Data dictionary will still hold the file name in the v$recover_file select * from v$recover_file; FILE# ONLINE ERROR CHANGE# TIME OFFLINE UNKNOWN ERROR NOV-03

What is the issue with Offline Drop Datafile? As long as you do hot and cold backups you are fine. As long as you do RMAN backup you are fine If you try to clone the database using RMAN cloning you will be asked to supply all the archivelogs since the file was offline drop, unless you plan to skip the file. DATA DICTIONARY ENTRY WILL NEVER BE REMOVED. Creating a new data dictionary is the only way to fix it ! ( true on 8i and 9i, 10g not tested)

Environment Setup , 8174 database and Sun Solaris 8 MINIPACK AD-H Applied Patch , is already applied as part of install base

PRE EXPORT Steps Apply latest AD minipack F or higher ( In my environment we were at AD-H) Apply the Applications consolidated export/import utility patch. Apply patch to the source administration server node Apply patch to every application tier server node in the source system. ( It is already a part of install base) If you have installed the Rapid Install, apply patch ( we were at ) select * from global_name. Will need this after the export and before the import. Create the export parameter file ( see next slide) Generate target database instance creation script adcrdb.sql using sracrdb.sql ( EXP.zip file) Record Advanced Queue settings using auque1.sql ( EXP.zip file) Record Oracle ConText default tablespace On the source database server node, use SQL*Plus to connect to the source database as sysdba and run the following query: $ sqlplus /nolog SQL> connect sys/ as sysdba; –SQL> select username, default_tablespace from dba_users where username='CTXSYS'; Shut down all Applications server processes except the database and the Net8 listener for the database

Dynamic SQL to see how many rows exist “WORKFLOW TABLES will take lot of time if not clean” select 'select count(*) from ' || owner ||'.'|| object_name || ' ;' from dba_objects where object_type = 'TABLE' and ( object_name like '%WF_JMS_IN%' or object_name like '%WF_JMS_OUT%' or object_name like '%WF_CONTROL%' or object_name like '%WF_NOTIFICATION%' ) /

Exporting 11i database exp sys/pass9999 parfile=auexpimp.dat auexpimp.dat –userid="sys/pass9999 as sysdba" –buffer= –file=/scratch/EXP/FINPROD.exp –compress=y –grants=y –indexes=y –rows=y –constraints=y –full=y –log=/scratch/EXP/finprod.log

PRE IMPORT- sracrdb.sql File – Fixing path Copy script adclondb.sql to sracrdb.sql Fix the function to look like below function file_name(X_file_name in varchar2) return varchar2 is l_slash_pos number; begin return(''''||X_file_name||''''); end;

PRE IMPORT – Delete the current database Make sure EXPORT is good Run extend_data_files.sql to produce extendme.sql Delete all datafiles, controlfiles and logfiles

PRE IMPORT – Recreate a New One Remove the password file from $ORACLE_HOME/dbs Modify init.ora to comment the line REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE Run adcrdb.sql sqlplus /nolog __1 connect internal; spool adcrdb.log; startup exit; __1

PRE IMPORT – Recreate Dictionary Run post DATABASE create script to install the data dictionary sqlplus /nolog __1 connect internal; spool sys_system_java_misc1.log; @addbjava.sql exit; __1

PRE IMPORT – ORD Install Set ORACLE_HOME connect

interMedia Install connect connect connect connect

Install Spatial Option connect begin ORDSYS.Cartridge.Register( 'SDO', 'Oracle Spatial Cartridge', ' Development', 'Oracle8 Spatial Cartridge', 'INVALID' ); end; AR import and HR import of few tables will fail if this is not installed properly

Intermedia install Pass these 4 FALSE USERS TEMP /u01/oracle/finproddb/8.1.7/ctx/lib/libctxx8.so

ctxsys connect ctxsys/ctxsys prompt prompt The output from dr0inst.sql is in dr0inst.log

Pre-Import alter database rename global_name to ;

Import DAT file userid="sys/pass9999 as sysdba" buffer= file=/scratch/EXP/FINPROD.exp grants=y indexes=y rows=y constraints=y full=y log=/scratch/EXP/impFINPROD.log ignore=y analyze=n commit=y

Import Script imp sys/pass9999 parfile=imp.dat

Script to See The data Export For example we can see what was exported for given tables select 'grep –I “ ' || object_name || ‘ “ finprod.log' from dba_objects where object_type = 'TABLE' and ( object_name like '%WF_JMS_IN%' or object_name like '%WF_JMS_OUT%' or object_name like '%WF_CONTROL%' or object_name like '%WF_NOTIFICATION%' ) /

Run auque2.sql Run auque2.sql to enable the AQ

Possible AQ That will not work ERROR at line 1: ORA-20000: Oracle Error Mkr4= ORA-24002: QUEUE_TABLE APPLSYS.WF_JMS_IN does not exist ORA-06512: at line 24 The see the AQ table for the queue that are failing – select * from user_queue_tables where queue_table in ('WF_JMS_IN', 'WF_JMS_OUT', 'WF_CONTROL','WF_NOTIFICATION_IN', 'WF_NOTIFICATION_OUT'); To see the objects related the the above queues –select owner, object_type, status, object_name from dba_objects where object_type = 'TABLE' and ( object_name like '%WF_JMS_IN%' or object_name like '%WF_JMS_OUT%' or object_name like '%WF_CONTROL%' or object_name like '%WF_NOTIFICATION%' ) ;

Check How much Data Was Exported Dynamic SQL to see how much data was exported may be needed to estimate the table level import ( AGAIN ) select 'grep -i " ' || object_name || ' " finprod.log' from dba_objects where object_type = 'TABLE' and ( object_name like '%WF_JMS_IN%' or object_name like '%WF_JMS_OUT%' or object_name like '%WF_CONTROL%' or object_name like '%WF_NOTIFICATION%' ) / grep -i " AQ\$_WF_CONTROL_H " finprod.log grep -i " AQ\$_WF_CONTROL_I " finprod.log

AQ Fix – Drop it all ! set linesize select object_name,object_type FROM user_objects where object_name like 'WF_%'; col OBJECT_NAME format a40 select * from user_queue_tables where queue_table in ('WF_JMS_IN', 'WF_JMS_OUT', 'WF_CONTROL','WF_NOTIFICATION_IN', 'WF_NOTIFICATION_OUT'); select owner, object_type, status, object_name from dba_objects where object_type = 'TABLE' and ( object_name like '%WF_JMS_IN%' ) ; connect as applsys drop view AQ$WF_JMS_IN ; drop view AQ$WF_JMS_IN_S ; drop sequence AQ$_WF_JMS_IN_N ; ALTER SESSION SET EVENTS '10851 trace name context forever, level 2'; drop table AQ$_WF_JMS_IN_H cascade constraint ; drop table AQ$_WF_JMS_IN_I cascade constraint ; drop table AQ$_WF_JMS_IN_S cascade constraint ; drop table AQ$_WF_JMS_IN_T cascade constraint ; drop table WF_JMS_IN cascade constraint ;

Identify AQ tables connect sys SELECT schema, name, objno FROM SYSTEM.AQ$_QUEUE_TABLES WHERE name like '%WF_JMS_IN%' ; SCHEMA NAME OBJNO APPLSYS WF_JMS_IN APPLSYS WF_JMS_OUT

Identify AQ SELECT oid, table_objno, name FROM SYSTEM.AQ$_QUEUES WHERE name IN ( 'AQ$_WF_JMS_IN_E', 'AQ$_WF_JMS_OUT_E', 'AQ$_WF_CONTROL_E', 'AQ$_WF_NOTIFICATION_IN_E', 'AQ$_WF_NOTIFICATION_OUT_E' ); OID TABLE_OBJNO NAME ECA3727F39B26E6FE BA0D8DD AQ$_WF_NOTIFICATION_OUT_E ECA3727F39B16E6FE BA0D8DD AQ$_WF_NOTIFICATION_IN_E ECA3727F39B06E6FE BA0D8DD AQ$_WF_CONTROL_E ECA5415C274B703AE BA0D8DD AQ$_WF_JMS_OUT_E ECA5415C274A703AE BA0D8DD AQ$_WF_JMS_IN_E

Delete the AQ data DELETE FROM SYSTEM.AQ$_QUEUE_TABLES where objno in ( SELECT objno FROM SYSTEM.AQ$_QUEUE_TABLES WHERE name like '%WF_JMS_IN%' or name like '%WF_JMS_OUT%' or name like '%WF_CONTROL%' or name like '%WF_NOTIFICATION%' ) ; DELETE FROM SYSTEM.AQ$_QUEUES WHERE table_objno in ( SELECT table_objno FROM SYSTEM.AQ$_QUEUES WHERE name IN ( 'AQ$_WF_JMS_IN_E', 'AQ$_WF_JMS_OUT_E', 'AQ$_WF_CONTROL_E', 'AQ$_WF_NOTIFICATION_IN_E', 'AQ$_WF_NOTIFICATION_OUT_E' ) );

Locate OBJ$ Entries connect as sys select distinct o.owner# from obj$ o, user$ u where o.owner#=u.user# and u. name='APPLSYS'; OWNER# SELECT obj#,name FROM SYS.OBJ$ WHERE type#=24 AND owner# =35 AND name IN ( 'AQ$_WF_JMS_IN_E', 'AQ$_WF_JMS_OUT_E', 'AQ$_WF_CONTROL_E', 'AQ$_WF_NOTIFICATION_IN_E', 'AQ$_WF_NOTIFICATION_OUT_E' ); OBJ# NAME AQ$_WF_NOTIFICATION_OUT_E AQ$_WF_NOTIFICATION_IN_E AQ$_WF_CONTROL_E AQ$_WF_JMS_OUT_E AQ$_WF_JMS_IN_E

Fix OBJ$ table SELECT obj#,name FROM SYS.OBJ$ WHERE type#=46 AND owner# = 35 AND name in ( 'AQ$_WF_JMS_IN_E', 'AQ$_WF_JMS_OUT_E', 'AQ$_WF_CONTROL_E', 'AQ$_WF_NOTIFICATION_IN_E', 'AQ$_WF_NOTIFICATION_OUT_E' ); DELETE FROM SYS.OBJ$ WHERE obj# IN ( SELECT obj# FROM SYS.OBJ$ WHERE type#=24 AND owner# =35 AND name IN ( 'AQ$_WF_JMS_IN_E', 'AQ$_WF_JMS_OUT_E', 'AQ$_WF_CONTROL_E', 'AQ$_WF_NOTIFICATION_IN_E', 'AQ$_WF_NOTIFICATION_OUT_E' ));

Final Step select name from SYS.EXPACT$ WHERE owner='APPLSYS' AND name LIKE '%WF%'; select name from SYS.NOEXP$ WHERE owner='APPLSYS' AND name LIKE '%WF%'; DELETE FROM SYS.EXPACT$ WHERE owner='APPLSYS' AND name LIKE '%WF%'; DELETE FROM SYS.NOEXP$ WHERE owner='APPLSYS' AND name LIKE '%WF%';

POSIBLE Queues you have to fix select * from user_queue_tables where queue_table in ('WF_JMS_IN', 'WF_JMS_OUT', 'WF_CONTROL','WF_NOTIFICATION_IN', 'WF_NOTIFICATION_OUT'); select owner, object_type, status, object_name from dba_objects where object_type = 'TABLE' and ( object_name like '%WF_JMS_IN%' or object_name like '%WF_JMS_OUT%' or object_name like '%WF_CONTROL%' or object_name like '%WF_NOTIFICATION%' ) ;

Contact and QA