August 16, 2017

SQLcl - the SQL*Plus plus a plus ...

"euphoric: intensely happy or confident", @thatjeffsmith, https://youtu.be/ecgijS76jvw ...

Just watched the video from @thatjeffsmith about SQLcl - and it is, indeed, worth the time. After looking that video, I'm pretty sure that SQLcl will replace SQL*Plus within months (if some more people 'spread the word').

Just a few keywords to make you curious:

  • SQLcl is available as 'standalone' download, but it is also already part of the latest SQLDeveloper 17.2.0
  • SQLcl needs an JRE to run 
  • To start SQLcl use 'sql' - not 'sqlcl'
  • SQLcl has almost all features included, SQL*Plus has (simply run Your sql scripts in SQLcl instead of SQL*Plus)
  • Once started, type help and You'll see all the new commands available. For example:
    • alias - define aliases for often used SQL-Commands
    • cd - change directory when within SQLcl
    • ctas - simply type 'ctas <table> <new-table>' and You'll get the complete syntax for a 'Create Table As Select'. The ctas is loaded into the SQLcl buffer, so You could simply issue a '/' and the code is executed. Ok - You have to edit the result, because of ORA-02264 errors (Constraint already exists - but thats easy done by typing ed to start the editor
    • SQLcl eases typing of statements. It can autocomplete column and table names. Example: Type 'select * from hr.empl<tab>' and it automatically autocompletes to hr.employees. If more than one possibility is available, it lists all ...
    • DDL - a command to extract the ddl for a given object
    • info - a 'verbose' desc which displays way more information about an object
    • info+ - yes, info+! An even more informational view on an object. Interestingly, neither info nor info+ are shown when issuing an help command. But 'help information' will show how to use it.
    • history - show the last 100 command You'd issued in SQLcl (customizable to any value). Even more: You can use history <index> (where index is the number of a sql statement in the history) to load a sql statement in buffer - execute it by typing / , edit it (ed) or change values using the good old 'c/<old value>/<new value>


And there is a lot more - repeat for example, which repeats a statement n times, sleeping t seconds between each execution. Watch the video and then try SQLcl!

"euphoric: intensely happy or confident" - Yes, I am :-)





Share:

July 31, 2017

July 6, 2017

ODA X6-2S - upgrade from 12.1.2.10.0 to 12.1.2.11.0 ... just a few remarks

Did an update of our ODA X6-2S from 12.1.2.10.0 to 12.1.2.11.0 Patch Bundle and want to share some findings. 

The patching process is described quite good in the README - nevertheless, a few remarks:


  • the whole process took about 2 hours - without downloading the necessary files and preparations (for example: read the README ;-))
  • The time, the update process takes, depends on the number of databases running on that system (in our case just four)
  • The README does not clearly mention that the system is rebooted two times. 
    First time after step odacli update-serversecond after step odacli update-storageBut not immediately after the update step - the system waits for 5 Minutes until it starts rebooting (!)
    Do not start any following step before the reboot has taken place and the system is available again
  • README chapter 4 - Post Patching Steps - tells not the whole truth: oracle talks about issuing an update-image command. But, in the Image-Patch README is mentioned that You have to issue a

    odacli update-repository --fileName /tmp/oda-sm-12.1.2.11.0-170503-DB-12.1.0.2.zip

    Long story told short:
    1. do the 'update-repository' step first 
    2. '--fileName' will throw an error - the command is: '--filename' (all lower case) or - alternatively '-f'
    3. after updating the repository, issue the update-image

That's it, basically. Happy upgrading!

Share:

June 28, 2017

bind csid (#) does not match session csid (#)

Problem

A database's alert log is full of messages like


Wed Jun 28 09:13:09 2017
Errors in file /cloudfs/adr/diag/rdbms/scs12fi/SCS12FI/trace/SCS12FI_ora_16694.trc:
Wed Jun 28 09:13:10 2017
Errors in file /cloudfs/adr/diag/rdbms/scs12fi/SCS12FI/trace/SCS12FI_ora_16694.trc:
Wed Jun 28 09:13:13 2017
Errors in file /cloudfs/adr/diag/rdbms/scs12fi/SCS12FI/trace/SCS12FI_ora_16694.trc:
Wed Jun 28 09:16:25 2017

Errors in file /cloudfs/adr/diag/rdbms/scs12fi/SCS12FI/trace/SCS12FI_ora_16694.trc:

The trace file shows
psdgbt: bind csid (1) does not match session csid (31)

psdgbt: session charset is WE8ISO8859P1

Reason

MOS Note "After restart of database suddenly PLS-00553: character set name is not recognized are seen in the alert.log (Doc ID 1599864.1)" is not exactly a description of what has happend, but points in the correct direction.

Reason was - in my case - that an agent which has connected to a freshly created clone of a production database a little to early was stuck with an Character Set which was current at the time of the first connect. After the database has been fully started, the correct charset is used - which now does not fit anymore to the session charset used by the agent connect.


Solution

in my case: simply restart the agent ...
Share:

June 26, 2017

EM 13c: TNS-01190 errors when listener owner and agent owner are not the same account

Problem:

When monitoring listener's logfile, lots of TNS-01190 are found:

<msg time='2017-06-26T10:21:47.608+02:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNOWN' level='16' host_id='edosrvoda03'
 host_addr='192.168.15.70'>
 <txt>26-JUN-2017 10:21:47 * (CONNECT_DATA=(CID=(PROGRAM=)(HOST=edosrvoda03)(USER=oracle))(COMMAND=trc_directory)(ARGUMENTS=2)(SERVICE=LISTENER)(VERSION=202375680)) * trc_directory * 1190
 </txt>
</msg>
<msg time='2017-06-26T10:21:47.608+02:00' org_id='oracle' comp_id='tnslsnr'
 type='UNKNOWN' level='16' host_id='edosrvoda03'
 host_addr='192.168.15.70'>
 <txt>TNS-01190: The user is not authorized to execute the requested listener command
 </txt>

</msg>

The owners of the agent process is different from the listener process owner. Example: agent is installed and run under user account 'oracle' - listener is started by user 'grid'. 

Reproducability: Every time, Enterprise Manager tries to discover or rediscover new targets on a system, these TNS-01190 errors will occur in listener's logfile. So, try a rediscover on a certain host - after that, You'll find TNS-01190 errors in the listener log.


'Solution'

MOS Note "How To Disable Oracle Database Listener Alerts TNS-01190 In Enterprise Manager Cloud Control to avoid the error "trc_directory (TNS-1190), log_directory (TNS-1190),. Please check log for details." (Doc ID 1399060.1)" recommends two possible solutions:

  1. set a listener password and include that password in 'Monitoring Configuration' of the listener target.
    This recommendation does not work for listeners of version 12.1 and higher, because the password feature is no longer supported.
  2. edit the metric and remove the 1190 string from the list of values.
    Remains the only possibility ... change Your monitoring template and/or target setting, edit TNS Errors / TNSMsg and replace 'TNS-[ ]*0*(1169|1189|12508|1190)' with 'TNS-[ ]*0*(1169|1189|12508)' (remove the '|1190') or - and that's imho the best way - do not monitor TNSMsgs ...
Share:

June 19, 2017

dbca - db creation stops with dbmssml.sql error



Abstract:


Trying to create a database using dbca on a Oracle Linux 7 running in a Virtualbox Container. DBCA throws an error during database creation: something like "dbmssml.sql. refer to dbmssml0.log error in process: perl". The mentioned log file is empty.


Solution:

Important!: It is NOT a database software or a dbca problem. Additionally, if You run a 'perl -v' command, You'll receive a 'segmentation error' - this is, too, not a database, nor a perl problem. Instead, it is a Virtualbox 5 issue.

Found the solution for that here: Oracle DB12c / OL7 / VBox 5 – Perl Segmentation Fault
Share:

June 16, 2017

OracleXADataSource cannot be cast to java.sql.Driver

Tried to start a Forms / Reports Server on an all new server. During startup of the AdminServer, I got an errormessage:

<BEA-000362> <Server failed. Reason: 

There are 1 nested errors:

oracle.security.jps.JpsException: oracle.security.jps.service.policystore.PolicyStoreException: javax.persistence.PersistenceException: java.lang.ClassCastException: oracle.jdbc.xa.client.OracleXADataSource cannot be cast to java.sql.Driver

Solution:

In my case it was quite simple: Start the Repository Database and the according listener process ... if not running. If running, check whether or not the Repository Database can be connected by using the EZConnect ConnectString for Your Repository DB. Pattern for EZConnect is like this: host.domain:port/servicename

Share:

Copyright © Robert Crames' Oracle Database and Middleware Blog | Powered by Blogger
Design by SimpleWpThemes | Blogger Theme by NewBloggerThemes.com