Deleting unwanted SYS shema objects [message #509028] |
Wed, 25 May 2011 11:31 |
|
geobraik
Messages: 34 Registered: April 2011
|
Member |
|
|
Hi,
I was importing one schema from Oracle 10g to 11g using traditional import. I imported as a SYS user, so all the objects created in SYS schema. Can you please tell me how can I remove these objects and retain only default SYS objects
Thanks in advance
Geobraik
|
|
|
|
Re: Deleting unwanted SYS shema objects [message #509033 is a reply to message #509032] |
Wed, 25 May 2011 12:08 |
John Watson
Messages: 8960 Registered: January 2010 Location: Global Village
|
Senior Member |
|
|
Importing non-SYS objects into the SYS schema definitely works:
c:\users\john\home>imp 'sys/oracle as sysdba' file=dept.dmp full=yes
Import: Release 11.2.0.2.0 - Production on Wed May 25 18:02:33 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Export file created by EXPORT:V11.02.00 via conventional path
Warning: the objects were exported by SCOTT, not by you
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
import server uses AL32UTF8 character set (possible charset conversion)
. importing SCOTT's objects into SYS
. importing SCOTT's objects into SYS
. . importing table "DEPT" 4 rows imported
Import terminated successfully without warnings.
c:\users\john\home>
Perhaps you can identify the imported objects with a query such as this:
select object_name from all_objects where owner='SYS' and last_ddl_time > sysdate -60/1440; if you know approximately when the import ran?
|
|
|
|
Re: Deleting unwanted SYS shema objects [message #509047 is a reply to message #509039] |
Wed, 25 May 2011 13:34 |
|
Michel Cadot
Messages: 68718 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
- Never ever use SYS (or SYSDBA) but for maintenance purpose (startup, shutdown, backup, recover)
- SYS/SYSDBA is special
- SYS/SYSDBA is Oracle proprietary (try to open a SR/TAR starting with "i did that with SYS/SYSDBA" and you'll see the immediate answer)
- SYS/SYSDBA does not act like any other user
- When you use SYS/SYSDBA Oracle deactivates some code path and activates others
- Whatever you do with SYS/SYSDBA will neither validate nor invalidate the same thing with any other user.
NEVER EVER use SYS/SYSDBA for anything that can be done by another user.
Use SYS/SYSDBA ONLY for something that can't be done by someone else.
Quote:I want to import two more schemas, which is in a single dump file (exp). Please tell me the best way to import.
C:\>imp help=y
Import: Release 10.2.0.4.0 - Production on Mer. Mai 25 20:33:51 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
You can let Import prompt you for parameters by entering the IMP
command followed by your username/password:
Example: IMP SCOTT/TIGER
Or, you can control how Import runs by entering the IMP command followed
by various arguments. To specify parameters, you use keywords:
Format: IMP KEYWORD=value or KEYWORD=(value1,value2,...,valueN)
Example: IMP SCOTT/TIGER IGNORE=Y TABLES=(EMP,DEPT) FULL=N
or TABLES=(T1:P1,T1:P2), if T1 is partitioned table
USERID must be the first parameter on the command line.
Keyword Description (Default) Keyword Description (Default)
--------------------------------------------------------------------------
USERID username/password FULL import entire file (N)
BUFFER size of data buffer FROMUSER list of owner usernames
FILE input files (EXPDAT.DMP) TOUSER list of usernames
SHOW just list file contents (N) TABLES list of table names
IGNORE ignore create errors (N) RECORDLENGTH length of IO record
GRANTS import grants (Y) INCTYPE incremental import type
INDEXES import indexes (Y) COMMIT commit array insert (N)
ROWS import data rows (Y) PARFILE parameter filename
LOG log file of screen output CONSTRAINTS import constraints (Y)
DESTROY overwrite tablespace data file (N)
INDEXFILE write table/index info to specified file
SKIP_UNUSABLE_INDEXES skip maintenance of unusable indexes (N)
FEEDBACK display progress every x rows(0)
TOID_NOVALIDATE skip validation of specified type ids
FILESIZE maximum size of each dump file
STATISTICS import precomputed statistics (always)
RESUMABLE suspend when a space related error is encountered(N)
RESUMABLE_NAME text string used to identify resumable statement
RESUMABLE_TIMEOUT wait time for RESUMABLE
COMPILE compile procedures, packages, and functions (Y)
STREAMS_CONFIGURATION import streams general metadata (Y)
STREAMS_INSTANTIATION import streams instantiation metadata (N)
DATA_ONLY import only data (N)
The following keywords only apply to transportable tablespaces
TRANSPORT_TABLESPACE import transportable tablespace metadata (N)
TABLESPACES tablespaces to be transported into database
DATAFILES datafiles to be transported into database
TTS_OWNERS users that own data in the transportable tablespace set
Import terminated successfully without warnings.
See FROMUSER/TOUSER and do it in 2 passes.
Regards
Michel
|
|
|
|
|
|
Re: Deleting unwanted SYS shema objects [message #509120 is a reply to message #509114] |
Thu, 26 May 2011 03:28 |
Roachcoach
Messages: 1576 Registered: May 2010 Location: UK
|
Senior Member |
|
|
Michel Cadot wrote on Thu, 26 May 2011 09:16Quote:also shows the same result
Quote:Why this difference?
If it is same I don't see any difference.
Regards
Michel
I didnt either at first but I think he refers to this line hidden between tags:
Quote:results obtained are Source DB : 851 TargetDB : 699
The "same results" seems to refer to the queries against ALL_ and DBA_ views.
[Updated on: Thu, 26 May 2011 03:29] Report message to a moderator
|
|
|
|
|
Re: Deleting unwanted SYS shema objects [message #509137 is a reply to message #509123] |
Thu, 26 May 2011 04:33 |
|
geobraik
Messages: 34 Registered: April 2011
|
Member |
|
|
This is the import log of another schema (deleted the middle part. There was no errors)
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
Export file created by EXPORT:V10.01.00 via conventional path
import done in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
import server uses AR8MSWIN1256 character set (possible charset conversion)
export client uses AR8MSWIN1256 character set (possible charset conversion)
. . importing table "xxxxxx" 1 rows imported
....................................................................
..................................................................
About to enable constraints...
Import terminated successfully without warnings.
The above mentioned quries returned 208 for source and 126 for source;
gives only 77 in both soure and destination.
The import parameters used are
imp beda/*** file=beda.dmp log=beda.log grants=n compile=y fromuser=beda touser=beda
[Updated on: Thu, 26 May 2011 05:14] Report message to a moderator
|
|
|