Search This Blog

Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Monday, December 16, 2013

TNS-03505: Failed to resolve Name

Check thoses:

lsnrctl status
tnsping <ORACLE_SID>

listener.ora
tnsnames.ora
sqlnet.ora

hostname
variable TNS_ADMIN

Note: This article will be updated with more details and explanations

ORA-01031: insufficient privileges (on Windows)

When you have this error, here is a few things to check:
  • you have your password file. If not, recreate it:
orapwd file=c:\.....\database\PWD{SID}.ora force=[y/n] 

Carefull for linux DBA, the file is named differentely on Windows - PWD{ORACLE_SID}.ora (ex. PWDORCL.ora), it kepts me looking for a solution to this problem a loonnnng time...

  • remote_login_passwordfile must be set to EXCLUSIVE
  • If you have two runtime running on the same server (10g and 11g for example), set the TNS_ADMIN environement variable with the location of your sqlnet.ora, listener.ora and tnsnames.ora files
  • The oracle user is in the right group (dba)
  • Add this line into your sqlnet.ora file (haven't done it yet, but it supposed to fix the issue)
SQLNET.AUTHENTICATION_SERVICES = (NTS)


Thursday, December 12, 2013

Drop an Oracle database on Windows server

step 1: get datafile, control file and redo log file location
select file_name from dba_data_files
select name from v$controlfile
select member from v$logfile

step 2: set env variables if not done yet
set oracle_home=C:\Oracle\Orant1020
set oracle_sid=XXX

step 3: shutdown database and restart it in mount stage and restricted exclusively.
SQL> shutdown immediate;
SQL> startup mount exclusive restrict;

step 4: drop the DB and exit sqlplus
SQL> drop database;

step 5: check if the database files are removed, do it if not. Don't forget the folders, trc, alert file, etc.

step 6: Drop the XXX related services using ORADIM
C:\> oradim -delete -sid XXX
Instance deleted.

step 7: Check the listener if there is any XXX services and unregister them if yes. It does it by default, but in case.