Friday, June 27, 2014

Backing Up Control Files


Use the ALTER DATABASE BACKUP CONTROLFILE statement to back up your control files. You have two options:

    Back up the control file to a binary file (duplicate of existing control file) using the following statement:

    ALTER DATABASE BACKUP CONTROLFILE TO '/oracle/backup/control.bkp';


    Produce SQL statements that can later be used to re-create your control file:

    ALTER DATABASE BACKUP CONTROLFILE TO TRACE;

    This command writes a SQL script to a trace file where it can be captured and edited to reproduce the control file. View the alert log to determine the name and location of the trace file.

Monday, June 23, 2014

Soalrs/Oracle: Out of memory to start up Oracle DB instance

SQL> startup
ORA-27102: out of memory
SVR4 Error: 22: Invalid argument

# cat /etc/project

Create new project for user oracle
# projadd -U oracle -K "project.max-shm-memory=(priv,16GB,deny)" user.oracle

or Modify existing prjoect
# projmod -s -K "project.max-shm-memory=(priv,16GB,deny)" user.oracle
  user.oracle

Activate user.oracle
# newtask -v -p user.oracle

# prctl -i project user.oracle

Restart the database instance
$ prctl -i project user.oracle                                                                                                    
project: 100: user.oracle                                                                                                                              
NAME    PRIVILEGE       VALUE    FLAG   ACTION                       RECIPIENT                                                                           
project.max-contracts                                                                                                                                    
        privileged      10.0K       -   deny                                 -                                                                           
        system          2.15G     max   deny                                 -                                                                           
project.max-locked-memory                                                                                                                                
        usage           1.52GB                                                                                                                           
        system          16.0EB    max   deny                                 -                                                                           
project.max-port-ids                                                                                                                                     
        privileged      8.19K       -   deny                                 -                                                                           
        system          65.5K     max   deny                                 -                                                                           
project.max-shm-memory                                                                                                                                   
        privileged      16.0GB      -   deny                                 -                                                                           
        system          16.0EB    max   deny                                 -                                                                           
project.max-shm-ids                                                                                                                                      
        privileged        128       -   deny                                 -                                                                           
        system          16.8M     max   deny                                 -                                                                           
project.max-msg-ids                                                                                                                                      
        privileged        128       -   deny                                 -                                                                           
        system          16.8M     max   deny                                 -                                                                           
project.max-sem-ids                                                                                                                                      
        privileged        128       -   deny                                 -                                                                           
        system          16.8M     max   deny                                 -                                                                           
project.max-crypto-memory                                                                                                                                
        usage               0B                                                                                                                           
        privileged      15.7GB      -   deny                                 -                                                                           
        system          16.0EB    max   deny                                 -                                                                           
project.max-tasks                                                                                                                                        
        usage               1                                                                                                                            
        system          2.15G     max   deny                                 -                                                                           
project.max-processes                                                                                                                                    
        usage              20                                                                                                                            
        system          2.15G     max   deny                                 -                                                                           
project.max-lwps                                                                                                                                         
        usage              59                                                                                                                            
        system          2.15G     max   deny                                 -                                                                           
project.cpu-cap                                                                                                                                          
        usage               0
        system          4.29G     inf   deny                                 -
project.cpu-shares
        usage               1
        privileged          1       -   none                                 -
        system          65.5K     max   none                                 -
zone.max-lofi
        usage               0
        system          18.4E     max   deny                                 -
zone.max-swap
        usage           27.5GB
        system          16.0EB    max   deny                                 -
zone.max-locked-memory
        usage           15.7GB
        system          16.0EB    max   deny                                 -
zone.max-shm-memory
        system          16.0EB    max   deny                                 -
zone.max-shm-ids
        system          16.8M     max   deny                                 -
zone.max-sem-ids
        system          16.8M     max   deny                                 -
zone.max-msg-ids
        system          16.8M     max   deny                                 -
zone.max-processes
        usage             394
        system          2.15G     max   deny                                 -
zone.max-lwps
        usage           5.21K
        system          2.15G     max   deny                                 -
zone.cpu-cap
        usage               0
        system          4.29G     inf   deny                                 -
zone.cpu-shares
        usage               1
        privileged          1       -   none                                 -
        system          65.5K     max   none                                 -

Thursday, June 12, 2014

Javascript Multiple Selection

<!DOCTYPE html>
<html>
<script>
function change_value(){
alert("checking point");
if (document.getElementById('11307').value != null) {
  var eMulti = document.getElementById("11307");
  for (var i=0; i< eMulti.options.length; i++) {
    if (eMulti.options[i].selected ==true) {
      document.getElementById('def').value = eMulti.options[i].value +'@@' ;
    }}
} else {
  document.getElementById('def').value = "abc is blank." ;
}

}
</script>
<body>

<input id="def" type='text' value="Intiated!" />


<select id="11307" name="cars" multiple>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

<button onclick="change_value()">Try it</button>




<p>Hold down the Ctrl (windows) / Command (Mac) button to select multiple options.</p>

</body>
</html>

Wednesday, June 11, 2014

Oracle: do not have sufficient permissions to access the inventory

 Problem:

$./runInstaller
You do not have sufficient permissions to access the inventory '/usr2/app/oracle/product/10.1.2.0.2/ias/inventory'. Installation cannot continue. Make sure that you have read/write permissions to the inventory directory and restart the installer.: Permission denied

Solution:

rename /var/opt/oracle/oraInst.loc to oraInst.loc.backup

Monday, June 9, 2014

USING TWO_TASK, LOCAL, AND ORACLE_SID WHEN INSTALLING ORACLE APPLICATIONS (Doc ID 1020395.102)

Problem Description
-------------------
 
You are installing Release 11 Oracle Applications and are reading Oracle
Applications Installation Release 11 for UNIX manual on page 2-10, step 13.
The manual says to "verify $ORACLE_HOME, $ORACLE_SID, and $TWO_TASK."  
You are looking for an explanation on the difference between specifying 
$ORACLE_SID and $TWO_TASK. 
 

Problem Explanation
-------------------

Depending on where the database server will be located in relation to the
Oracle Applications, $ORACLE_SID and $TWO_TASK need to be set correctly.  
Otherwise, installation utilities such as ADAIMGR (Autoinstall) will fail due 
to failed connections to the database.


Solution Description
--------------------

If you are connecting or using a database on the same machine and the 
database exists at where the $ORACLE_HOME environment variable points to,
then specify $ORACLE_SID.

Specify $TWO_TASK if you are connecting to a database that exists on another
machine or if you have a server-partitioned installation (database exists 
on the same machine, but at a location other than where $ORACLE_HOME points to).
You should also specify $ORACLE_SID, but it will be treated as a comment and 
the value will not be used.
 

Solution Explanation
--------------------
 
Specifying $ORACLE_SID causes all Applications utilities to use the oracle
executable that exists in $ORACLE_HOME.  If the database does not exist at the
location, the connection will not be made and the process will fail.  This 
method is only possible when database exists on the same machine.

Specifying $TWO_TASK causes all Applications utilities to use the value
of $TWO_TASK and use it as a SQLNET connect string.  Therefore, if your database
exists on a different machine and must go through SQLNET to connect to it,
it is required that you specify $TWO_TASK.  The same holds true if you will be
installing Oracle Applications using Server-Partitioning.  In this case, the 
Oracle database does not exist at the location where $ORACLE_HOME points
to.  Therefore, the connection must go through SQLNET.  This configuration
requires the use of $TWO_TASK.

If you specify both $ORACLE_SID and $TWO_TASK, $TWO_TASK will take precedence.
Therefore, if everything is located on one machine, you need not set the 
$TWO_TASK environment variable.  Use "unset $TWO_TASK" command to remove the
variable completely.  Do not set the value to null.  Setting the value to null
will cause ad utilities to core dump when executed.

Oracle: Grant Select Privileges on tables to another user.

set feedback off
set trimspool on
set pagesize 10000
set linesize 1000
set heading off

spool doit.sql
select 'grant select on '||owner||'.'||table_name||' to articy;' from all_tables where owner = 'GOWEEKEND';
spool off

Tuesday, June 3, 2014

RDPS to connect to Windows machine from Linux

Connect to console:
rdps -g 90% odesign -0

Connect to regular terminal
rdps -g 90% odesign