Home » SQL & PL/SQL » SQL & PL/SQL » connection issue-how to reset ? (4.1.3 sql developer)
connection issue-how to reset ? [message #649324] Tue, 22 March 2016 13:08 Go to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

Hi all,

trying to load text file using external table concept.

first :create a diretory test_dir


SQL> conn sys as sysdba
Enter password:
Connected.
SQL> create or replace directory test_dir as ' C:\Users\m123\Desktop';

Directory created.

second: this is the text file trying to login in, named it as employdetails.txt
001,Hutt,Jabba,896743856,jabba@thecompany.com,18
002,Simpson,Homer,382947382,homer@thecompany.com,20
003,Kent,Clark,082736194,superman@thecompany.com,5
004,Kid,Billy,928743627,billythkid@thecompany.com,9
005,Stranger,Perfect,389209831,nobody@thecompany.com,23
006,Zoidberg,Dr,094510283,crustacean@thecompany.com,1

third: code to load ;

create table employdetails1(
name varchar2(14),firstname char(21),lastname char(21),phone number(12),email varchar2(14),
dept number(4)
)
ORGANIZATION EXTERNAL
(
type oracle_loader
default directory test_dir
  access paramEters(
    records delimited by newline
    fields terminated by ','
        missing field values are null
        (
        name varchar2(14),firstname char(21),lastname char(21),phone number(12),email varchar2(14),
dept number(4)
        )
    )    
  LOCATION ('EMPLOYDETAILS.TXT')
  )
  
  reject limit unlimited;
  


receiving error as:
conn sys as sysdba
Error report -
Connection Failed
USER = sys
URL = jdbc:oracle:thin:@localhost:1521/orcl
Error Message = Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
Commit

is there any way to reset password
i am trying to change it it shows null password

SQL>
SQL> SHOW USER
USER is "SYS"
SQL> PASSW SYS
Changing password for SYS
Old password:
New password:
Retype new password:
ERROR:
ORA-01005: null password given; logon denied

[Updated on: Tue, 22 March 2016 13:16]

Report message to a moderator

Re: connection issue-how to reset ? [message #649325 is a reply to message #649324] Tue, 22 March 2016 13:14 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
SYS schema should ONLY be used to apply Oracle patchsets or do Oracle version upgrades.
SYS schema should NOT be used for any application support activities.

Stop ABUSING the SYS schema!
Re: connection issue-how to reset ? [message #649327 is a reply to message #649325] Tue, 22 March 2016 13:54 Go to previous messageGo to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

SQL> ALTER USER sys IDENTIFIED BY newpassword;

User altered.

but when trying to connect in sql developer it is displaying as incorrect?
Error starting at line : 26 in command -
conn sys as sysdba
Error report -
Connection Failed, Error Reports:
USER = sys
URL = jdbc:oracle:thin:@localhost:1521/orcl
Error Message = Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
Retry up to 3 times
Re: connection issue-how to reset ? [message #649328 is a reply to message #649327] Tue, 22 March 2016 13:59 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
Why do you ignore my advice regarding use of SYS schema?

http://www.orafaq.com/wiki/JDBC

post results of the OS commands below

lsnrctl status
lsnrctl service

Every connection requests gets logged by the listener

post excerpt from listener.log file that contains the status code=12514 value
Re: connection issue-how to reset ? [message #649329 is a reply to message #649324] Tue, 22 March 2016 14:01 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
Make sure that the operating system user that Oracle runs under has read/write privileges to the operating system directory that the data file is in or move the file to such directory. The directory must be on the server, not the client. Make sure that the Oracle user (not SYS) has privileges to create an Oracle directory object and an external table. The size of each column must be big enough to fit the data. The field names in the second part of the external table creation must be in the order that they appear in the file and must be of proper data types, such as CHAR and INTEGER EXTERNAL, not VARCHAR2 or NUMBER. Please see the example below.

SCOTT@orcl> HOST TYPE c:\my_oracle_files\employdetails.txt
001,Hutt,Jabba,896743856,jabba@thecompany.com,18
002,Simpson,Homer,382947382,homer@thecompany.com,20
003,Kent,Clark,082736194,superman@thecompany.com,5
004,Kid,Billy,928743627,billythkid@thecompany.com,9
005,Stranger,Perfect,389209831,nobody@thecompany.com,23
006,Zoidberg,Dr,094510283,crustacean@thecompany.com,1

SCOTT@orcl> CREATE OR REPLACE DIRECTORY test_dir AS 'c:\my_oracle_files'
  2  /

Directory created.

SCOTT@orcl> CREATE TABLE employdetails1
  2    (name       VARCHAR2(14),
  3     firstname  CHAR(21),
  4     lastname   CHAR(21),
  5     phone      NUMBER(12),
  6     email      VARCHAR2(25),
  7     dept       NUMBER(4))
  8  ORGANIZATION EXTERNAL
  9    (TYPE oracle_loader
 10     DEFAULT DIRECTORY test_dir
 11     ACCESS PARAMETERS
 12       (RECORDS DELIMITED BY NEWLINE
 13        LOGFILE 'TEST_DIR':'test.log'
 14        FIELDS TERMINATED BY ','
 15        MISSING FIELD VALUES ARE NULL
 16          (name       CHAR(14),
 17           lastname   CHAR(21),
 18           firstname  CHAR(21),
 19           phone      INTEGER EXTERNAL(12),
 20           email      CHAR(25),
 21           dept       INTEGER EXTERNAL(12)))
 22     LOCATION ('employdetails.txt'))
 23  REJECT LIMIT UNLIMITED
 24  /

Table created.

SCOTT@orcl> SELECT * FROM employdetails1
  2  /

NAME           FIRSTNAME             LASTNAME                   PHONE EMAIL                           DEPT
-------------- --------------------- --------------------- ---------- ------------------------- ----------
001            Jabba                 Hutt                   896743856 jabba@thecompany.com              18
002            Homer                 Simpson                382947382 homer@thecompany.com              20
003            Clark                 Kent                    82736194 superman@thecompany.com            5
004            Billy                 Kid                    928743627 billythkid@thecompany.com          9
005            Perfect               Stranger               389209831 nobody@thecompany.com             23
006            Dr                    Zoidberg                94510283 crustacean@thecompany.com          1

6 rows selected.

Re: connection issue-how to reset ? [message #649330 is a reply to message #649327] Tue, 22 March 2016 14:03 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
I suggest that you run it from SQL*Plus, as I did, instead of SQL Developer. That eliminates one additional layer that may contribute to errors.
Re: connection issue-how to reset ? [message #649331 is a reply to message #649330] Tue, 22 March 2016 14:18 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

The main problem is that the database/service is not open (assuming the service description is correct).

ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
 *Cause:  The listener received a request to establish a connection to a
 database or other service. The connect descriptor received by the listener
 specified a service name for a service (usually a database service)
 that either has not yet dynamically registered with the listener or has
 not been statically configured for the listener.  This may be a temporary
 condition such as after the listener has started, but before the database
 instance has registered with the listener.
 *Action:
  - Wait a moment and try to connect a second time.
  - Check which services are currently known by the listener by executing:
    lsnrctl services <listener name>
  - Check that the SERVICE_NAME parameter in the connect descriptor of the
    net service name used specifies a service known by the listener.
  - If an easy connect naming connect identifier was used, check that
    the service name specified is a service known by the listener.
  - Check for an event in the listener.log file.

[Updated on: Tue, 22 March 2016 14:19]

Report message to a moderator

Re: connection issue-how to reset ? [message #649332 is a reply to message #649330] Tue, 22 March 2016 14:19 Go to previous messageGo to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

Hi Barbara
Thankyou for the explaining it clearly, but it shows cartridge error for me:


ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEOPEN callout
ORA-29400: data cartridge error
KUP-00554: error encountered while parsing access parameters
KUP-01005: syntax error: found "identifier": expecting one of: "binary_double,
binary_float, comma, char, date, defaultif, decimal, double, float, integer, (,
nullif, oracle_date, oracle_number, position, raw, recnum, ), unsigned,
varrawc, varchar, varraw, varcharc, zoned"
KUP-01008: the bad identifier was: varchar2
KUP-01007: at line 5 column 14
Re: connection issue-how to reset ? [message #649333 is a reply to message #649332] Tue, 22 March 2016 14:20 Go to previous messageGo to next message
Michel Cadot
Messages: 68641
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

You still don't know what copy and paste a SQL*Plus session means.
You still don't know to format your post.

[Updated on: Wed, 23 March 2016 15:32]

Report message to a moderator

Re: connection issue-how to reset ? [message #649334 is a reply to message #649332] Tue, 22 March 2016 14:57 Go to previous messageGo to next message
Barbara Boehmer
Messages: 9088
Registered: November 2002
Location: California, USA
Senior Member
The error that you are receiving means that you still have VARCHAR2 in the lower section, below where it says missing field values are null, where it should be CHAR instead. Copy and paste the following and run it.

CREATE TABLE employdetails1
  (name       VARCHAR2(14),
   firstname  CHAR(21),
   lastname   CHAR(21),
   phone      NUMBER(12),
   email      VARCHAR2(25),
   dept       NUMBER(4))
ORGANIZATION EXTERNAL
  (TYPE oracle_loader
   DEFAULT DIRECTORY test_dir
   ACCESS PARAMETERS
     (RECORDS DELIMITED BY NEWLINE
      LOGFILE 'TEST_DIR':'test.log'
      FIELDS TERMINATED BY ','
      MISSING FIELD VALUES ARE NULL
        (name       CHAR(14),  
         lastname   CHAR(21),
         firstname  CHAR(21),
         phone      INTEGER EXTERNAL(12),
         email      CHAR(25),
         dept       INTEGER EXTERNAL(12)))
   LOCATION ('employdetails.txt'))
REJECT LIMIT UNLIMITED;


Re: connection issue-how to reset ? [message #649385 is a reply to message #649334] Wed, 23 March 2016 15:29 Go to previous messageGo to next message
M123
Messages: 47
Registered: February 2016
Location: USA
Member

thankyou all..for the suggestions
Re: connection issue-how to reset ? [message #649405 is a reply to message #649327] Thu, 24 March 2016 06:37 Go to previous message
EdStevens
Messages: 1376
Registered: September 2013
Senior Member
M123 wrote on Tue, 22 March 2016 13:54
SQL>
Error Message = Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor



What does the above error have to do with passwords?

See my article on ORA-12514 at http://edstevensdba.com/blog-article-index/
Previous Topic: Update without cursor
Next Topic: Using utl_file
Goto Forum:
  


Current Time: Fri Apr 19 15:23:48 CDT 2024