- sysdba登录系统
sqlplus "/ as sysdba"
- 执行sql
sys@DEMO> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/utlxplan.sql
Table created.
- 创建同位语 --- 若存在则报错误信息
sys@DEMO> create public synonym plan_table for plan_table;
create public synonym plan_table for plan_table
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
- 赋予public权限
sys@DEMO> grant all on plan_table to public;
- 控制trace产生
-- set autotrace off; --- 不显示,默认设置
-- set autotrace on; --- 显示
-- set autotrace on explain; --- 只显示优化器执行计划
-- set autotrace statistics; --- 只显示统sql计信息
-- set autotrace traceonly; --- 于on相似,但不显示查询结果
-- set autotrace traceonly explain; --- 只显示优化器执行计划(不执行真正查询,所以快)
sqlplus "/ as sysdba"
- 执行sql
sys@DEMO> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/utlxplan.sql
Table created.
- 创建同位语 --- 若存在则报错误信息
sys@DEMO> create public synonym plan_table for plan_table;
create public synonym plan_table for plan_table
*
ERROR at line 1:
ORA-00955: name is already used by an existing object
- 赋予public权限
sys@DEMO> grant all on plan_table to public;
- 控制trace产生
-- set autotrace off; --- 不显示,默认设置
-- set autotrace on; --- 显示
-- set autotrace on explain; --- 只显示优化器执行计划
-- set autotrace statistics; --- 只显示统sql计信息
-- set autotrace traceonly; --- 于on相似,但不显示查询结果
-- set autotrace traceonly explain; --- 只显示优化器执行计划(不执行真正查询,所以快)
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22558114/viewspace-1097818/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/22558114/viewspace-1097818/