Monday, August 4, 2014

XE DB:ORACLE Initialization or shutdown in progress

Open Dos command Prompt
c:> sqlplus /nolog
sql> connect sys/manager as sysdba
sql>shutdown immediate
sql> startup
sql> exit

you might get an error while start up i.e.
 ORA-00333: redo log read error block *Number* count *Number*

Step 1: As the Db is in mount mode, We can query v$log & v$logfile to identify the status of log file group and their member.

 SQL> select l.status, member from v$logfile inner join v$log l using (group#); 
 STATUS  MEMBER
 ------------- --------------------------------------
 CURRENT /oracle/fast_recovery_area/redo01.log
 INACTIVE /oracle/fast_recovery_area/redo02.log
 INACTIVE /oracle/fast_recovery_area/redo03.log

 
Step 2: Recover the database using ackup controlfile.

 SQL> recover database using backup controlfile;
ORA-00279: change  generated at  needed for thread 1
ORA-00289: suggestion : /oracle/fast_recovery_area/archivelog/o1_mf_1_634_%u_.arc
ORA-00280: change  for thread 1 is in sequence #
Specify log: {=suggested | filename | AUTO | CANCEL}


Step3: Give 'CURRENT' log file member along with location as input. If it does not work give other log file members along with location in input prompt. In our case we give 
/oracle/fast_recovery_area/redo01.log
Log applied.
Media recovery complete.


Step 4: Open the database with reset logfile

SQL> alter database open resetlogs;
Database altered.



References :
https://community.oracle.com/thread/340394?tstart=0
http://shaharear.blogspot.in/2013/06/recover-database-from-ora-00333-redo.html

Tuesday, April 15, 2014

PL/SQL vs SQL

FUNCTION getenames(deptno_in IN emp.deptno%type) RETURN VARCHAR2
IS
  TYPE enames_aa IS TABLE OF emp.ename%type INDEX BY pls_integer;
  l_returnvalue VARCHAR2(32767) := '';
  l_enames enames_aa;
BEGIN
  SELECT e.ename
    BULK COLLECT INTO l_enames
    FROM emp e
   WHERE e.deptno = deptno_in
   ORDER BY e.ename ASC NULLS FIRST;
  IF l_enames.count > 0 THEN
    FOR indx IN 1 .. l_enames.count LOOP
      l_returnvalue := l_returnvalue || l_enames(indx) || ',';
    END LOOP;
  END IF;
  l_returnvalue := rtrim(l_returnvalue, ',');
  RETURN l_returnvalue;
END;
 
 
SQL:
 
SELECT d.dname, getenames(d.deptno) enames
  FROM dept d
 
Result:
 
DNAME ENAMES
-------------- ----------------------------------------------------------------------
ACCOUNTING CLARK,KING,MILLER
RESEARCH ADAMS,FORD,JONES,SCOTT,SMITH
SALES ALLEN,BLAKE,JAMES,MARTIN,TURNER,WARD
OPERATIONS
 
 
New SQL:
SELECT d.dname, (SELECT listagg(e.ename, ',') WITHIN GROUP(ORDER BY e.ename)
                   FROM emp e
                  WHERE 1=1
                    AND e.deptno = d.deptno
                ) enames
  FROM dept d
 
 
 

Wednesday, April 9, 2014

Jdeveloper Performance



The following settings will increase the performance of your JDeveloper 11g.
Go to your JDeveloper root directory (JDEVELOPER_HOME/jdeveloper)
Open the file ide/bin/ide.conf, and change memory settings to something larger, like so:
AddVMOption -Xmx1024M
AddVMOption -Xms1024M

Open the file jdev/bin/jdev.conf, and increase the value of MaxPermSize:
AddVMOption -XX:MaxPermSize=512M
Add the following settings at the bottom.
# optimize the JVM for strings / text editing
AddVMOption -XX:+UseStringCache
AddVMOption -XX:+OptimizeStringConcat
AddVMOption -XX:+UseCompressedStrings

# if on a 64-bit JVM, but using less than 32 GB RAM, this reduces object pointer memory size
AddVMOption -XX:+UseCompressedOops
# use an aggressive garbage collector (constant small collections)
AddVMOption -XX:+AggressiveOpts
# for multi-core machines, use multiple threads to create objects and reduce pause times
AddVMOption -XX:+UseConcMarkSweepGC
# to activate memory monitor
AddVMOption -DMainWindow.MemoryMonitorOn=true

Open the file jdev/bin/jdev.boot, and remove the # before VFS_ENABLE property.
#
# This will enable a "virtual" file system feature within JDeveloper.
# This can help performance for projects with a lot of files,
# particularly under source control. For non-Windows platforms however,
# any file changes made outside of JDeveloper, or by deployment for
# example, may not be picked by the "virtual" file system feature. Do
# not enable this for example, on a Linux OS if you use an external editor.
#
VFS_ENABLE = true

Go to your user root directory.
On a Linux OS, open the file .jdeveloper/system11.1.1.7.xx.xx.xx/DefaultDomain/bin/setDomainEnv.sh.
On Windows OS, open the file AppData\Roaming\JDeveloper\system11.1.1.7.xx.xx.xx\DefaultDomain\bin\setDomainEnv.cmd.
Change memory settings to something larger, like so:
set XMX_SUN_64BIT=1024
set XMX_SUN_32BIT=1024




Thanks to Waslley Leandro de Souza

http://waslleysouza.com.br/en/2014/04/increase-the-performance-of-jdeveloper-11g/

Thursday, March 13, 2014

Webcenter Portlet Custom Skin/css retaining


You might have developed an ADF app with your own cutome Skins/css.

Then you want to access this ADF app as a WSRP portlet in Webcenter portal. By, default, you will loose all your custom skins/css.

If you like to retain your custom Skin/css, please add following information to portlet.xmlfile

  <init-param>
            <name>org.apache.myfaces.trinidad.skin.id</name>
            <value><ID of skin mentioned in trinidad-skin.xml file ></value>
        </init-param>


Note: portlet.xml file is generated by JDeveloper when you right click a JSPX and created Portlet.


Reference
http://aboo-oracle.blogspot.in/2012/11/webcenter-portal-skincss-retaining.html

PuTTy and Xming is making an SSH connection with X11 forwarding

There are several ways to run a GUI application under Linux. What you are trying to accomplish using PuTTy and Xming is making an SSH connection with X11 forwarding. 

Xming, running under Microsoft Windows, is a X Window server, which like any X Window server must connect directly to your local mouse and display. When you establish a SSH session with X11 forwarding, you are intercepting the local X11 protocol on the remote client (Linux server) and send it to your local X Window server running on your PC Desktop. 

For X11 forwarding to work, you do NOT need to install the X Window server on the Linux system, but you need the appropriate authentication package and setup SSH access on the Linux server with X11 forwarding. Both should be installed by default. If not:

# yum install openssh-server xorg-x11-xauth xorg-x11-apps
You start the Xming X server on your Windows PC, then open PuTTy to establish a SSH session with X11 forwarding. PuTTy will pass the X11 protocol to Xming for processing and user interaction. You need to configure PuTTy for X11 forwarding as mentioned in the previous response. When starting a X client application on the remote server it will display on your local screen. 

Alternatively, you can install MobaXterm, which is based on CYGWin and combines a X Window server and SSH client in one single application, which might be a more convenient solution. You can download a free version of MobaXterm from the Internet. 

Keep the following about SSH with X11 forwarding in mind:
- SSH automatically configures the necessary X11 environment variables such as DISPLAY.
- It requires TCP port 22 enabled on the firewall (Linux default). X11 is tunneled through the SSH session.
- It does not use xhost authentication. 
- You cannot use su to connect as another user after the initial connection. It will break xauth authentication.