Thursday, May 17, 2012

application express installation -http server option

1. configure apex on oracle database installation.
cd $ORACLE_HOME/Apex/bin
sqlplus / as sysdba
sqlplus > @apxchpwd   # change admin password
sqlplus > alter user apex_public_user account unlock
sqlplus > password apex_public_user
2. download oracle http server
#current it is available from version 11.2.0.1 as oracle fussion medtier.
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html
3. install http server
./runInstaller     # install software only
4. configure http server
WebTier_ORAcLE_OME/bin/config.sh #don't select "associate to a domain' if you don't have a domain setup
5. load the mod_plsql module
vi WebTier_ORAcLE_OME/instances/instance1/config/OHS/ohs1/httpd.conf
add
   LoadModule plsql_module "${ORACLE_HOME}/ohs/modules/mod_plsql.so" 
   include /u01/app/oracle/product/11.1.1/ofm/Oracle_WT1/ohs/conf/mod_plsql/*.conf
6. configure dads.conf file
vi /u01/app/oracle/product/11.1.1/ofm/Oracle_WT1/ohs/conf/mod_plsql/dads.conf
add
Alias   /i/               "/u01/app/oracle/product/4.0.2/apex/images/" 
AddType text/xml          xbl 
AddType text/x-component  htc 
   
<Location /pls/apex> 
Order                          deny,allow 
PlsqlDocumentPath              docs 
AllowOverride                  None 
PlsqlDocumentProcedure         wwv_flow_file_manager.process_download 
PlsqlDatabaseConnectString     localhost:1521:XE ServiceNameFormat 
PlsqlNLSLanguage               AMERICAN_AMERICA.AL32UTF8 
PlsqlAuthenticationMode        Basic 
SetHandler                     pls_handler 
PlsqlDocumentTablename         wwv_flow_file_objects$ 
PlsqlDatabaseUsername          APEX_PUBLIC_USER 
PlsqlDefaultPage               apex 
PlsqlDatabasePassword          parsingschemapasswd 
PlsqlRequestValidationFunction wwv_flow_epg_include_modules.authorize 
Allow from all 
</Location>

7. stop and start http server
/u01/app/oracle/product/11.1.1/ofm/Oracle_WT1/instances/instance1/bin/opmnctl stopproc ias-component=ohs1
/u01/app/oracle/product/11.1.1/ofm/Oracle_WT1/instances/instance1/bin/opmnctl startproc ias-component=ohs1
8. access application express at https://hostname:4443/pls/apex


reference:
http://docs.oracle.com/cd/B28359_01/install.111/b28264/apex.htm
http://www.warp11.nl/2011/05/fully-freeware-apex-environment-vii-oracle-http-server-configuration/
http://docs.oracle.com/cd/E23903_01/doc/doc.41/e21673/otn_install.htm#BABEGAEJ

ARC1: Error 19809 - ORA-19809 or ORA-00257


Following error message appears in alert log file:

   then consider changing RMAN ARCHIVELOG DELETION POLICY.
2. Back up files to tertiary device such as tape using RMAN
   BACKUP RECOVERY AREA command.
3. Add disk space and increase db_recovery_file_dest_size parameter to
   reflect the new space.
4. Delete unnecessary files using RMAN DELETE command. If an operating
   system command was used to delete files, then use RMAN CROSSCHECK and
   DELETE EXPIRED commands.
************************************************************************
ARC1: Error 19809 Creating archive log file to '+DATA'
or in ohs1.log for fusion middle tier

How to solve ORA-00257 archiver error. Connect internal only, until freed.


Root cause: flash recovery area is full.

solution: you need delete files from flash recovery area through rman. If you delete them through os, you need run rman crosscheck and delete expired.

Concern: good thing is flash recovery will prevent database from using up all disk space when something wrong happens. So os or other applcation will not be affected by database issue. Bad thing is flash recovery area is always less than availabe disk in server. it will generate more database freeze because of the small buffer size.

check flash recovery area usage:

set lines 100
col name format a60
select name
, floor(space_limit / 1024 / 1024) "Size MB"
, ceil(space_used  / 1024 / 1024) "Used MB"
from v$recovery_file_dest
order by name
/
delete archive log through rman:
rman> delete archivelog until time 'trunc(sysdate -1)'

reference:

Tuesday, May 8, 2012

set up putty key login


1. generate key pair from server side or from putty side
   ssh-keygen
2. put public key into serverside
    cat id_rsa.pub >> ~/.ssh/authorized_keys2
    remove your email from the end.
   
3. set up putty session with private key.


reference:
http://www.howtoforge.com/how-to-configure-ssh-keys-authentication-with-putty-and-linux-server-in-5-quick-steps

Monday, May 7, 2012

disable/enable oracle option.

1. look at current options
  select * from v$option;

2. in oracle home bin
   shutdown  all database
  chopt enable partitioning
   start  all database.

this will relink oracle binary. 


reference:
http://www.liberidu.com/blog/2010/05/30/enabling-and-disabling-database-options/

Friday, May 4, 2012

install cloud control management agent

1. create software package.
 this must be done on OMS server
$<OMS_HOME>/bin/emcli login -username=sysman -password=<password>
$<OMS_HOME>/bin/emcli sync
$<OMS_HOME>/bin/emcli get_supported_platforms
./emcli get_agentimage -destination=/tmp -platform="Linux x86" -version=12.1.0.1.0
2. transfer the file to destinated host
3. unzip it
4. edit agent.rsp file
EM_INSTALL_TYPE="AGENT"
OMS_HOST="test.test.com"
EM_UPLOAD_PORT="4889"
AGENT_REGISTRATION_PASSWORD="test"
AGENT_INSTANCE_HOME="/u01/app/oem12c"
AGENT_PORT="1830"
ORACLE_HOSTNAME="test1.test.com"
s_agentHomeName="agent12gR1"
s_agentServiceName="Oracleagent12gR1agent"


5. run deploy command
./agentDelopy AGENT_BASE_DIR=/u01/app/oem12c RESPONSE_FILE=/u01/app/oem12c/stage/agent.rsp

reset password with value

This methods is used to clone user with the same password or reset user to same password to clear account expired status.

select dbms_metadata.get_ddl('USER','TEST') from dual;

CREATE USER "TEST" IDENTIFIED BY VALUES 'S:C0ACFA8BB332DAA8ACF469B7C9F2AB07623B3C5358DB1ABCE05C1FCE057E;BDCFAC041379F0D9'
      DEFAULT TABLESPACE "USERS"
      TEMPORARY TABLESPACE "TEMP"
quota unlimited on users;
grant resource, connect, test_profile to test;

alter user coskan identified by  VALUES 'S:1F0648E7E665F0A0EE44B1E9BD4B626A77CA25B376A49177F9E97DF98BFA;26EB15F771A78542';

select password,spare4 from user$ where name='U';
alter system set sec_case_sensitive_logon=true;

S:1F0648E7E665F0A0EE44B1E9BD4B626A77CA25B376A49177F9E97DF98BFA -- for sensitive
26EB15F771A78542 -- for non-sensitive

if set up only non-sensitive, sec_case_sensitive_logon=true will not work.