RollingPig
ҽ
л
ҵBlog
¹鵵...
·...
ͳ...
վ...
Դ
===========================================================
sqlplus show parameter ֱʾoracle
===========================================================

Oracle õ˳ʼͨǶsqlplusshow parameter áOracleΪdebug ߽һЩ⣬ṩһЩԡ_ͷ һЩscriptɼЩ. ǣû,ǿֱsqlplus show parameter ȡЩأ

ġ

棬ҽʾһsqlplus show parameterֱӲ鿴Oracle.

 鿴ȫ
rollingpig :2007.07.25 14:52 ::: ( My Oracle Article ) ::Ķ:(4171) :: (18) :: (0)
===========================================================
Ϊʲô statspack report Parse CPU to Parse Elapsd% ʱ >100%
===========================================================

ֻǼѣ룿

 鿴ȫ
rollingpig :2006.12.04 16:36 ::: ( My Oracle Article ) ::Ķ:(1557) :: (0) :: (0)
===========================================================
˵ Like Ż
===========================================================
˵䣬忴 鿴ȫ
rollingpig :2006.11.17 10:48 ::: ( My Oracle Article ) ::Ķ:(10700) :: (252) :: (0)
===========================================================
SHELL Script Զstatspack report
===========================================================

̳ѯڴstatspack data£Զ N report

20 һԺ󣬱ȷ˵µĿգ
1,2,3,4,5,6,......
ԶɻʹshellڼĿյı棬ûз

˳дһScript, ԶN report

ȫΪ Script

 鿴ȫ
rollingpig :2006.10.18 14:08 ::: ( My Oracle Article , Shell & Unix ) ::Ķ:(4617) :: (134) :: (0)
===========================================================
limit Bulk Collect һ
===========================================================

limit Bulk Collect , ˵Forall һ

ͬʱõ dbms_sql Ԥȶõrowid table

¼һ¡

 鿴ȫ
rollingpig :2006.10.17 16:50 ::: ( My Oracle Article ) ::Ķ:(317) :: (0) :: (0)
===========================================================
һԶ¼½ServerIJscripts, DBA/SA Ӧн֮
===========================================================

ʵʵķ/ݿУǶҪԱҪСģںܶҪ淶жҪ

¼

ڶ ¼ Ҫдһscript, Զ¼ÿlogin session Ķ

 鿴ȫ
rollingpig :2006.09.19 14:03 ::: ( My Oracle Article , Shell & Unix ) ::Ķ:(438) :: (2) :: (0)
===========================================================
Oracle 9i У(resize/reduce) shared_pool_size ֵ
===========================================================

Oracle 9i ̬޸SGAĴСǣʵУм(resize/reduce) shared_pool_sizeɹcheckpoint(CKPT) ̺ôCPUļ򵥵Ľһṩʱ

 鿴ȫ
rollingpig :2006.09.08 08:56 ::: ( My Oracle Article ) ::Ķ:(392) :: (1) :: (0)
===========================================================
DBij﷢SQL Ĵ̣
===========================================================

Oracle 9iR2SQL ȡ汾

select text from dba_source
where OWNER ='SYS'
and name = 'DBMS_SQL'
and TYPE = 'PACKAGE'
and line between 37 and 94
order by line
/

 鿴ȫ
rollingpig :2006.07.26 15:01 ::: ( My Oracle Article ) ::Ķ:(360) :: (2) :: (0)
===========================================================
һ򵥵İ SQLмеֵĺsum_string
===========================================================

 鿴ȫ

rollingpig :2006.07.26 14:57 ::: ( My Oracle Article ) ::Ķ:(522) :: (1) :: (0)
===========================================================
[Tips] RMAN can not open in Linux
===========================================================

LinuxϵͳУʱᷢ޷rman

rman target / nocatalog

rman: can't open target

ⴿһ : )

ԭΪ linuxУһҲ rman .

 鿴ȫ
rollingpig :2006.07.21 09:06 ::: ( My Oracle Article ) ::Ķ:(981) :: (5) :: (0)
===========================================================
PL/SQL ȷѡα
===========================================================


PL/SQLαԷΪʽʽ֣ʽзΪselect intoʽαfor .. in ʽα֡ԣǿΪ3α÷
A. ʽα
B. select intoʽα
C. for .. in ʽα

ȷѡʹα꣬ijܣɶԣȲشӰ졭

--By RollingPig, http://rollingpig.itpub.net

ļ򵥵оPL/SQLõļֲͬ͵αд򵥶Ա˲ͬαдȱ㣬ͬʱһѡĻԭ

IJ̫ʵ/ܲԣȤĻҿԸʾԼԡ

 鿴ȫ
rollingpig :2006.07.19 10:26 ::: ( My Oracle Article ) ::Ķ:(436) :: (0) :: (0)
===========================================================
ʹsqlplus copy ݿת
===========================================================

Ľsqlplus copy ݿת

õdblink, ݿ䲻ֱͨѶȻҪһclientͬʱsqlplusӵݿ

 鿴ȫ
rollingpig :2006.07.06 16:26 ::: ( My Oracle Article ) ::Ķ:(738) :: (0) :: (0)
===========================================================
Oracleƣlimit) ϵ2--controlfilelimitaion (part 1)
===========================================================

Oraclecontrolfile DBɵһļ¼˰datafile/logfile/archived_log/rman_backupϢͬҲơ

ὲcontrol file һЩ(limitation)
ϵ֮һOracleƣlimit) ϵ1--sessions & processes

Уδͬ⣬תأлл

http://rollingpig.itpub.net

rollingpig@163.com

 鿴ȫ
rollingpig :2006.06.28 11:26 ::: ( My Oracle Article ) ::Ķ:(777) :: (2) :: (0)
===========================================================
ηԶ̷ij˿ڼORACLEʵ/
===========================================================

ĽηԶ̷ij˿ڼORACLEʵ/

 鿴ȫ

rollingpig :2006.06.22 16:49 ::: ( My Oracle Article ) ::Ķ:(804) :: (3) :: (0)
===========================================================
Oracleƣlimit) ϵ1--sessions & processes
===========================================================

Oracleɫɫƣlimit)˽Щƿ԰ǸõʹOracleOracle.

Oracleϵеĵһƪ£ҪһЩOracleʼ趨һЩƣsessions , processes

Key Word: ORA-00018 , ORA-00020

 鿴ȫ
rollingpig :2006.06.09 13:50 ::: ( My Oracle Article ) ::Ķ:(536) :: (2) :: (0)
===========================================================
δһͬȨ޵û
===========================================================
δһͬȨ޵û 鿴ȫ
rollingpig :2006.06.08 15:37 ::: ( My Oracle Article ) ::Ķ:(376) :: (0) :: (0)
===========================================================
׼һƬOracleڸ(limit)ܽᣬԤһ¡
===========================================================

1Init parameter趨

2OS趨

3OS

4Resource Control


rollingpig :2006.06.08 09:59 ::: ( My Oracle Article ) ::Ķ:(323) :: (1) :: (0)
===========================================================
9iR2dataguard BUG
===========================================================

backup database on standby instead of backup on primary,BUG

BUG:3612680

rman backupquery v$archived_logʱ

ORA-01861: literal does not match format string

Bug: 2749174

rman backupʱ

ORA-19573: cannot obtain sub-shared enqueue for datafile

 鿴ȫ
rollingpig :2006.06.01 15:00 ::: ( My Oracle Article ) ::Ķ:(319) :: (3) :: (0)
===========================================================
Message ... not found; No message file for product=..., facility=..
===========================================================

ʱOracleлᷢϢֵܹ

Message ... not found; No message file for product=network, facility=NL

Ҳ

Error 6 initializing SQL*Plus
Message file sp1.msb not found
SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

һν

 鿴ȫ
rollingpig :2006.06.01 09:10 ::: ( My Oracle Article ) ::Ķ:(512) :: (0) :: (0)
===========================================================
ORA-04030 ԭ
===========================================================

ORA-04030: ڳԷ ֽ (hash-join subh,kllcqas:kllsltba) ʱڴ治

ORA-04030:out of process memory when trying to allocate string bytes

ORA-04030ijԭ򼰼򵥽

 鿴ȫ
rollingpig :2006.05.25 09:39 ::: ( My Oracle Article ) ::Ķ:(4402) :: (2) :: (0)
===========================================================
ORA-04031 ԭ
===========================================================

ORA-04031: unable to allocate 4096 bytes of shared memory

˼ܼ

 鿴ȫ
rollingpig :2006.05.25 09:36 ::: ( My Oracle Article ) ::Ķ:(563) :: (2) :: (0)
===========================================================
select * ֲʾУ
===========================================================

select * ֲʾУ

col COLNAME noprint

 鿴ȫ
rollingpig :2006.05.23 15:04 ::: ( My Oracle Article ) ::Ķ:(332) :: (0) :: (0)
===========================================================
select * from table order by COL ǷʹCOLϵindex?
===========================================================

ͨϸIJԣ

select * from table order by COLʹindexԼʹ÷Χ

 鿴ȫ
rollingpig :2006.05.15 13:46 ::: ( My Oracle Article ) ::Ķ:(556) :: (5) :: (0)
===========================================================
Mantainence listener.log in Unix
===========================================================

Unix Backup listener.log .ܼ򵥵һscript

cd $ORACLE_HOME/network/log

LG=listener.log

cat $LG | gzip -9c > $LG.bak.`date +%Y%m%d`.gz && cat /dev/null > $LG

ܹbackup

listener.log.bak.20060510.gz

ѹԭ 5%


rollingpig :2006.05.10 11:08 ::: ( My Oracle Article ) ::Ķ:(222) :: (0) :: (0)
===========================================================
temp tablespaceʹÿռij򵥷(ʱռ)
===========================================================

ijЩʹtemporay tablespaceռ˺ܴıռ䣬ͷŴ̿ռ䣿

Ľһ򵥵ķʽ

 鿴ȫ
rollingpig :2006.05.10 09:36 ::: ( My Oracle Article ) ::Ķ:(434) :: (1) :: (0)
===========================================================
oracle datafileļRename none system / undo datafile
===========================================================

Rename none system / undo datafile

datafileļ

 鿴ȫ
rollingpig :2006.05.10 09:15 ::: ( My Oracle Article ) ::Ķ:(312) :: (0) :: (0)
===========================================================
Script to found out resource comsuming of Import
===========================================================

ʱimpһdmp file , ĺݣССĽһô򵥵ķƿ

 鿴ȫ

rollingpig :2006.05.08 15:09 ::: ( My Oracle Article ) ::Ķ:(493) :: (2) :: (0)
===========================================================
VPDָRACϵstatspack
===========================================================

RACIJͬinstanceʹͬһperfstatû洢ݡ

ҵǣҵijstatspack沢ûȥжinstance_number/instance_id,ĬϵһΨһstatspack,ԣ޷ʹá

׼VPD

 鿴ȫ
rollingpig :2006.04.27 15:26 ::: ( My Oracle Article ) ::Ķ:(251) :: (0) :: (0)
===========================================================
εõStatspacksnap_id һlist
===========================================================
εõStatspacksnap_id һlist  鿴ȫ
rollingpig :2006.04.04 17:47 ::: ( My Oracle Article ) ::Ķ:(292) :: (0) :: (0)
===========================================================
How to release space from database( in other words: resize datafile )
===========================================================

How to release space from database

(Step 3-5 only applies to development/testing DB or in an offline production DB, because move table would destroy index.)

Ȼresize datafile ˣ΢дһ²

 鿴ȫ
rollingpig :2005.12.01 13:24 ::: ( My Oracle Article ) ::Ķ:(844) :: (1) :: (0)
===========================================================
SQL*Loader洦кϳһ¼
===========================================================

Keyword:

sqlldr , , multiple line , newline, str.

 鿴ȫ

rollingpig :2005.11.08 10:06 ::: ( My Oracle Article ) ::Ķ:(411) :: (0) :: (0)
===========================================================
Linux RedHat 9ϰװ Oracle 9201 update 9206
===========================================================

Linux RedHat 9ϰװ Oracle 9201 update 9206 ļҪ

 鿴ȫ

rollingpig :2005.11.04 10:11 ::: ( My Oracle Article ) ::Ķ:(1215) :: (4) :: (0)
===========================================================
file_num db_files
===========================================================

ijЩطOracle fileıv$session_wait p2ʱָᷢfile# ܴ󣬶v$datafileûиfile#

ʵtempfilefile#+parameter db_filesֵ

ǿ԰ȥparameter db_filesMAPv$tempfiledba_temp_fileͿ.

һSQLܻѰҹ̡

SELECT * FROM (
SELECT file_name , tablespace_name ,file_id,'datafile' AS TYPE
FROM DBA_DATA_FILES
UNION ALL
SELECT file_name , tablespace_name ,file_id + value ,'tempfile '
FROM DBA_TEMP_FILES , v$parameter p
WHERE p.name = 'db_files'
)
WHERE file_id = &FILE#


rollingpig :2005.10.14 09:22 ::: ( My Oracle Article ) ::Ķ:(811) :: Permanent link :: (0)
===========================================================
ɽ ѰIJֵϺţ
===========================================================

Question:

table TУserial_no
ܹѯһserial_noֶεIJֵ

serial_no
1
2
3
4
6
8
9
10
һsqlȱʧĺ룬
ʾΪ
5
7

:




SELECT
/*+ordered */T2.serial_no + 1, MIN (t3.serial_no) - 1

FROM T T1
, T T2,
T t3

WHERE T1
.serial_no(+) = (T2.serial_no + 1) AND T1.
serial_no IS NULLAND t3.serial_no > T2.serial_no

GROUP BY T2
.
serial_no






˼·

1not exists /not in , : t1.serial_no = t2.serial_no + 1

2οhttp://www.itpub.net/406784.html not exists /not in Ϊouter join + is null ʽ

3 min ȷ

пгϸ


rollingpig :2005.10.13 00:00 ::: ( My Oracle Article ) ::Ķ:(698) :: Permanent link :: (0)
===========================================================
Wait event enqueue parameter P1
===========================================================

v$session_wait enqueue P1Īʲô

 鿴ȫ
rollingpig :2005.07.05 09:42 ::: ( My Oracle Article ) ::Ķ:(605) :: (1) :: (0)
===========================================================
ASP VB ʹð󶨱 ( Bind Variable )
===========================================================

һ ASP VB ʹð󶨱 ( Bind Variable ) ļʾӴ˲õĿԱԹ˵ ASP / VB޷ʹð󶨱ˡ


'Constant for parsing'

const adParamInput = 1

const adOutput = 2

const adVarChar = 200

const adInteger = 3

const adStateOpen = 1

const adUseClient = 3

const adOpenStatic = 3

const adCmdStoredProc = 4

const adCmdText = 1

Dim oConn

Dim oComm      
'ADO command objects'

dim oRs

Set oConn
= Server.CreateObject("ADODB.Connection")

oConn.Open "Provider=MSDAORA;Password=luo;Persist Security Info=True;

User ID=serol;Data Source=mescp"

Set oComm = CreateObject("ADODB.Command") oComm.ActiveConnection = oConnoComm.CommandType = adCmdText   'Command type'

oComm.CommandText = "select * from all_objects where rownum < ? and owner = ?" 'SQL,? stand for variable '

oComm.Parameters.Append oComm.CreateParameter("v1",adInteger,adParamInput,4,100)

oComm.Parameters.Append oComm.CreateParameter("v2",adVarChar,adParamInput,255,"SYS")

Set oRs = oComm.Execute  'Execute  '





rollingpig :2005.05.11 08:43 ::: ( My Oracle Article ) ::Ķ:(581) :: (0) :: (0)
===========================================================
ӿcreate / rebuild index3(speed up create or rebuild index)
===========================================================

ӿcreate / rebuild index3
1sort_area_size
sort_area_size,
auto pgaģӦworkarea_size_policy=manualsort_area_size
alter session set workarea_size_policy=manual
alter session set sort_area_size=512000000

2.nologging
create index t on t(a) nologging

3.ڶCPUϵͳ,Լparallel ͨΪCPU or CPU-1
create index t on t(a) nologging parallel 7

 鿴ȫ
rollingpig :2005.05.06 08:53 ::: ( My Oracle Article ) ::Ķ:(603) :: (4) :: (0)
===========================================================
SQL
===========================================================

һЩSQLдʵѾ۹һ

1ɾظ¼

2ͨunix PID Ѱ ִеSQLԼwaitϢ

3кϲΪ

Ժ½¡

 鿴ȫ
rollingpig :2005.04.14 13:31 ::: ( My Oracle Article ) ::Ķ:(704) :: (4) :: (0)
===========================================================
How to query all tables' record_count using primary key
===========================================================

дһscript,primary key fast full scan query table record_count

 

DECLARE
record_count NUMBER;
BEGIN
FOR rec IN
(SELECT a.table_name,b.index_name FROM USER_TABLES a,USER_CONSTRAINTS b
WHERE a.table_name = b.table_name(+) AND b.constraint_type(+) = 'P' ) LOOP
EXECUTE IMMEDIATE 'select /*+index_ffs( a '||rec.index_name||') */ count(*) from ' ||rec.table_name||' a '  INTO record_count;
dbms_output.put_line(rec.table_name||' '||record_count);
END LOOP;
END;

 鿴ȫ
rollingpig :2005.04.12 08:58 ::: ( My Oracle Article ) ::Ķ:(432) :: (0) :: (0)
===========================================================
Monitor Import Speed (importٶ)
===========================================================

 ԭijԣ

http://www.idevelopment.info/data/Oracle/DBA_tips/Export_Import/EXP_3.shtml

 SELECT
        SUBSTR(sql_text, INSTR(sql_text,'INTO "'),30) table_name
      , rows_processed
      , ROUND( (sysdate-TO_DATE(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60,1) minutes
      , TRUNC(rows_processed/((sysdate-to_date(first_load_time,'yyyy-mm-dd hh24:mi:ss'))*24*60)) rows_per_minute
    FROM
        sys.v_$sqlarea
    WHERE
          sql_text like 'INSERT %INTO "%'
      AND command_type = 2
      AND open_versions > 0;


rollingpig :2004.10.18 12:41 ::: ( My Oracle Article ) ::Ķ:(538) :: (0) :: (0)
===========================================================
rman汾ԣת֮metalink
===========================================================

rman ֮İ汾

The RMAN environment can contain the following components:

  • RMAN executable
  • Recovery catalog database
  • Recovery catalog schema in the recovery catalog database
  • Target database
  • Auxiliary database (that is, a duplicate or standby database)

RMAN Compatibility Matrix

In general, the rules of RMAN compatibility are as follows:

 鿴ȫ
rollingpig :2004.10.14 13:09 ::: ( My Oracle Article ) ::Ķ:(1122) :: (0) :: (0)
===========================================================
õsql script
===========================================================

ҵOracleϵͳSQLPATH

Ȼͷӵ㾭õ sql script,óһ¡

1login.sql

2.  conn.sql / connect.sql

3.  su.sql / su1.sql

4.  fo.sql / findObject.sql

5.  fl.sql / flush.sql

6.  ci.sql / compileInvalid.sql

7. fv.sql / fixView.sql

 鿴ȫ

rollingpig :2004.09.21 11:50 ::: ( My Oracle Article ) ::Ķ:(1280) :: (1) :: (0)
===========================================================
oracle_home/rdbms/adminЩʲôscript
===========================================================

дƪµԭǸϰһ¼uniq磺

ls,sort,cut,awk,sort,uniqgrep

ֵбҪúоһoracleĻscript.....

cd $ORACLE_HOME/rdbms/admin

ls -1 | cut -f2 -d"." | sort | uniq -c

    444 sql
    303 plb

ls -1 *.plb | cut -b 0-3|sort |uniq -c|sort -nr|head
    234 prv
     57 owm
      9 dbm
      2 utl
      1 xum

ls -1 *.sql | cut -b 0-3|sort |uniq -c|sort -nr
   100 dbm
     95 cat
     43 utl
     28 xml
     28 jvm
     16 ini
     12 pub
     12 pri
     10 owa
      6 wpg
      6 c08
      6 a08
      4 xsl
      4 spc
      3 spu
      3 spr
      3 spd
      3 ols
      3 i08
      2 wwv
      2 u08
      2 std
      2 rma
      2 pro
      2 owm
      2 mgw
      2 dro
      1 xav
      1 wpi
      1 use
      1 udj
      1 u09
      1 u07
      1 tra
      1 sta
      1 spt
      1 spp
      1 spa
      1 rmx
      1 rmj
      1 rmc
      1 rdb
      1 prg
      1 pls
      1 pli
      1 pis
      1 pip
      1 pid
      1 pbu
      1 pbl
      1 odm
      1 n_s
      1 not
      1 jis
      1 i09
      1 f09
      1 f08
      1 e09
      1 e08
      1 dum
      1 diu
      1 d09
      1 d08
      1 csm
      1 cmp
      1 c09
      1 c07
      1 amd
      1 a09
      1 a07

1.prv*.plb -- ܺcode,Ҫdbms_* packagecode,һЩصtype,libraryviewȡ

grep "CREATE OR REPLACE" prv* |tee /tmp/all.log awk '{print $4}' | sort |uniq -c|sort -nr 
     354 PACKAGE
     53 PUBLIC
     35 LIBRARY
     12 TYPE
     10 VIEW
      8
      6 PROCEDURE
      6 package
      2 FORCE
      1 TRIGGER
      1 REPLACE
      1 PRIVATE
      1 FUNCTION:
      1 DIRECTORY

grep "CREATE OR REPLACE PUBLIC" prv* | awk '{print $4,$5}' | sort |uniq -c|sort -nr
     53 PUBLIC SYNONYM

2.dbm* (dbms*) --  ϶dbms* packagedeclare

echo dbms* | wc -w

109

3.cat*.sql catalog,catproc,catexp壬

catalog.sql : Creates data dictionary views.dba_ user_ all_  v_$ gv_$view, ԼӦsynonymcatsql.

grep "create or replace" catalog.sql | awk '{print $4}' | sort | uniq -c | sort -nr

717 public
 712 view
   7 synonym
   6 replace
   2 -

grep "create or replace public " catalog.sql | awk '{print $4}' | sort | uniq -c | sort -nr

717 synonym

grep @ catalog.sql
Rem     rkooi      01/23/92 -  use @@ command for subscripts
@@standard
@@dbmsstdx
@@catcr
@@catcdc
@@cataudit
Rem This statement must happen before @catexp.
@@utlraw
@@catexp
@@catldr
@@catpart
@@catadt
@@catsum
@@catlsby
@@catxtb

catproc.sql -- prv*.plb,dbms*.sql ,cat*.sql utl*sqlɻprocedural ֧֣

grep @ catproc.sql | wc -l

     84 prv
     54 dbm
     28 cat
     12 utl
      1 wpi
      1 pls
      1 pli
      1 pis
      1 pip
      1 pid
      1 owa
      1 m @
      1 m
      1 diu

catexp.sql -- internal views for Export/Import utility

Ķͨۿע֪;..

4.owm* oracle workspace managerĶ,ɺ޵,scriptoracleϺע͡

5.utl*, utlԼscript,utlxplan,utlfile

utlxplan,utlxplp,utlxpls: execute plan صtableԼview

utl_http,utl_smtp,utl_tcp,utl_tcp,utl_url صһЩpackage

utlexcpt.sql,utlexpt1.sql : excetion table

utlrcmp.sql : compile invalid package

utlraw.sql : raw charת

...

6.xml*,xsl* ֧xmlpackage

7 init* , jre*jserverһЩpackage

8.u0*,d0*,e0*,f0*,,i0*,a0*  ݿscript

u0* upgrade main scripts

d0* downgrade main scripts


rollingpig :2004.08.30 12:11 ::: ( My Oracle Article ) ::Ķ:(752) :: (0) :: (0)
===========================================================
ԼȻûһ⶯ testDB
===========================================================
ֻPCװlinux,Ū9i,Ȩԡ
rollingpig :2004.08.27 18:09 ::: ( My Oracle Article ) ::Ķ:(534) :: (0) :: (0)
===========================================================
оһ rman catalog db ļ VIEW
===========================================================
ôһֱ۵backup
rollingpig :2004.08.26 18:21 ::: ( My Oracle Article ) ::Ķ:(541) :: (0) :: (0)
===========================================================
벻NLS_DATE_FORMAT
===========================================================

ոϣsqlplusʾʱʱʾ

Ǹ߸˵ SHELL

export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'

 鿴ȫ
rollingpig :2004.08.26 18:11 ::: ( My Oracle Article ) ::Ķ:(948) :: (3) :: (0)
===========================================================
Чresize/reduce datafile ?
===========================================================

DBAУʱҪһѾObjecttablespace resizeСһ㡣ɲŶ

˵

"ҵtablespace100MΪʲôû취resize/reduce 200M?"

ӶƵĿʼԹOracleơ

棬ҽʾһЧresize/reduce datafile size.

 鿴ȫ
rollingpig :2004.08.26 17:20 ::: ( My Oracle Article ) ::Ķ:(776) :: (4) :: (0)
===========================================================
How to change Oracle SID without recreating database ?
===========================================================

ոմ asktom.oracle.com һƪ£Ҫ´ǡ

1.  Shutdown the instance 
 
2.  Backup all control, redo, and data files. 
 
3.  Go through the .profile, .cshrc, .login, oratab,
tnsnames.ora,  (for SQL*Net version 2), and redefine the
ORACLE_SID environment  variable to a new value. 
 
    For example, search through disks and do a grep ORACLE_SID *
 
4.  Change locations to the "dbs" directory
 
       % cd $ORACLE_HOME/dbs  
 
    and rename the following files: 
 
    o   init<sid>.ora  (or use pfile to point to the init
        file.) 
    o   control file(s). This is optional if you do not rename
        any of the controlfiles, and the control_files parameter

        is used. 

        The "control_files" parameter is set in the
        "init<SID>.ora" file or in a file it references with the

        ifile parameter.  Make sure that the control_files
        parameter does not point to old 
        file names, if you have renamed them. 
    o   "crdb<sid>.sql" & "crdb2<sid>.sql",  This is optional. 
        These are only used at database creation. 
 
5.  Change locations to the "rdbms/admin" directory
 
       % cd $ORACLE_HOME/rdbms/admin   
   
    and rename the file: 
 
    o   startup<sid>.sql.  This is optional.  On some platforms,
 this file may be in the "$ORACLE_HOME/rdbms/install" directory.
Make sure that the contents of this file do not reference old 
init<SID>.ora files that have been renamed.  This file
simplifies the "startup exclusive" process to start your
database. 
 
6.  To rename the database files and redo log files if need be.
 
7.  Change the ORACLE_SID environment variable to the new value.

 
8.  Check in the "$ORACLE_HOME/dbs" directory to see if the
password      file has been enabled.  If enabled, the file
"orapw<OLD_SID>" will  exist and a new password file for the new
SID must be created (renaming the old file will not work).  If
"orapw<OLD_SID>" does not     exist, skip to step 9.  To create
a new password file, issue  the following command as oracle
owner:
 
       orapwd file=orapw<NEWSID> password=?? entries=<number of
users to be granted permission to start the database instance>
 
9.  Start up the database and verify that it works.  Once you
have done  this, shutdown the database and take a final backup
of all control,  redo, and data files. 
 
10. When the instance is started, the control file is updated
with the  current ORACLE_SID. 


rollingpig :2004.08.25 17:38 ::: ( My Oracle Article ) ::Ķ:(641) :: (1) :: (0)