Documente Academic
Documente Profesional
Documente Cultură
Rate This
BONUS TABLE
SALGRADE TABLE
SQL> drop table salgrade;
Table dropped.
SQL> drop table bonus;
Table dropped.
SQL> drop table emp;
Table dropped.
SQL> drop table dept;
Table dropped.
SQL> !
[oracle@ reddy ~]$ imp system/manager file=scott.dmp fromuser=scott
touser=scott
Import: Release 10.2.0.1.0 Production on Fri Nov 7 16:01:55 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
. importing SCOTTs objects into SCOTT
. . importing table BONUS 0 rows imported
. . importing table DEPT 4 rows imported
. . importing table EMP 14 rows imported
. . importing table SALGRADE 5 rows imported
About to enable constraints
Import terminated successfully without warnings.
[oracle@ reddy ~]$ sqlplus scott/tiger
SQL*Plus: Release 10.2.0.1.0 Production on Fri Nov 7 16:02:11 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
- DEPT TABLE
BONUS TABLE
EMP TABLE
SALGRADE TABLE
To import all the tables from the exported dump file to the different
schema:
[oracle@ reddy ~]$ sqlplus reddy/ reddy
SQL*Plus: Release 10.2.0.1.0 Production on Fri Nov 7 16:24:07 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from tab;
no rows selected
SQL> !
[oracle@ reddy ~]$ imp system/manager file=scott.dmp fromuser=scott touser=
reddy
Import: Release 10.2.0.1.0 Production on Fri Nov 7 16:27:11 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
. importing SCOTTs objects into reddy
. . importing table BONUS 0 rows imported
. . importing table DEPT 4 rows imported
. . importing table EMP 14 rows imported
. . importing table SALGRADE 5 rows imported
About to enable constraints
Import terminated successfully without warnings.
[oracle@ reddy ~]$ exit
exit
SQL> show user
USER is reddy
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
- DEPT TABLE
BONUS TABLE
EMP TABLE
SALGRADE TABLE
To export specific tables to disk.
Login to server which has an Oracle client:
[oracle@ reddy ~]$ exp system/manager
file=expdat.dmp tables=(scott.emp,scott.dept)
Export: Release 10.2.0.1.0 Production on Fri Nov 7 16:53:04 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
About to export specified tables via Conventional Path
Current user changed to SCOTT
. . exporting table EMP 14 rows exported
. . exporting table DEPT 4 rows exported
Export terminated successfully without warnings.
To import the dept and emp tables from the scott schema:
[oracle@ reddy ~]$ sqlplus scott/tiger
SQL*Plus: Release 10.2.0.1.0 Production on Fri Nov 7 17:00:24 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
- DEPT TABLE
BONUS TABLE
EMP TABLE
SALGRADE TABLE
SQL> drop table emp;
Table dropped.
SQL> drop table dept;
Table dropped.
SQL> !
[oracle@ reddy ~]$ imp system/manager file=expdat.dmp fromuser=scott
tables=(dept,emp)
SYSTEM
UNDOTBS1
SYSAUX
TEMP
USERS
TMP2
6 rows selected.
SQL> !
[oracle@ reddy ~]$ exp system/manager file=anil.dmp tablespaces=users;
Export: Release 10.2.0.1.0 Production on Sat Nov 8 12:09:46 2008
Table dropped.
SQL> drop table dept;
Table dropped.
SQL> conn sys as sysdba
Enter password:
Connected.
SQL> !
[oracle@ reddy ~]$ sqlplus anil/anil
SQL*Plus: Release 10.2.0.1.0 Production on Sat Nov 8 12:25:02 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 Production
With the Partitioning, OLAP and Data Mining options
SQL> select * from tab;
no rows selected
SQL> conn reddy/ reddy
Connected.
SQL> select * from tab;
no rows selected
SQL> !
[oracle@ reddy ~]$ imp system/manager file=anil.dmp tablespaces=users full=y
Import: Release 10.2.0.1.0 Production on Sat Nov 8 12:26:12 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Production
With the Partitioning, OLAP and Data Mining options
Export file created by EXPORT:V10.02.01 via conventional path
import done in US7ASCII character set and AL16UTF16 NCHAR character set
. importing SYSTEMs objects into SYSTEM
. importing ANILs objects into ANIL
. . importing table A1 14 rows imported
. . importing table A2 4 rows imported
. importing reddys objects into reddy
. . importing table DEPT 4 rows imported
. . importing table EMP 14 rows imported
Import terminated successfully without warnings.
[oracle@ reddy ~]$ sqlplus anil/anil
SQL*Plus: Release 10.2.0.1.0 Production on Wed Nov 12 12:46:01 2008
6/
PL/SQL procedure successfully completed.
SQL> select count(*) from test7;
COUNT(*)
10000
SQL> commit;
Commit complete.
SQL> execute dbms_tts.TRANSPORT_SET_CHECK(TEST,TRUE);
PL/SQL procedure successfully completed.
SQL> select * from transport_set_violations;
no rows selected, then it is self contained(not violating).
SQL> alter tablespace test read only;
Tablespace altered.
SQL> !
[oracle@ reddy ~]$ exp file=test.dmp transport_tablespace=y
tablespaces=TEST;
Export: Release 10.2.0.1.0 Production on Thu Dec 11 16:27:23 2008
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Username: sys as sysdba
Password:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0
Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace meta data.
For tablespace TEST
. exporting cluster definitions
. exporting table definitions
. . exporting table TEST7
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
[oracle@ reddy ~]$ scp test.dmp 192.168.1.9:/home/oracle/
oracle@192.168.1.9s password:
test.dmp 100% 16KB 16.0KB/s 00:00
TEST7 TABLE
SQL> select count(*) from test7;
COUNT(*)
-