Solved

SPFILE  -  URGENT!!!!!  -  Big Mistake

Posted on 2004-08-31
29
729 Views
Last Modified: 2008-03-06
I opened the PFILE in wordpad to look at it.  Then being a newbie to Oracle and not following the directions I made a change to it and saved it (OOPS!!!).

Anyway, now I can't connect with SQLPlus, or even get into the Enterprise Manager in Oracle 10g.

Is there a way to replace this file with a "default" one?  I am really lost and need some help fast!  I think I will read the directions a little more carefully next time.

I am running the 10g suite of tools and made a change to the file because I was trying to install the repository.  The file still has the parameters in it.  But it looks like something was messed up since I changed it with Wordpad.

Any help or if you can point me in the right direction would be greatly appreciated
0
Comment
Question by:Intern
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 12
  • 12
  • 2
  • +2
29 Comments
 
LVL 23

Expert Comment

by:seazodiac
ID: 11944810
@intern:

can you post any error message when you try to log in with sqlplus?

Is the datasbase server machine on the Windows or UNIX?
0
 
LVL 10

Expert Comment

by:SDutta
ID: 11944848
It seems you have modified the SPFILE not the PFILE. The PFILE is a text file that can be edited and is used only on database startup, whereas the SPFILE is a binary file and should not be edited manually.

If you have a recent PFILE you can recreate the spfile from it.
SQL> create spfile from pfile='initSID.ora';

Otherwise, you can look into the alert.log file and locate the statement "System parameters with non-default values:". Copy and paste the parameters into a text file and name it like the PFILE. Then startup the database with this file and recreate the SPFILE with the "create spfile" statement as above.
0
 
LVL 1

Author Comment

by:Intern
ID: 11944930
I have all the parameters in the current SPFILE - but the formating must have gotten damagd, since I edited using Wordpad.  Anyway - how can I use this command:

SQL> create spfile from pfile='initSID.ora';

If I can't log into SQL??

The error in SQLPlus is - TNS could not resolve the service name.  The whole database does not seem to be working.  

0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 23

Expert Comment

by:seazodiac
ID: 11944954
I think  this SQLPLUS error has NOTHING to do with the fact that you modified that file.

ok, Intern, can you clarify what the file you have modified , preferrable, the filename?

and where is your database server, where do you try to connect using sqlplus , are they on the same machine?
0
 
LVL 1

Author Comment

by:Intern
ID: 11944958
This is the file

*.background_dump_dest='C:\oracle\product\10.1.0\admin\orcl\bdump'
*.compatible='10.1.0.2.0'
*.control_files='C:\oracle\product\10.1.0\oradata\orcl\control01.ctl','C:\oracle\product\10.1.0\oradata\orcl\control02.ctl','C:\oracle\product\10.1.0\oradata\orcl\control03.ctl'
*.core_dump_dest='C:\oracle\product\10.1.0\admin\orcl\cdump'
*.db_block_size=8192
*.db_cache_size=25165824
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='orcl'
*.db_recovery_file_dest='C:\oracle\product\10.1.0\flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.java_pool_size=50331648
*.job_queue_processes=10
*.large_pool_size=8388608
*.open_cursors=3000
*.pga_aggregate_target=25165824
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.shared_pool_size=83886080
*.sort_area_size=262144
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='C:\oracle\product\10.1.0\admin\orcl\udump'
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11944963
can you post up the TNSNAMES.ORA file and SQLNET.ORA file in your $ORACLE_HOME/network/admin folder?
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11944984
Ok, intern, now this file is PFILE , NOT SPFILE.

so I am quite positive that this SQLPLUS error has NOTHING to do with the fact that you modified that file.
 


Plus, if you are in 10g, most likely you DON'T use this PFILE anymore, you are using SPFILE instead....


so there are something else, please answer all my questions in my above POSTS...
0
 
LVL 1

Author Comment

by:Intern
ID: 11944986
Edited file - SPFILEORCL.ORA

Database server is sitting next to me (it is a test server), I tried to connect using SQLPLUS in both my machine and also from the box that the Database is on.  
0
 
LVL 1

Author Comment

by:Intern
ID: 11945042
I also changed the INIT.ORA file - the only thing that I changed in this file is a couple of settings that were supposed to be changed to install the Repository on this machine.

TNSNAMES.ORA -
ORCL.CORP.CSBN.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = theoracle.corp.csbn.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

SQLNET.ORA -
NAMES.DEFAULT_DOMAIN = corp.csbn.com
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, ONAMES, HOSTNAME)
DEFAULT_SDU_SIZE = 8761

Changes made to INIT.ORA
sort_area_size = 262144
shared_pool_size = 32000000
open_cursors = 3000
processes = 100
0
 
LVL 10

Expert Comment

by:SDutta
ID: 11945067
If you are sure your database is really down (check the alert.log file), you can start it up like this :

SQLPLUS /NOLOG
SQL> CONNECT SYS AS SYSDBA
-- Use the initsid.ora text file you created with the parameters from alert.log or the battered SPFILE
SQL> STARTUP RESTRICT PFILE='C:\InitSID.ora';
SQL> create spfile from pfile='C:\InitSID.ora';
You should have a new SPFILE now, dont edit this directly.
SQL> SHUTDOWN IMMEDIATE;
-- now use the SPFILE to startup the database
SQL> STARTUP;
0
 
LVL 23

Accepted Solution

by:
seazodiac earned 450 total points
ID: 11945089
sorry, then you are modifying SPFILEORCL.ORA..


ok,  try to follow this steps:

1. go to control-panels --->services ---> change the OracleServiceORCL properties to make it manually start , not automatically start.

2. shutdown the computer (the server machine).

3. Once the machine is up, open a DOS window.

4. at the command prompt:

C:\>set ORACLE_HOME=C:\oracle\product\10.1.0
C:\>set ORACLE_SID=orcl
C:\>sqlplus "sys/****** as sysdba"

you will see a message "connect to an idle instance" ,
and in this folder 'C:\oracle\product\10.1.0\admin\orcl\pfile' , there is a file called "init.ora.xxxxxxxxxxxxxxx", rename it for convenience  to just init.ora
SQL> create spfile='C:\oracle\product\10.1.0\SPFILEORCL.ORA' from pfile='C:\oracle\product\10.1.0\admin\orcl\pfile\init.ora';

SQL>startup



that should do it....
0
 
LVL 1

Author Comment

by:Intern
ID: 11945107
>>CONNECT SYS AS SYSDBA

After this command it asks me for a password, once I enter the password it will give me the following error -

TNS: protocol adapter error
0
 
LVL 1

Author Comment

by:Intern
ID: 11945155
I am trying that now - It may be a little later when I get back to you.  I have a business lunch to go to.  Thank you for all your help so far
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11945163
You have to RESTART the database since you cannot get into it with sqlplus or EM.

just follow my last post to restart the machine ....
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 11945178
Editting the pfile definitely *CAN NOT* prevent you from connecting to Oracle (unless you then shut down the database, and it fails to restart).  Similarly, editting the SPFILE will not prevent you from logging in (again, unless you then shut down the database and it fails to restart it when you try to restart it).

You should never edit your SPFILE.  You may edit you PFILE if you are careful, and if you want to do things that aren't supported in an SPFILE (like removing optional parameters) but this will have no affect on a running Oracle database, and will only affect the database after you shut it down and intentionally start it from a PFILE instead of the SPFILE.

What error do you get in SQL*Plus when you try to connect?
0
 
LVL 1

Author Comment

by:Intern
ID: 11945198
>>You should never edit your SPFILE.  You may edit you PFILE if you are careful, and if you want to do things that aren't supported in an SPFILE (like removing optional parameters) but this will have no affect on a running Oracle database, and will only affect the database after you shut it down and intentionally start it from a PFILE instead of the SPFILE.


As you can see from my initial post - I realize that I am a moron - or at least on a steep learning curve
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11945286
Just elaborate more on the STEP 4 in my post:

if this command : "SQL> create spfile='C:\oracle\product\10.1.0\SPFILEORCL.ORA' from pfile='C:\oracle\product\10.1.0\admin\orcl\pfile\init.ora';"

fails, this is because you have a file by the same name already. you need to rename that existing file or delete it before you run this command again.
0
 
LVL 1

Author Comment

by:Intern
ID: 11945482
>>sqlplus "sys/password1 as sysdba"

When I issue this command I get nothing.  It waits a little bit and then it will go back to the command prompt.  I can open sqlplus in the graphical interface - but it is not opening from the command prompt.
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11945574
you can do that in SQLPLUS graphic interface too...

so do it there...let's know what happens...

but there is something fishy with command prompt sqlplus

can you try this and post the results?

C:\>sqlplus /nolog

0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11945579
or use the single quote around...


C:\>sqlplus 'sys/password1 as sysdba'


0
 
LVL 1

Author Comment

by:Intern
ID: 11945614
nothing - with both suggestions

I am really confused now, even if I use "sqlplus" and nothing else.  Could this be something with the set ORACLE_HOME command.  Would this affect sqlplus if something was wrong in that command??
0
 
LVL 1

Author Comment

by:Intern
ID: 11945693
I changed the set ORACLE_HOME to

set ORACLE_HOME=C:\oracle\product\10.1.0\db_1

c:\>sqlplus "sys/password1 as sysdba"
Message 133 not found; product=SQLPlus; facility=SP2
: Release 9.0.1.4.0 - Production on etc...

ERROR:
ORA-12538: TNS:no such Protocol adapter

Enter user-name:

This is what I get now
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11945776
was you able to use SQLPLUS before?

this is correct: set ORACLE_HOME=C:\oracle\product\10.1.0\db_1


try to modify your SQLNET.ORA file

change this line:
NAMES.DIRECTORY_PATH= (LDAP, TNSNAMES, ONAMES, HOSTNAME)

to

NAMES.DIRECTORY_PATH= (TNSNAMES, LDAP, ONAMES, HOSTNAME)
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11945784
than save sqlnet.ora file, try sqlplus again...
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11952136
are you getting anywhere with my latest suggestion?
0
 
LVL 9

Expert Comment

by:konektor
ID: 11952283
create pfile, or as i see you already have it
shutdown DB (or it id down and u cannot start it ...)
sql> startup pfile=<filepath to pfile>
create spfile from pfile after database has started
0
 
LVL 1

Author Comment

by:Intern
ID: 11952604
>seazodiac

I am still having trouble getting into SQLPlus, so I am not sure what to do.  Our company just purchaced Oracle DB, Developer and a bunch of other stuff but the paperwork has not gone through yet so I have no access to support yet.  Our salesrep from Oracle said that he will try to get someone on the phone with me and fix the problem.  I will keep trying your suggestions until that happens though.  Anyway thanks for your help so far.
0
 
LVL 9

Assisted Solution

by:konektor
konektor earned 50 total points
ID: 11952984
i didn't mentioned u cannot log to sqlplus ...

ORA-12538: TNS:no such Protocol adapter means, that sqlplus doesn't know which database should it connect to

at cmd prompt run :
c:>sqlplusw /nolog
SQL> conn sys@<sid of your DB> as sysdba

if u obtain error ORA-12541, your listener does not run. try to start it (c:> lsnrctl start).
if u cannot start listener u can do this :
c:>set ORACLE_SID=<sid of your DB>
c:>sqlplusw /nolog
SQL> conn sys as sysdba -- see no specifying database name (it's taken from OS environment variable)
0
 
LVL 1

Author Comment

by:Intern
ID: 11953276
>seazodiac

THANK YOU!!!!!  The problem is finally fixed - your solution worked great.  Please post a message at the following link so I can give you the rest of the points:

http://www.experts-exchange.com/Databases/Oracle/Q_21114037.html
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question