IMP Import parameters in Oracle Show=y detailed

Source: Internet
Author: User
Tags reserved oracle database
The code is as follows Copy Code

In the help of IMP: show just list file contents (n), the default is N.

The following experiment shows 2 points:

1.show=y can display statements that create objects in the DMP file.

2.show=y as Oracle says, just list file contents, this is not an import operation.

Prepare the experimental environment:

1. Create a user and empower:

Sql> create user testshow identified by A123;

User created

Sql> Grant Connect,resource to Testshow;

Grant succeeded

Sql> Grant create synonym to Testshow
2/
Grant succeeded

2. Create objects:

Sql> CREATE TABLE Test (ID number,name varchar2 (20));

Table created

sql> create synonym emp for scott.emp;

Synonym created

3. To see if the object was created successfully:

Sql> Select COUNT (*) from EMP;
COUNT (*)
----------
16
Sql> select * from test;
ID NAME
---------- --------------------

Start Experiment:

1. Export all objects for the Testshow User:

C:usersyafeishi>exp System/dang file=testshow.dmp compress=n owner=testshow
Export:release 10.2.0.3.0-production on Monday August 27 13:20:00 2012
Copyright (c) 1982, +, Oracle. All rights reserved.
Connect to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0-production
With the partitioning, OLAP and Data Mining options
Exported ZHS16GBK character set and Al16utf16 NCHAR character set
The specified user is about to be exported ...
. Exporting Pre-schema process objects and actions
. Exporting external function library names for user testshow
. Export public type synonyms
. Exporting private type synonyms
. Exporting user Testshow Object type definitions
About to export Testshow objects ...
. Exporting database Links
. Exporting ordinal
. Exporting cluster definitions
. The table to be exported testshow through the general path ...
. . Exporting table test export 0 rows
. Exporting synonyms
. Exporting views
. Exporting stored Procedures
. Exporting operators
. Exporting referential integrity constraints
. Exporting triggers
. Exporting index types
. Exporting bitmaps, functional indexes, and extensible indexes
. Exporting late table activity
. Exporting materialized views
. Exporting snapshot logs
. Exporting job queues
. Exporting refresh groups and subgroups
. Exporting dimension
. Exporting Post-Schema process objects and actions
. Exporting statistics
The export was successfully terminated and no warning occurred.

2. Delete the test table under Testshow with the same name as EMP:

sql> drop table test;

Table dropped

Sql> select * from test;

SELECT * FROM Test

ORA-00942: Table or view does not exist

  code is as follows copy code

sql> drop synonym emp;

Synonym dropped

Sql> Select COUNT (*) from EMP;

Select COUNT (*) from EMP

ORA-00942: Table or view does not exist

3.show=y import Operation

C:usersyafeishi>imp System/dang file=testshow.dmp log=testshow.log show=y from
User=testshow touser= Testshow
Import:release 10.2.0.3.0-production on Monday August 13:20:45
Copyright (c) 1982,%, ORACLE.&NB Sp All rights reserved.
Connect to: Oracle Database 10g Enterprise Edition release 10.2.0.3.0-production
with the partitioning, OLAP and Data Mining options
Export files created by export:v10.02.01 through a regular path
have completed import
in the ZHS16GBK character set and Al16utf16 NCHAR character set. The Testshow object to the Testshow

  code is as follows copy code
" Sys.dbms_logrep_imp.instantiate_schema (schema_name=> Sys_context (' USERENV ', ' "
Current_schema '), export_db_name=> ' ORCL. Regress. Rdbms. DEV. RSI ORACLE. COM ', I '
"nst_scn=> ' 11274324817182 ');"
COMMIT; End; "
ALTER session SET current_schema= "Testshow" "
" CREATE TABLE "TEST" ("ID" number, "NAME" VARCHAR2 ())   PCT Free pctused "
" Initrans 1 Maxtrans 255 STORAGE (INITIAL 65536 1 freelists GROUP "
" S 1 freelist DEFAULT) tablespace "USERS" LOGGING nocompress
. Skipping table ' TEST '
' ALTER session SET current_schema= ' Testshow '
CREATE synonym "EMP" for "SCOTT". EMP ""

The import was successfully terminated and no warning occurred.


You can see that the log is out of the statement that created the object, proving the 1th.

And then see if the objects in the library are imported:

The code is as follows Copy Code

Sql> select * from test;

SELECT * FROM Test

ORA-00942: Table or view does not exist

The code is as follows Copy Code

Sql> Select COUNT (*) from EMP;

Select COUNT (*) from EMP

ORA-00942: Table or view does not exist

Seeing the object and not importing it proves the 2nd.

4.show=n Import

  code is as follows copy code
c: Usersyafeishi>imp System/dang file=testshow.dmp log=testshow.log show=n igno
re=y fromuser=testshow touser= Testshow
Import:release 10.2.0.3.0-production on Monday August 13:21:35
Copyright (c) 1982,%, ORACLE.&NB Sp All rights reserved.
Connect to: Oracle Database 10g Enterprise Edition release 10.2.0.3.0-production
with the partitioning, OLAP and Data Mining options

Export files created by export:v10.02.01 through a regular path
have completed import
in the ZHS16GBK character set and Al16utf16 NCHAR character set. Importing Testshow objects to Testshow . . Importing Tables                            "TEST" Imported             0 Line
successfully terminated the import without warning.

  code is as follows copy code

sql> SELECT * from test;

        ID NAME

------------------------------

Sql> Select COUNT (*) from EMP;

  COUNT (*)

----------

       

The

object is also imported in.

---EOF

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.