Oracle Scripts
Opening the database using a pfile
1 |
STARTUP PFILE=/u01/oracle/product/10.2.0/db_1/database/inittest.ora |
Recreating an emct repository
The em dbconsole stops working after changing the ip address in Listener.ora. It’s necessary to recreate the em repository to solve this:
1 |
c: emca -config dbcontrol db -repos recreate |
Show parameter sessions
1 2 3 4 5 6 7 8 9 |
alter system set sessions=555 scope=SPFILE; alternatively (if wanting to use another SID instead of the default) alter system set sessions=555 scope=both sid='*'; alter system set processes=500 scope=both sid='*'; alter system set transactions=610 scope=both sid='*'; |
Windows SID
1 |
set ORACLE_SID=SID_Name |
Session Kill
1 |
Select 'alter system kill session '||'''' ||sid||','||serial#||''''||';' from v$session where lockwait is not null order by osuser; |
1 |
Select 'alter system kill session '''||sid||','||serial#||''' immediate ;' from v$session where lockwait is not null order by osuser; |
To stop extending the iSQLPlus session (configuration where the session closes when it’s idle)
1 2 3 |
increase the number in the /u01/app/oracle/product/10.2.0/db_1/oc4j/j2ee/isqlplus/config/server.xml |
Execution Time & Plan
1 |
set timing on; |
1 |
alter system flush shared_pool; |
Spool
1 2 3 4 5 6 7 |
Spool on Spool c:spooltext.txt Query Spool off |
To drop tables from a specific tbs in a schema
1 |
select 'DROP TABLE "system"."'||table_name||'" CASCADE CONSTRAINTS ;' from user_tables |
Kategori seçin...