BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
PL/SQL Release 10.2.0.1.0 - Production
CORE 10.2.0.1.0 Production
TNS for 32-bit Windows: Version 10.2.0.1.0 - Production
NLSRTL Version 10.2.0.1.0 - Production
create user mouse identified by oracle;
grant create session,resource to mouse;
grant dba to mouse;
conn mouse/oracle
SQL> create table test_raugher as select * from dba_objects;
表已创建。
SQL> create index ind_objectid on test_raugher(object_id);
索引已创建。
SQL> select object_id from test_raugher where rownum<2;
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID"=20)
--2.获取新sql的sql_id
SQL> col sql_id for a20
SQL> col sql_text for a100
SQL> select sql_id,sql_text from v$sql where sql_text like '%full(test_raugher)%';
SQL_ID SQL_TEXT
-------------------- ----------------------------------------------------------------------------------------------------
5nkhk378705z3 select sql_id,sql_text from v$sql where sql_text like '%full(test_raugher)%'
g23hbdmcsdahc select /*+ full(test_raugher) */ * from test_raugher where object_id=20
dqp79vx5pmw0k EXPLAIN PLAN SET STATEMENT_ID='PLUS4294967295' FOR select /*+ full(test_raugher) */ * from test_raug
her where object_id=20
--3.获取新sql的outline
SQL> set pagesize 1000
SQL> select * from table(dbms_xplan.display_cursor('g23hbdmcsdahc',null,'outline'));
PLAN_TABLE_OUTPUT
-----------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------
SQL_ID g23hbdmcsdahc, child number 0
-------------------------------------
select /*+ full(test_raugher) */ * from test_raugher where object_id=20
Export: Release 10.2.0.1.0 - 64bit Production on Saturday, 17 June, 2017 23:58:38
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
Starting "SYSTEM"."SYS_EXPORT_TABLE_01": system/******** dumpfile=mouse.dmp directory=expdp tables=mouse.TEST_SQLPRO1,mouse.TEST_RAUGHER
Estimate in progress using BLOCKS method...
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 320 KB
Processing object type TABLE_EXPORT/TABLE/TABLE
. . exported "MOUSE"."TEST_SQLPRO1" 8.937 KB 1 rows
exported mouse.TEST_RAUGHER 2.2MB 4000rows
Master table "SYSTEM"."SYS_EXPORT_TABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TABLE_01 is:
/home/oracle/expdp/mouse.dmp
Job "SYSTEM"."SYS_EXPORT_TABLE_01" successfully completed at 23:58:45
scp mouse.dmp 192.168.0.13:/home/oracle/expdp/
11g 数据库
[oracle@oracle expdp]$ sqlplus -v
SQL*Plus: Release 11.2.0.4.0 Production
sqlplus / as sysdba
create user mouse identified by oracle;
grant create session,resource to mouse;
grant dba to mouse;
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("OBJECT_ID"=20)
Note
-----
- SQL profile "SQLPROFILE_001" used for this statement
col CREATED for a10
col SQL_TEXT for a30
SELECT name, created,category,sql_Text from dba_sql_profiles ORDER BY created DESC;
NAME CREATED CATEGORY SQL_TEXT
------------------------------ ---------- ------------------------------ ------------------------------
SQLPROFILE_00105-MAY-17 DEFAULT select * from test_raugher where object_id=20