Tuesday, August 14, 2018


Vagrant

C:\Users\njohi>vagrant box list


C:\Users\njohi\vagrant>mkdir project1

C:\Users\njohi\vagrant>cd project1

C:\Users\njohi\vagrant\project1>ls -ltr
'ls' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\njohi\vagrant\project1>dir
 Volume in drive C is OS
 Volume Serial Number is F21F-70F2

 Directory of C:\Users\njohi\vagrant\project1

08/14/2018  10:09 AM    <DIR>          .
08/14/2018  10:09 AM    <DIR>          ..
               0 File(s)              0 bytes
               2 Dir(s)  270,020,452,352 bytes free

C:\Users\njohi\vagrant\project1>vagrant init centos/7
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.

C:\Users\njohi\vagrant\project1>dir
 Volume in drive C is OS
 Volume Serial Number is F21F-70F2

 Directory of C:\Users\njohi\vagrant\project1

08/14/2018  10:11 AM    <DIR>          .
08/14/2018  10:11 AM    <DIR>          ..
08/14/2018  10:11 AM             3,085 Vagrantfile
               1 File(s)          3,085 bytes
               2 Dir(s)  269,974,601,728 bytes free

C:\Users\njohi\vagrant\project1>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'centos/7' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'centos/7'
    default: URL: https://vagrantcloud.com/centos/7
==> default: Adding box 'centos/7' (v1804.02) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/centos/boxes/7/versions/1804.02/providers/virtualbox.box
    default: Download redirected to host: cloud.centos.org
    default:
==> default: Successfully added box 'centos/7' (v1804.02) for 'virtualbox'!
==> default: Importing base box 'centos/7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/7' is up to date...
==> default: Setting the name of the VM: project1_default_1534267088297_30073
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Rsyncing folder: /cygdrive/c/Users/njohi/vagrant/project1/ => /vagrant

C:\Users\njohi\vagrant\project1>vagrant ssh
Last login: Tue Aug 14 17:24:42 2018
[vagrant@localhost ~]$ sudo su -
Last failed login: Tue Aug 14 17:21:52 UTC 2018 on tty1
There was 1 failed login attempt since the last successful login.
[root@localhost ~]# exit
logout
[vagrant@localhost ~]$ exit
logout

Connection to 127.0.0.1 closed.

Wednesday, February 28, 2018

How to Attach ORACLE_HOME and Recreate Central Inventory(oraInventory) In RDBMS Homes

[oracle@oracledbprod-ro oracle]$ pwd
/u01/oracle
[oracle@oracledbprod-ro oracle]$ cp -r oraInventory oraInventory_28Feb2018

[oracle@oracledbprod-ro bin]$ cd $ORACLE_HOME/oui/bin
[oracle@oracledbprod-ro bin]$ ls -ltr attachHome.sh
-rwxr-x--- 1 oracle oinstall 298 Apr 10  2012 attachHome.sh
[oracle@oracledbprod-ro bin]$ ./attachHome.sh &
[1] 28599
[oracle@oracledbprod-ro bin]$ ./attachHome.sh: line 5: cd: /u01/oracle/software/product/11.2.3/test/oui/bin: No such file or directory
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 32763 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/oracle/oraInventory
'AttachHome' was successful.

[1]+  Done                    ./attachHome.sh



[oracle@oracledbprod-ro bin]$ $ORACLE_HOME/OPatch/opatch lsinventory -all
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/oracle/software/product/11.2.3/devro
Central Inventory : /u01/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/oracle/software/product/11.2.3/devro/cfgtoollogs/opatch/opatch2018-02-28_06-28-43AM.log

List of Homes on this system:

  Home name= OraDb11g_home1, Location= "/u01/oracle/software/product/11.2.0/test"
  Home name= OraDb11g_home2, Location= "/u01/oracle/software/product/11.2.0/oracle"
  Home name= OraDb11g_home3, Location= "/u01/oracle/software/product/11.2.3/infra"
  Home name= OraDb11g_home4, Location= "/u01/oracle/software/product/11.2.3/oracle"
  Home name= OraDb11g_home6, Location= "/u01/oracle/software/product/112035/oracle"
  Home name= OraDb11g_home7, Location= "/u04/oracle/software/product/11.2.0.4"
  Home name= OraHome1, Location= "/u01/oracle/ogghome/12.2"
  Home name= OraDb11g_home5, Location= "/u01/oracle/software/product/11.2.3/test"
Inventory load failed... OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
   Oracle Home dir. path does not exist in Central Inventory
   Oracle Home is a symbolic link
   Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo



[oracle@oracledbprod-ro bin]$ more /etc/oraInst.loc
inventory_loc=/u01/oracle/oraInventory
inst_group=oinstall


[oracle@oracledbprod-ro bin]$ echo $ORACLE_HOME
/u01/oracle/software/product/11.2.3/devro
[oracle@oracledbprod-ro bin]$ echo $ORACLE_HOME_NAME

[oracle@oracledbprod-ro bin]$ ./runInstaller -silent -ignoreSysPrereqs -attachHome ORACLE_HOME="/u01/oracle/software/product/11.2.3/devr                                o" ORACLE_HOME_NAME="devro"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 32763 MB    Passed
The inventory pointer is located at /etc/oraInst.loc
The inventory is located at /u01/oracle/oraInventory
'AttachHome' was successful.
[oracle@oracledbprod-ro bin]$ $ORACLE_HOME/OPatch/opatch lsinventory -detail
Invoking OPatch 11.2.0.1.7

Oracle Interim Patch Installer version 11.2.0.1.7
Copyright (c) 2011, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/oracle/software/product/11.2.3/devro
Central Inventory : /u01/oracle/oraInventory
   from           : /etc/oraInst.loc
OPatch version    : 11.2.0.1.7
OUI version       : 11.2.0.3.0
Log file location : /u01/oracle/software/product/11.2.3/devro/cfgtoollogs/opatch/opatch2018-02-28_06-35-07AM.log

Lsinventory Output file location : /u01/oracle/software/product/11.2.3/devro/cfgtoollogs/opatch/lsinv/lsinventory2018-02-28_06-35-07AM.t                                xt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.3.0
There are 1 products installed in this Oracle Home.


Installed Products (124):

Agent Required Support Files                                         10.2.0.4.3
Assistant Common Files                                               11.2.0.3.0
Bali Share                                                           1.1.18.0.0
Buildtools Common Files                                              11.2.0.3.0
Character Set Migration Utility                                      11.2.0.3.0

Thursday, January 18, 2018

TEMP Tablespace Users Usage

select username,sum(blocks*16384)/1048576 MB from gv$sort_usage group by username;

Table Level Privileges

Table Level Privileges

select owner, table_name, privilege, grantee from dba_tab_privs where owner='EBS_OBJ'
and table_name in ('SUBSCRIPTION_AGREEMENTS','SUBSCRIPTION_ITEMS') and grantee = 'CDS_MIGRATOR_USR';

OWNER                          TABLE_NAME                     PRIVILEGE                                GRANTEE
------------------------------ ------------------------------ ---------------------------------------- -------------------
EBS_OBJ                        SUBSCRIPTION_AGREEMENTS        SELECT                                   CDS_MIGRATOR_USR
EBS_OBJ                        SUBSCRIPTION_ITEMS             SELECT                                   CDS_MIGRATOR_USR

User Creation(Mirror Ram Account)

select username,DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE,PROFILE  from dba_users where username like upper('ram');
 
USERNAME                       DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE           PROFILE
------------------------------ ------------------------------ ------------------------------ ------------------------------
RAM                       USERS                          TEMP                           SECURITY
 
CREATE USER seetha IDENTIFIED BY welcome#1 DEFAULT TABLESPACE USERS TEMPORARY TABLESPACE temp quota unlimited on USERS PROFILE SECURITY;
 
 
 
nram> select * from dba_role_privs where grantee=upper('ram');
How to Determine the SQL_ID for a SQL Statement


How to identify the SQL_ID of a statement:

The SQL_ID of a statement can be found in an AWR or ASH report or by selecting it from the database data dictionary using the V$SQL view. 

If the SQL can be identified with a particular identifiable string or by some kind of unique comment such as: /* TARGET SQL */ then this will make it easier to locate. 

For Example:

SELECT /* TARGET SQL */ * FROM dual;

SELECT sql_id, plan_hash_value, substr(sql_text,1,40) sql_text  
FROM  v$sql 
WHERE sql_text like 'SELECT /* TARGET SQL */%'

SQL_ID        SQL_TEXT
------------- ----------------------------------------
0xzhrtn5gkpjs SELECT /* TARGET SQL */ * FROM dual

The hash_value is included here for convenience. You can also find the SQL_ID in the V$SQL view using a substitution variable:

SELECT sql_id, plan_hash_value, SUBSTR(sql_text,1,40) Text
FROM v$sql
WHERE sql_text LIKE '%&An_Identifiable_String%';
If SQL is not available in v$sql, DBA_HIST_SQLTEXT and DBA_HIST_SQLSTAT can be used:


select t.sql_id,
    t.sql_text,
    s.executions_total,
    s.elapsed_time_total
from DBA_HIST_SQLSTAT s, DBA_HIST_SQLTEXT t
where s.snap_id between 333 and 350;   <====use snapid in which the query was ran

Tuesday, January 16, 2018

How do you change the SYSADMIN password?

1. Keep all services running.
2. Login via the OS level by way of the applmgr user.
3. Run your environment scripts
    a. cd $APPL_TOP
    b. run APPSORA.env
    c. the above should also run <sid>_<node>.env, but you can verify by running it.
    d. cd admin
    e. run adovars.env
4. cd $FND_TOP/bin
5. Run FNDCPASS to change the SYSADMIN password 
(IMPORTANT: Change ONLY the SYSADMIN password) 
FNDCPASS apps/apps 0 Y system/manager USER SYSADMIN <New Password> 
6. Restart the Apache, Forms, Reports, 8.0.6 listener and concurrent manager services. 
7. To test, login into the applications as the SYSADMIN user and the new password. 
8. Verify that a concurrent program such as Active Users runs.

Critical Patch Updates:


Critical Patch Updates are collections of security fixes for Oracle products. They are available to customers with valid support contracts. They are released on the Tuesday closest to the 17th day of January, April, July and October. The next four dates are:
  • 16 January 2018
  • 17 April 2018
  • 17 July 2018
  • 16 October 2018
CPU Cumulative:

Oracle tries to make Critical Patch Updates cumulative; that is each Critical Patch Update contains the security fixes from all previous Critical Patch Updates. In practical terms, for those products that receive cumulative fixes, the latest Critical Patch Update is the only one that needs to be applied when solely using these products, as it contains all required fixes.

select * from sys.registry$history;

ACTION_TIME                         ACTION                         NAMESPACE                      VERSION                 ID COMMENTS
----------------------------------- ------------------------------ ------------------------------ --------------- ---------- ----------------------------------------
31-AUG-12 05.04.39.313477 PM        VIEW INVALIDATE                                                                  8289601 view invalidation
31-AUG-12 05.04.39.610749 PM        UPGRADE                        SERVER                         11.2.0.3.0                 Upgraded from 11.2.0.1.0


Thank you, Ram

Google, Mozilla, and Apple choosing to no longer support Entrust as a publicly trusted certificate authority

Google, Mozilla, and Apple have all decided to stop trusting Entrust’s publicly issued certificates after specific cutoff dates , due to lon...