Monday, November 23, 2015

DBCA hangs after click Finish button

Today I have ran DBCA tool to create database.
All the sudden, I found FINISH button is not working anymore! DBCA is hangs after all. The only option is to cancel the DBCA.

However, there is warning messages after issued dbca.

It's the time to refer MASTER NOTE... Master Note: Troubleshooting Database Configuration Assistant (DBCA) (Doc ID 1510457.1)

Finally, I got this related document.
DBCA/DBUA APPEARS TO HANG AFTER CLICKING FINISH BUTTON (Doc ID 727290.1)


In 10.2 trace information should be written automatically to the following location  
$ORACLE_HOME/cfgtoollogs/dbca/trace.log

In my scenario, I am using Xming as X-tool because it is FREE! That's all!
The recommendation is to install the complete font package.

Go this website http://www.straightrunning.com/XmingNotes/


Download and install.
 
 
 
 


 

The result is

Wednesday, August 12, 2015

ORA-02024: database link not found


I am using 'SYS' to drop the database link of another owner 'ALEE'.
But, the error have been prompted.

 

There are 2 suggestions from Oracle experts to create drop db link procedure.

1) Procedure with delete single database links with owner. and db link name.
SQL> CREATE OR REPLACE PROCEDURE Drop_DbLink(schemaName VARCHAR2, dbLink VARCHAR2 ) IS
            plsql   VARCHAR2(1000);
            cur     NUMBER;
            UID     NUMBER;
            rc      NUMBER;
    BEGIN
            SELECT
                    u.user_id INTO UID
           FROM    dba_users u
           WHERE   u.username = schemaName;
             plsql := 'drop database link "'||dbLink||'"';
             cur := SYS.Dbms_Sys_Sql.open_cursor;
             SYS.Dbms_Sys_Sql.parse_as_user(
                   c => cur,
                   STATEMENT => plsql,
                   language_flag => DBMS_SQL.native,
                   userID => UID
          );
             rc := SYS.Dbms_Sys_Sql.EXECUTE(cur);

             SYS.Dbms_Sys_Sql.close_cursor(cur);
   END;
   /

 Procedure created.

SQL> EXEC Drop_DbLink( 'ALEE', 'LCNPDB_CRP' );
PL/SQL procedure successfully completed.


2) Procedure with delete all database links with single owner.
SQL> CREATE OR REPLACE PROCEDURE DropSchema_DbLinks(schemaName VARCHAR2 ) IS
    BEGIN
            FOR LINK IN(
                    SELECT
                            l.db_link
                    FROM    dba_db_links l
                    WHERE   l.owner = schemaName
            ) LOOP
                    Drop_DbLink(
                           schemaName => schemaName,
                           dbLink => LINK.db_link
                   );
           END LOOP;
   END;
   /

  Procedure created.

 SQL> EXEC dropschema_dblinks('ALEE');
 PL/SQL procedure successfully completed.

As conclusion, in order to drop private db_link is require for owner password and now we have another way to drop db links using procedures. It is consider very efficient and good to handle.

Thursday, July 30, 2015

Connect to Oracle Database through JDBC Thin/OCI Drivers


Yesterday, there was friend asked me about the jdbc connection. I have performed simple testing on his case.

The two most common methods of connecting to Oracle databases via JDBC are the Oracle Thin JDBC driver and the Oracle OCI JDBC driver.


Oracle JDBC Thin Driver Format - require Oracle JDBC driver jar file
Oracle JDBC Thin using a Service Name
jdbc:oracle:thin:@//<host>:<port>/<service_name>

Oracle JDBC Thin using an SID
jdbc:oracle:thin:@<host>:<port>:<SID>

Note: Support for SID is being phased out. Oracle recommends that users switch over to using service names.

Oracle JDBC Thin using a TNSName
jdbc:oracle:thin:@<TNSName>
Note: Support for TNSNames was added in the driver release 10.2.0.1

Oracle JDBC OCI Driver Format - require Oracle client software
jdbc:oracle:oci:@<database_name>

With the simple setup for his data source:
dataSource.url = jdbc:oracle:oci:@ADSBCPD or
dataSource.url = jdbc:oracle:thin:@AYSBDBS01:1621/ADSBCPD

The connection from his system to database was working pretty good.