Solved

Editing tnsnames.ora in Linux

Posted on 2013-11-01
3
2,113 Views
Last Modified: 2013-11-11
I am adding two entries to the tnsnames,ora file on linux server.

First there are two tnsnames.ora file:

/u01/app/oracle/product/11.1.0/client_1/network/admin/tnsnames.ora
/u01/app/oracle/product/11.2.0/network/admin/tnsnames.ora

how I determine which one to use?

another thing is when I open the file for editing with vi editor, then i hit "i" and get a warning:

-- INSERT -- W10: Warning: Changing a readonly file

than I add new entries and try to save it using :w, I get a warning "E45: 'readonly' option is set (add ! to override) "

So I try :w! to save it and get "tnsnames.ora" E212: Can't open file for writing"

Can someone tell me how do I make changes to tnsnames.ora?

I am a UNIX user and my UNIX skill don't seem to apply to Linux
0
Comment
Question by:YZlat
3 Comments
 
LVL 14

Accepted Solution

by:
comfortjeanius earned 500 total points
ID: 39617904
Did you try to ls -l these file location

/u01/app/oracle/product/11.1.0/client_1/network/admin/tnsnames.ora
/u01/app/oracle/product/11.2.0/network/admin/tnsnames.ora

You need to change the file for editing

chmod 777 /u01/app/oracle/product/11.2.0/network/admin/tnsnames.ora

then try to edit it save it and change the permission back.


If that does not work you can always su to root.
0
 
LVL 34

Expert Comment

by:Seth Simmons
ID: 39618192
first of all, seems you have multiple oracle versions installed either client for 11.1 and 11.2 or client/server different versions.  need to edit the one that matches the sqlplus version

second, don't make the file world-writeable.  edit the file properly with the oracle account (or whatever account owns it).  changing things like that to world-writeable is asinine and unnecessary
0
 
LVL 35

Author Closing Comment

by:YZlat
ID: 39638919
After I su to oracle it worked
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

757 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now