This discussion is archived
1 2 Previous Next 24 Replies Latest reply: Dec 13, 2012 9:41 AM by xerosaburu Go to original post RSS
  • 15. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    xerosaburu Newbie
    Currently Being Moderated
    I'll accept that as a complete response for the windows side, however I still want to get that same level of detail on the linux side.

    I know it's not particularly useful, but I have to know.
  • 16. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    Mark Williams-Oracle Employee ACE
    Currently Being Moderated
    I'm not sure it's very exciting, but here's a synopsis of my experiences using a small sandbox (11.2.0.3) on Linux. The primary functions I think you are interested in are burned into the oracle binary itself.

    Here's the basics of what I did to capture some information:
    [oracle@oel03 ~]$ strace -f -tt -o strace.out sqlplus "/ as sysdba"
    
    SQL*Plus: Release 11.2.0.3.0 Production on Wed Dec 12 20:10:00 2012
    
    Copyright (c) 1982, 2011, Oracle.  All rights reserved.
    
    Connected to an idle instance.
    
    SQL> startup open;
    ORACLE instance started.
    
    Total System Global Area  801701888 bytes
    Fixed Size                  2232640 bytes
    Variable Size             549457600 bytes
    Database Buffers          243269632 bytes
    Redo Buffers                6742016 bytes
    Database mounted.
    Database opened.
    SQL> exit
    While that was running I used another session to monitor the strace.out file as follows:
    [oracle@oel03 oracle]# tail -f strace.out | grep "spfile"
    This captured the first event of interest:
    8989  20:10:24.041376 stat("/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileV112.ora", {st_mode=S_IFREG|0640, st_size=2560, ...}) = 0
    8989  20:10:24.041789 stat("/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileV112.ora", {st_mode=S_IFREG|0640, st_size=2560, ...}) = 0
    8989  20:10:24.041928 open("/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileV112.ora", O_RDONLY) = 7
    So now that I knew that the first accesses of the spfile file were coming from PID 8989 in this case, I did the following before that process terminated:
    [oracle@oel03 oracle]# ps -lp 8989
    F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
    0 T   501  8989  8988 11  76   0 - 256825 -     ?        00:00:03 oracle
    [oracle@oel03 oracle]# ps -fp 8989
    UID        PID  PPID  C STIME TTY          TIME CMD
    oracle    8989  8988 13 20:10 ?        00:00:04 oracleV112 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
    Here we can see that this is just the "base" oracle binary.

    A bit later in the strace output file there are more accesses of the spfile from another process.

    Here's a small snippet:
    9096  20:11:13.677379 stat("/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileV112.ora", {st_mode=S_IFREG|0640, st_size=2560, ...}) = 0
    9096  20:11:13.677649 stat("/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileV112.ora", {st_mode=S_IFREG|0640, st_size=2560, ...}) = 0
    9096  20:11:13.677775 open("/u01/app/oracle/product/11.2.0/dbhome_1/dbs/spfileV112.ora", O_RDONLY) = 21
    In this case, this is the mmon background process:
    [oracle@oel03 ~]$ ps -lp 9096
    F S   UID   PID  PPID  C PRI  NI ADDR SZ WCHAN  TTY          TIME CMD
    0 S   501  9096     1  0  75   0 - 257742 -     ?        00:00:01 oracle
    [oracle@oel03 ~]$ ps -fp 9096
    UID        PID  PPID  C STIME TTY          TIME CMD
    oracle    9096     1  0 20:10 ?        00:00:01 ora_mmon_V112
    Other than the initial startup accesses and the accesses by the mmon background process, the file does not have any other references to the spfile.

    Perhaps that is the sort of information you are looking for?
  • 17. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    Dave Rabone Journeyer
    Currently Being Moderated
    On Windows, sqlplus is not necessarily involved.

    You can start the instance with oradim, or (controlled by registry settings which vary by version I believe) just starting the Windows service will open the database.

    You can start the service either with oradim, or from services.msc
  • 18. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    Osama_Mustafa Oracle ACE
    Currently Being Moderated
    When Oracle Start the instance The First thing Happened is reading Spfile/Pfile to determine Initialization Parameter , These parameters Allocate SGA and Creating backupground process this what we called it "Startup nomount"
    # ps -ef | grep ora_
    
    ora_reco_test
    ora_mman_test
    ora_pmon_test
    ora_dbw0_test
    ora_smon_test
    ora_lgwr_test
    ora_ckpt_test
    ora_s000_test
    ora_d000_test
    ora_cjq0_test
    Whem Database is Mounted , start reading information ---> the control, data, redo, and other database related files to the running instance.if some of these files is missing you will get error , Once instance using the pfile we go to open Mode , to let table accessible .
  • 19. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    xerosaburu Newbie
    Currently Being Moderated
    Mark, that is useful and I really appreciate your taking the time to do this, but I'm still wondering and pardon me for drilling on what isn't very practical, but I suspect there are as a later poster commented w/regard to windows multiple ways of getting oracle to "exist" as it were as an inert process or program in memory, BUT before it gets in memory "something" has to say "you're up!, and send it out on stage". Then the teleprompter has to come on and then oracle has to "read" what appears.

    How many ways are there to wake up oracle and send it on stage in linux, and once there does it just automatically read the spfile (by saying "Hey! I just woke up. Where is my brain? Oh, there it is."), or does it just stand there mutely waiting for a teleprompter of sorts to tell it what to do next?
  • 20. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    xerosaburu Newbie
    Currently Being Moderated
    Thanks...I know there are a couple of ways to do this and in times past I've set up the services so that these autostart the database, but doesn't whatever process that kicks it off have to access oraspawn.dll to orchestrate the chain?
  • 21. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    John Spencer Oracle ACE
    Currently Being Moderated
    I'm not sure how it is done on windows, but on *nix install, it really is oracle that does almost everything, that is the executable that is behind most, if not all, of the background processes.  It just runs with different identities and functions.

    Doing this:
    /export/home/oracle> export ORACLE_SID=nothere
    /export/home/oracle> sqlplus /nolog
    
    SQL*Plus: Release 10.2.0.3.0 - Production on Thu Dec 13 10:49:23 2012
    
    Copyright (c) 1982, 2006, Oracle.  All Rights Reserved.
    
    SQL> connect / as sysdba
    Connected to an idle instance.
    SQL> startup nomount;
    ORA-01078: failure in processing system parameters
    LRM-00109: could not open parameter file '/u01/app/oracle/product/10.2.0/dbs/initnothere.ora'
    led me to the error message file $ORACLE_HOME/oracore/mesg/lrmus.msg which says in the header:
    "/ NAME
    / lrmus.msg - CORE error message file for the parameter manager (LRM)
    / DESCRIPTION
    / Listing of all CORE error messages for LRM"

    So, I suspect that it is part of the "bootstrap" code in the oracle executable itself that runs before spawning itself into all of the other versions of itself.

    John
  • 22. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    xerosaburu Newbie
    Currently Being Moderated
    What I'm getting then is the idea that the operating system shell loads oracle into memory, and then it automatically looks for its head (by reading the parameter file) before getting out of bed (mounting the db by accessing the rest of its body).

    I suppose then if oracle is just started, but not mounted, it's like a person who simply wakes up, but doesn't get out of bed.
  • 23. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    Mark Williams-Oracle Employee ACE
    Currently Being Moderated
    Since you've marked John's response as correct I suspect you're satisfied with the current state of explanation.

    Just as a simple illustration of what John meant by "It just runs with different identities and functions." you can see this in the strace file output.

    The new processes are generally created by calls to "clone" followed by calls to "execve" (see the Linux man page for details on these if needed).

    Using the same strace output file as earlier, you can see my initial sqlplus process was created thusly:
    8988  20:09:59.870455 execve("/u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus", ["sqlplus", "/ as sysdba"], [/* 34 vars */]) = 0
    This process has a PID of 8988 and in my earlier output I showed the first process that accesses the spfile. This process was created from my sqlplus process as follows:
    8988  20:10:00.041926 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2b85ff4d9b80) = 8989
    Here the clone call was made to create a new child process (with PID of 8989).

    This process then executes the "oracle" binary via an "execve" call:
    8989  20:10:00.051884 execve("/u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle", ["oracleV112", "(DESCRIPTION=(LOCAL=YES)(ADDRESS"], [/* 35 vars */]) = 0
    Likewise, the MMON process I referred to earlier is created in the same fashion (but from a different parent process):
    9095  20:10:47.766705 clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x2ac88fe53ec0) = 9096
    [ snip ]
    9096  20:10:47.782364 execve("/u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle", ["ora_mmon_V112"], [/* 40 vars */] <unfinished ...>
    I have a vague memory that Tom Kyte provided a nice explanation of this sort of thing in one of his books, his blog, or on AskTom but I can't quite remember where just now.

    In any case, I don't want to belabor the point (as I could end up posting many pages of text from the strace output as processes are begot and terminated), but you can see how the new processes "come into life" in the strace output.

    I also understand the "knowledge for knowledge's sake" pursuit -- I quite often have the same.
  • 24. Re: "Oracle reads the parameter file during startup...what PART of Oracle?"
    xerosaburu Newbie
    Currently Being Moderated
    Mark,

    Once again I thank you.

    I suppose that execve in *nix operates like explorer.exe in windows to load programs.

    I don't think it's belaboring the point for me because I'm trying to better understand oracle as an organism even if it isn't. Identifying the "moving" and "inert" parts of the "organism" and seeing how it feeds itself, peforms elimination in the form of alert logs, trace logs and the like, what tricks it can do if its properly cared for and what commands it responds to.

    Oracle as a seamonkey or a weasel or a little italian grinder monkey.
1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points