Does anyone know why this is happening? I can select the table but
can't export it.
C:\>sqlplus myschema/myschema
SQL*Plus: Release 12.1.0.2.0 Production on Mon Aug 1 14:43:45 2016
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Last Successful login time: Mon Aug 01 2016 14:42:51 -04:00
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics, and Real Application Testing opt
ions
SQL> select * from product;
ID NAME
---------- --------------------
1 sample_product_name
SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64
bit Production
With the Partitioning, OLAP, Advanced Analytics, and Real Application Testing opt
ions
C:\>expdp myschema/myschema#oradev tables=product directory=DATA_PUMP_DIR dumpfi
le=expdp_myschema.dmp logfile=expdp_myschema.log
Export: Release 12.1.0.2.0 - Production on Mon Aug 1 14:44:16 2016
Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit
Production
With the Partitioning, OLAP, Advanced Analytics, and Real Application Testing opt
ions
WARNING: Oracle Data Pump operations are not typically needed when connected to
the root or seed of a container database.
Starting "MYSCHEMA"."SYS_EXPORT_TABLE_01": myschema/********#oradev tables=prod
uct directory=DATA_PUMP_DIR dumpfile=expdp_myschema.dmp logfile=expdp_myschema.l
og
Estimate in progress using BLOCKS method...
Total estimation using BLOCKS method: 0 KB
Processing object type TABLE_EXPORT/TABLE/STATISTICS/MARKER
**ORA-39166: Object MYSCHEMA.PRODUCT was not found** or could not be exported or imp
orted.
ORA-31655: no data or metadata objects selected for job
Job "MYSCHEMA"."SYS_EXPORT_TABLE_01" completed with 2 error(s) at Mon Aug 1 14:4
4:18 2016 elapsed 0 00:00:01
Add parameter CONTENT=ALL at the end of your expdp command line,like this:
expdp myschema/myschema#oradev tables=product directory=DATA_PUMP_DIR dumpfi le=expdp_myschema.dmp logfile=expdp_myschema.log CONTENT=ALL
and execute it.
Related
I have written a code that will give me the required output after executing it.
Below is the code:
#!/bin/ksh
sqlplus / << !EOF!
set verify off
set heading off
set pagesize 0
set feedback off;
select * from account where account_name='23553558101';
exit;
!EOF!`
The problem is that I'm getting all the non-required stuffs too, but I need the output only not other things along with that.
Below is the output I'm getting:
$ ./sqltest
SQL*Plus: Release 10.2.0.1.0 - Production on Mon May 29 17:32:52 2017
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining Scoring Engine and Real Application Testing options
17:32:52 OPS$SP1ITA1B#SVITPRD1 > 17:32:52 OPS$SP1ITA1B#SVITPRD1 > 17:32:52 OPS$SP1ITA1B#SVITPRD1 > 17:32:52 OPS$SP1ITA1B#SVITPRD1 > 17:32:52 OPS$SP1ITA1B#SVITPRD1 > 17:32:52 OPS$SP1ITA1B#SVITPRD1 > 56566309 23553558101 20-05-2017 05:41:00 57194135 20000184 64,56
20-05-2017 00:00:00 340393871 338845845 500 0
0
17:32:52 OPS$SP1ITA1B#SVITPRD1 > 17:32:52 OPS$SP1ITA1B#SVITPRD1 > Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, OLAP, Data Mining Scoring Engine and Real Application Testing options
When you are using sqlplus in a shell script is better to log in using the silent mode "sqlplus -s" to supress the login messages and also to remove the sql prompt "sql >".
Further more, you need to change some variables like:
heading - it will not display the head of the query result(the name of the columns to be more precise)
set heading off
feedback - it will not return the number of rows after a query select.
set feedback off
verify - is used to display the values in case you have substitution variables
set verify off
The columns presented above are ON by default so it is better to switch them off if you want a clean display (just the result) and also it is mandatory in my opionion if the result of your sqlplus will be collected by a shell variable.
You can check the manual for more information about sqlplus system variables:
https://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve040.htm#SQPUG060
I have installed Oracle 11g version - Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production.
I have created a user called K_demo. But I am not able to connect to the user using sqlplus. Getting below error.
SQL*Plus: Release 11.2.0.1.0 Production on Sun Apr 16 10:35:08 2017
Copyright (c) 1982, 2010, Oracle. All rights reserved.
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
Enter user-name:**
Although I am able to connect from sys using conn
SQL> conn K_DEMO/"pass#123"#ORCL
Connected.
SQL> show user;
USER is "K_DEMO"
SQL>
what could be the reason?
i have oracle11g desktop. For my project I create 3 databases via configuration assistant tools. Then I delete one of them
and after this I have the error: ora-12560.
By mistake both of my databases have the same pasword,
for example: when i want to connect one of these data bases with system user, i have one pasword and perhaps the databases dont know connect which one.
I start all services
set oracle_sid=orcl.
I run lsnrctl
tnsping check tansname.ora & my listener.ora
and I logon with sysdba#oracle_sid
but i have this error again
pleas help me
tnx
sounds like the database is not up. you probably restarted your machine and the instance is not set to autostart
C:\Documents and Settings\tkyte>sqlplus scott/tiger
SQL*Plus: Release 10.1.0.4.0 - Production on Thu Sep 6 15:43:55 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, OLAP and Data Mining options
scott%ORA10GR1> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, OLAP and Data Mining options
C:\Documents and Settings\tkyte>net stop oracleserviceora10gr1
The OracleServiceORA10GR1 service is stopping.........
The OracleServiceORA10GR1 service was stopped successfully.
C:\Documents and Settings\tkyte>sqlplus scott/tiger
SQL*Plus: Release 10.1.0.4.0 - Production on Thu Sep 6 15:44:35 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ERROR:
ORA-12560: TNS:protocol adapter error
Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error
Enter user-name:
ERROR:
ORA-12560: TNS:protocol adapter error
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
C:\Documents and Settings\tkyte>net start oracleserviceora10gr1
The OracleServiceORA10GR1 service is starting..........
The OracleServiceORA10GR1 service was started successfully.
C:\Documents and Settings\tkyte>sqlplus scott/tiger
SQL*Plus: Release 10.1.0.4.0 - Production on Thu Sep 6 15:45:12 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.4.0 - Production
With the Partitioning, OLAP and Data Mining options
scott%ORA10GR1>
I have got the same error after delete a db (in the window enviroment) and I resolved as following
the first way:
C:> SET ORACLE_SID = SID NAME
the second way:
Use regedit locate to path: HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_HOME_NAME
update ORACLE_SID =
refer at: https://docs.oracle.com/database/121/ADMQS/GUID-EC18C4A6-3BA5-4C14-9D76-B0DD62FEFFF2.htm#ADMQS12369
My problem is after I started Oracle Listener succesfully, it will stop automatically after a few seconds.
cache1-> lsnrctl start
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-MAY-2013 16:35:36
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Starting /u01/app/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait...
TNSLSNR for Linux: Version 11.2.0.1.0 - Production
System parameter file is /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Log messages written to /u02/ora/diagnostic_dest/diag/tnslsnr/cache1/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 11.2.0.1.0 - Production
Start Date 20-MAY-2013 16:35:36
Uptime 0 days 0 hr. 0 min. 0 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
Listener Log File /u02/ora/diagnostic_dest/diag/tnslsnr/cache1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
Services Summary...
Service "ora" has 1 instance(s).
Instance "ora", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
during the mean time, the tnsping from other server is worked.
cache2-> tnsping cache1
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 20-MAY-2013 16:35:38
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.2)(PORT=1521)))
OK (0 msec)
after a few seconds, I check it again, it stopped automatically:
cache1-> lsnrctl status
LSNRCTL for Linux: Version 11.2.0.1.0 - Production on 20-MAY-2013 16:36:36
Copyright (c) 1991, 2009, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error
TNS-00511: No listener
Linux Error: 111: Connection refused
and tnsping doesn't work.
cache2-> tnsping cache1
TNS Ping Utility for Linux: Version 11.2.0.1.0 - Production on 20-MAY-2013 16:36:37
Copyright (c) 1997, 2009, Oracle. All rights reserved.
Used parameter files:
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.200.2)(PORT=1521)))
TNS-12541: TNS:no listener
the listener.ora:
/u01/app/oracle/product/11.2.0/db_1/network/admin/listener.ora
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = ora)
(GLOBAL_DBNAME = ora)
(ORACLE_HOME = /u01/app/oracle/product/11.2.0/db_1)
)
)
LISTENER =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))
)
ADR_BASE_LISTENER = /u02/ora/diagnostic_dest
Thanks
Faced simillar issue with oracle11gr2 in rhel 6.x...
Not sure if same issue ...check the log.xml file for trc log location in my case:
/u01/app/oracle/diag/tnslsnr/dbserver/listener/alert/log.xml
from above file we got link to following log file:
/u01/app/oracle/diag/tnslsnr/dbserver/listener/trace/listener.log
the above file, we checked and we were keep getting the following :
WARNING: Subscription for node down event still pending
13-FEB-2017 17:28:42 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=dbserver)(USER=oracle))(COMMAND=status)(ARGUMENTS=64)(SERVICE=LISTENER)(VERSION=186647040)) * status * 0
WARNING: Subscription for node down event still pending
After googling a little bit we found some info in "https://docs.oracle.com/cd/E11882_01/network.112/e10835/listener.htm#NETRF312"
we need to add the following at the end of listener.ora
/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener.ora
SUBSCRIBE_FOR_NODE_DOWN_EVENT_LISTENER = off
I have the following problem with Oracle 11g TNSPING utility: fresh 11g client installation, ORACLE_HOME set up properly, TNS_ADMIN also set, msb files available in desired location, readable by the user that invokes TNSPING. Connection to the database works, sqlplus can be used to connect. TNSPING, however, fails badly. See attached log:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\USERNAME>set ORACLE_HOME=C:\Work\Software\Oracle\product\11.2.0\client_1
C:\Users\USERNAME>set TNS_ADMIN=%ORACLE_HOME%\network\admin
C:\Users\USERNAME>set NLS_LANG=ENGLISH_POLAND.EE8MSWIN1250
C:\Users\USERNAME>dir %TNS_ADMIN%\tnsnames.ora
Volume in drive C is XXX
Volume Serial Number is YYY
Directory of C:\Work\Software\Oracle\product\11.2.0\client_1\network\admin
2013-03-19 12:26 358 tnsnames.ora
1 File(s) 358 bytes
0 Dir(s) 59 082 616 832 bytes free
C:\Users\USERNAME>dir %ORACLE_HOME%\network\mesg\tns*.msb
Volume in drive C is XXX
Volume Serial Number is YYY
Directory of C:\Work\Software\Oracle\product\11.2.0\client_1\network\mesg
2010-03-31 07:01 53 248 tnspl.msb
2010-03-31 07:01 47 104 tnsus.msb
2 File(s) 100 352 bytes
0 Dir(s) 59 082 616 832 bytes free
C:\Users\USERNAME>sqlplus <USER>/<PASSWORD>#<DATABASE>
SQL*Plus: Release 11.2.0.1.0 Production on Tue Mar 19 14:36:34 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
SQL> exit
Disconnected from Oracle Database 11g Release 11.2.0.2.0 - 64bit Production
C:\Users\USERNAME>tnsping <DATABASE>
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 19-MAR-2013 14:37:52
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Message 3511 not found; No message file for product=NETWORK, facility=TNSMessage 3512 not found; No message file for product=NETWORK, facility=TNSMessage 3513 not found; No message file for product=NETWORK, facility=TNSMessage 3509 not found; No message file for product=NETWORK, facility=TNS
Please note: I had to replace all the user credentials, database name, etc., due to security considerations.
Can you help me, please, troubleshoot the issue? I have read all the other StackExchange topics related to TNSPING failure, but each of the solutions (set up ORACLE_HOME, reinstall, make sure registry points to proper home, check msb files) has failed me...
Thanks in advance!