Detailed description of imp import parameter show = y in oracle-mysql tutorial

Source: Internet
Author: User
In the help of imp: SHOWjustlistfilecontents (N), the default value is N.

In the help of imp: SHOW just list file contents (N). The default value is N.

In the help of imp: SHOW just list file contents (N). The default value is N.

The code is as follows:

In the help of imp: SHOW just list file contents (N). The default value is N.

The following experiment explains two points:

1. show = y: displays the statements for creating objects in the dmp file.

2. show = y, as oracle said, just list file contents. import is not performed here.

Prepare the experiment environment:

1. create a user and grant permissions:

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 an object:

SQL> create table test (id number, name varchar2 (20 ));

Table created

SQL> create synonym emp for scott. emp;

Synonym created

3. check whether the object is successfully created:

SQL> select count (*) from emp;
COUNT (*)
----------
16
SQL> select * from test;
ID NAME
------------------------------

Start the experiment:

1. export all objects of 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,200 5, 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
The ZHS16GBK and AL16UTF16 NCHAR character sets have been exported.
Will export the specified user...
. Exporting objects and operations in the pre-schema process
. Exporting the external function library name of User TESTSHOW
. Export PUBLIC Type synonyms
. Exporting the special type synonym
. Exporting the object type definition of user TESTSHOW
The TESTSHOW object to be exported...
. Exporting Database link...
. Exporting sequence number
. Exporting cluster definition
. The TESTSHOW table will be exported through the regular path...
.. Export table TEST export 0 rows
. Exporting synonym
. Exporting view...
. Exporting the stored procedure
. Exporting operator
. The reference integrity constraints are being exported.
. Exporting trigger...
. Exporting index type...
. Exporting bitmap, functional index, and scalable index
. Exporting table activity later
Exporting the Materialized view
Exporting snapshot logs
. Exporting job queue...
. Exporting refresh group and sub-group
. Exporting dimension...
. Exporting objects and operations in the post-schema process
. Exporting statistics
The export is successfully terminated without a warning.

2. delete the test table and emp table under testshow with the same name:

SQL> drop table test;

Table dropped

SQL> select * from test;

Select * from test

ORA-00942: table or view does not exist

The code is as follows:

SQL> drop synonym emp;

Synonym dropped

SQL> select count (*) from emp;

Select count (*) from emp

ORA-00942: table or view does not exist

3. import with show = y

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 27 13:20:45 2012
Copyright (c) 1982,200 5, 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
EXPORT file created by EXPORT: V10.02.01 in the normal path
The ZHS16GBK character set and AL16UTF16 NCHAR character set have been imported.
. Importing the TESTSHOW object to TESTSHOW.

The code is as follows:
"BEGIN"
"Sys. dbms_logrep_imp.instantiate_schema (schema_name => SYS_CONTEXT ('userenv ','"
"CURRENT_SCHEMA"), export_db_name => 'orcl. REGRESS. RDBMS. DEV. US. ORACLE. com', I"
"Nst_scn => '123 ');"
"COMMIT; END ;"
"Alter session set CURRENT_SCHEMA =" TESTSHOW ""
"Create table" TEST "(" ID "NUMBER," NAME "VARCHAR2 (20) PCTFREE 10 PCTUSED"
"40 INITRANS 1 MAXTRANS 255 STORAGE (INITIAL 65536 FREELISTS 1 freelist group"
"S 1 BUFFER_POOL DEFAULT) TABLESPACE" USERS "logging nocompress"
... Skipping table "TEST"
"Alter session set CURRENT_SCHEMA =" TESTSHOW ""
"Create synonym" EMP "FOR" SCOTT "." EMP ""

Import terminated successfully. no warning is displayed.


The log shows the statement used to create an object, proving the first point.

Check whether objects in the database are imported:

The code is as follows:

SQL> select * from test;

Select * from test

ORA-00942: table or view does not exist

The code is as follows:

SQL> select count (*) from emp;

Select count (*) from emp

ORA-00942: table or view does not exist

The object is not imported, which proves the second point.

4. show = n import

The code is as follows:
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 27 13:21:35 2012
Copyright (c) 1982,200 5, 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

EXPORT file created by EXPORT: V10.02.01 in the normal path
The ZHS16GBK character set and AL16UTF16 NCHAR character set have been imported.
. Importing the TESTSHOW object to TESTSHOW.
.. Importing the table "TEST" into 0 rows...
Import terminated successfully. no warning is displayed.

The code is as follows:

SQL> select * from test;

ID NAME

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

SQL> select count (*) from emp;

COUNT (*)

----------

16

The object is also imported.

--- EOF

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.