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 |
|
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 #649329 is a reply to message #649324] |
Tue, 22 March 2016 14:01 |
|
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 #649331 is a reply to message #649330] |
Tue, 22 March 2016 14:18 |
|
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 |
|
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 #649334 is a reply to message #649332] |
Tue, 22 March 2016 14:57 |
|
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;
|
|
|
|
|
Goto Forum:
Current Time: Fri Apr 19 15:23:48 CDT 2024
|