Skip to Main Content
  • Questions
  • Pinning Scripts on NT Automatically ...

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question.

Asked: June 01, 2000 - 4:45 pm UTC

Last updated: July 12, 2001 - 5:59 pm UTC

Version: version 8.1.5

Viewed 1000+ times

You Asked


I would like to know how to pin the objects automatically when the Instance is up automatically on WINDOWS NT.

Also need to know few tips regarding improving performance on NT.

and Tom said...

We would use a STARTUP database trigger to accomplish this. Here is a small example showing the pinning of a sequence in the shared pool upon startup:

SQL> drop sequence scott.my_seq;
Sequence dropped.

SQL> create sequence scott.my_seq;
Sequence created.

SQL> create or replace trigger PIN_STUFF
2 after startup on database
3 begin
4 sys.dbms_shared_pool.keep( 'SCOTT.MY_SEQ', 'Q' );
5 end;
6 /
Trigger created.

SQL> shutdown
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 43775244 bytes
Fixed Size 70924 bytes
Variable Size 38825984 bytes
Database Buffers 4800512 bytes
Redo Buffers 77824 bytes
Database mounted.
Database opened.
SQL>
SQL> select owner, name, kept
2 from v$db_object_cache
3 where owner = 'SCOTT'
4 /

OWNER NAME KEPT
---------- ---------- -----
SCOTT MY_SEQ YES


As for improving performance on NT, it really won't be significantly different then on Unix or MVS. 90% of the tuning is done at the application level (tuning queries and such) and is fairly easily accomplished with SQL_TRACE, TIMED_STATISTICS and TKPROF.

The guide:

</code> http://docs.oracle.com/cd/F49540_01/DOC/server.815/a67775/toc.htm <code>

is the server tuning guide which covers all of these topics in great detail.


followup to comment

It must be installed as SYS (or internal or "/ as sysdba")

A public synonym is NOT created for it, no grants are made on it. So, after you install it as SYS, you must grant yourself DIRECT (not via a role) access to it to create the above trigger.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

DBMS_SHARED_POOL

Gururaj Kulkarni, July 12, 2001 - 5:59 pm UTC

Hi Tom,
could you tell me how do I create package
dbms_shared_pool ? I tried running dbmspool.sql, but
it created with compilation errors.


Thanks in advance
-Gururaj

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library