Monday, November 30, 2015

Granting select privilege for owner' all tables to others

[oracle@PTUD-S07 ~]$ cat a.sql
select 'GRANT SELECT ON OCDM_SYS.'||Table_Name||' TO OCDM_REPORT;' from All_Tables where owner='OCDM_SYS';
[oracle@PTUD-S07 ~]$ sqlplus / as sysdba @a.sql >> b.sql &
[3] 28402
[oracle@PTUD-S07 ~]$ cat b.sql | grep 'GRANT SELECT ON' >> c.sql
[oracle@PTUD-S07 ~]$ sqlplus / as sysdba @c.sql

Resize your Oracle datafiles down to the minimum without ORA-03297

Read it: http://blog.dbi-services.com/resize-your-oracle-datafiles-down-to-the-minimum-without-ora-03297/



set linesize 1000 pagesize 0 feedback off trimspool on
with
 hwm as (
  -- get highest block id from each datafiles ( from x$ktfbue as we don't need all joins from dba_extents )
  select /*+ materialize */ ktfbuesegtsn ts#,ktfbuefno relative_fno,max(ktfbuebno+ktfbueblks-1) hwm_blocks
  from sys.x$ktfbue group by ktfbuefno,ktfbuesegtsn
 ),
 hwmts as (
  -- join ts# with tablespace_name
  select name tablespace_name,relative_fno,hwm_blocks
  from hwm join v$tablespace using(ts#)
 ),
 hwmdf as (
  -- join with datafiles, put 5M minimum for datafiles with no extents
  select file_name,nvl(hwm_blocks*(bytes/blocks),5*1024*1024) hwm_bytes,bytes,autoextensible,maxbytes
  from hwmts right join dba_data_files using(tablespace_name,relative_fno)
 )
select
 case when autoextensible='YES' and maxbytes>=bytes
 then -- we generate resize statements only if autoextensible can grow back to current size
  '/* reclaim '||to_char(ceil((bytes-hwm_bytes)/1024/1024),999999)
   ||'M from '||to_char(ceil(bytes/1024/1024),999999)||'M */ '
   ||'alter database datafile '''||file_name||''' resize '||ceil(hwm_bytes/1024/1024)||'M;'
 else -- generate only a comment when autoextensible is off
  '/* reclaim '||to_char(ceil((bytes-hwm_bytes)/1024/1024),999999)
   ||'M from '||to_char(ceil(bytes/1024/1024),999999)
   ||'M after setting autoextensible maxsize higher than current size for file '
   || file_name||' */'
 end SQL
from hwmdf
where
 bytes-hwm_bytes>1024*1024 -- resize only if at least 1MB can be reclaimed
order by bytes-hwm_bytes desc
/

Friday, November 27, 2015

Find users belongs to tablespace

select distinct owner from dba_segments where tablespace_name='DATA201502';



OWNER
------------------------------
CC_OWNER
CM_POS2
PAYMENT
VT_IT_TC_KM
PRIVILEGE_OWNER
MEDIATION
BCCS_GW
QLKD_BD

8 rows selected.

TABLESPACE USAGE

select a.TABLESPACE_NAME,
 a.BYTES bytes_used,
 b.BYTES bytes_free,
 b.largest,
 round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used
from  
 (
  select  TABLESPACE_NAME,
   sum(BYTES) BYTES 
  from  dba_data_files 
  group  by TABLESPACE_NAME
 )
 a,
 (
  select  TABLESPACE_NAME,
   sum(BYTES) BYTES ,
   max(BYTES) largest 
  from  dba_free_space 
  group  by TABLESPACE_NAME
 )
 b
where  a.TABLESPACE_NAME=b.TABLESPACE_NAME
order  by ((a.BYTES-b.BYTES)/a.BYTES) desc;

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
DATA201502         7748976640  372637696  372244480        95.19
DATA201507         8053063680  393281536  393216000        95.12
DATA201409         7874805760  385024000  384827392        95.11
TBS_CM_POS2         1499463680   74514432   74514432        95.03
DATA201504         7801405440  389939200  389939200    95
DATA201510   975175680   48758784   48234496    95
DATA201503         8482979840  427819008  267386880        94.96
DATA201509         1562378240   78970880   78643200        94.95
DATA201303         5452595200  278855680  270467072        94.89
DATA201506         8294236160  425852928  425721856        94.87
DATA201501         8797552640  454950912  454950912        94.83

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
DATA201412         8577351680  443940864  254803968        94.82
TBS_CC_OWNER         1709178880   89128960   89128960        94.79
DATA201411         7822376960  408485888  408485888        94.78
DATA201508         1530920960   80609280   80609280        94.73
SYSAUX    775946240   40960000   40894464        94.72
DATA201306         5903482880  313720832  305332224        94.69
DATA201304         5672796160  301596672  293208064        94.68
DATA201505         8304721920  443940864  443547648        94.65
DATA201305         6228541440  338493440  306184192        94.57
DATA          2.9496E+10 1613758464  884736000        94.53
MB_GPRS2015_Q2         1163919360   64225280   64225280        94.48

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
DATA201302         4047503360  224133120  215744512        94.46
DATA201410         8451522560  470548480  341573632        94.43
BILLING    870318080   49348608   49348608        94.33
DATA201408         8598323200  492961792  275775488        94.27
TBS_MEDIATION   188743680   11337728   11337728        93.99
QLKD_BD    471859200   38404096   38404096        91.86
DATA201407         9437184000  993198080  470614016        89.48
SYSTEM          3764387840  514064384  365953024        86.34
USERS    148111360   27525120 8388608        81.42
DATA201406         1.0454E+10 2388852736  526385152        77.15
DATA201405         9898557440 2401042432  478806016        75.74

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
DATA201401         9762242560 2418540544  495976448        75.23
DATA201402         9185525760 2297495552  555548672        74.99
DATA201312         9594470400 2411200512  488636416        74.87
DATA201403         1.0234E+10 2582708224  660471808        74.76
DATA201308         9468641280 2393440256  479199232        74.72
DATA201309         9489612800 2438397952  599785472  74.3
DATA201307         9468641280 2443378688  509607936  74.2
DATA201310         9500098560 2465267712  562036736        74.05
PAYMENT    419430400  109641728   14155776        73.86
DATA201404         9112125440 2432696320  570425344  73.3
DATA201311         9164554240 2467954688  605814784        73.07

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
TBS_USER   262144000  159514624  159514624        39.15
NGHIEPVU   104857600   84213760   78577664        19.69
TBS_BCCS_PAYMENT   10485760    9175040 9175040  12.5
POSPAID     10485760    9306112 9306112        11.25
ELOAD     10485760    9437184 9437184    10
ISDN_OWNER    10485760    9437184 9437184    10
CS_OWNER    10485760    9437184 9437184    10
PREPAID_DATA_VAS_201505   10485760    9437184 9437184    10
PREPAID_DATA_VAS_201506   10485760    9437184 9437184    10
PREPAID_DATA_VAS_201507   10485760    9437184 9437184    10
PRE_201508    10485760    9437184 9437184    10

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
PREPAID_CALL_VAS_201510   10485760    9437184 9437184    10
BILL_TEST    10485760    9437184 9437184    10
MEDIATION_201405   10485760    9437184 9437184    10
PROVISION    10485760    9437184 9437184    10
TBS_CC_DB    10485760    9437184 9437184    10
CALL_DETAIL_201506   10485760    9437184 9437184    10
PRE_201507    10485760    9437184 9437184    10
CALL_DETAIL_201507   10485760    9437184 9437184    10
CALL_DETAIL_201508   10485760    9437184 9437184    10
CALL_DETAIL_201511   10485760    9437184 9437184    10
DATA201301    10485760    9437184 9437184    10

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
SM_OWNER    10485760    9437184 9437184    10
UNDOTBS4    10485760    9437184 9437184    10
BEELINE     10485760    9437184 9437184    10
DATA_CM_PRE2    10485760    9437184 9437184    10
MB_GPRS2015_Q1    10485760    9437184 9437184    10
DATA2010    10485760    9437184 9437184    10
TBS_BCCS_VSA_V3    10485760    9437184 9437184    10
CUS_OWNER    10485760    9437184 9437184    10
BCCS_VSA_V3    10485760    9437184 9437184    10
UNDOTBS3    10485760    9437184 9437184    10
PREDB_OWNER    10485760    9437184 9437184    10

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
TBS_CM_PRE2    10485760    9437184 9437184    10
PRE_201511    10485760    9437184 9437184    10
CDR_OWNER    10485760    9437184 9437184    10
TTUSERS     10485760    9437184 9437184    10
PRE_VTC     10485760    9437184 9437184    10
PREPAID_CALL_VAS_201506   10485760    9437184 9437184    10
PREPAID_CALL_VAS_201507   10485760    9437184 9437184    10
CALL_DETAIL_201509   10485760    9437184 9437184    10
CALL_DETAIL_201510   10485760    9437184 9437184    10
DATA201511    10485760    9437184 9437184    10
PRE_201509    10485760    9437184 9437184    10

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
PREPAID_CALL_VAS_201511   10485760    9437184 9437184    10
UNDOTBS2    10485760    9437184 9437184    10
DATA2011    10485760    9437184 9437184    10
DATA2012    10485760    9437184 9437184    10
TBS_BCCS_IM    10485760    9437184 9437184    10
PRE_201506    10485760    9437184 9437184    10
PRE_201510    10485760    9437184 9437184    10
RATING     10485760    9437184 9437184    10
TBS_BILLING_IMPORT   10485760    9437184 9437184    10
TBS_TIMESTEN    10485760    9437184 9437184    10
DATA2008    10485760    9437184 9437184    10

TABLESPACE_NAME         BYTES_USED BYTES_FREE LARGEST PERCENT_USED
------------------------------ ---------- ---------- ---------- ------------
DATA2009    10485760    9437184 9437184    10
SEC_ADMIN    10485760    9437184 9437184    10
RESTORE_PRE    10485760    9437184 9437184    10
BCCS_RATING   262144000  248119296  232456192  5.35
UNDOTBS1         2825912320 2686124032 1101004800  4.95
PREPAID_DATA_VAS_201511  104857600  103809024  103809024     1
PREPAID_DATA_VAS_201508  104857600  103809024  103809024     1
PREPAID_DATA_VAS_201509  104857600  103809024  103809024     1
PREPAID_DATA_VAS_201510  104857600  103809024  103809024     1

108 rows selected.

Wednesday, November 25, 2015

How to backup, restore BI Publisher 11G

Backup

Backup Fusion Middleware Directory

For Example:
[oracle@App1 fmw]$ cd /u01/app
[oracle@App1 app]$ ls
backup  fmw  obiee_home  oracle  p6
[oracle@App1 app]$ cp -R fmw/ fmw_bak


Backup Database:

Contact DBA to do that. Backup 2 schemas (For Example: dev_biplatform, dev_mps) which created by RCU.

Restore

Restore Fusion Middleware Directory:

[oracle@App1 app]$ cp –R fmw_bak fmw


How to switch from ‘Oracle Fusion Middleware’ to ‘Bi Publisher Security’

Prerequisite:

Backup Your Fusion Middleware directory home.
[rms_bi_vtg@BI-VTG-02 ~]$ cp -R fmw/ fmw_bak
Backup Catalog Folder.

Step by Step:


Step 1: Access Oracle BI Publisher Enterprise via Web Browser


Step 2:
Administration --> Security Center à Security Configuration


Step 3: Enable Superuser


Step 4: Security Model, you choose BI Publisher Security


Step 5: Click Apply
Step 6: Administration à System Maintenance à Server Configuration

Step 7: Catalog
On Catalog Type: You choose Oracle BI Publisher – File System
On Path: $DOMAIN_HOME/config/bipublisher/repository
Example:
/u01/rms_bi_vtg/fmw/user_projects/domains/bifoundation_domain/config/bipublisher/repository


Step 8: Click Apply.
Step 9: Reboot BI Server. Details you can read it.

Step 10: Login BI Publisher with "superuser" on Step 3.
Step 11: Upload Catalog folder
Step 12: Create users for BI Publisher.

Monday, November 16, 2015

Starting, Stopping Services BI Publisher 11g

Starting, Stopping Services

Starting Services:

Step 1: Starting Admin Server:

[oracle@App1 fmw]$ cd user_projects/domains/bifoundation_domain/
[oracle@App1 bifoundation_domain]$ pwd
/u01/app/fmw/user_projects/domains/bifoundation_domain
[oracle@App1 bifoundation_domain]$ ./startWebLogic.sh
Enter username to boot WebLogic server:weblogic
Enter password to boot WebLogic server:*********
You also start Admin Server via nohup
-bash-4.1$ pwd
/u01/app/fmw/user_projects/domains/bifoundation_domain/servers/AdminServer/security
-bash-4.1$ more boot.properties
username=weblogic
password=***********

-bash-4.1$ pwd
/u01/app/fmw/user_projects/domains/bifoundation_domain
-bash-4.1$ nohup ./startWebLogic.sh >> startWebLogic.log &
[1] 10517
-bash-4.1$ nohup: ignoring input and redirecting stderr to stdout

-bash-4.1$ tailf startWebLogic.log
***************************************************
starting weblogic with Java version:
java version "1.7.0_80"
Java(TM) SE Runtime Environment (build 1.7.0_80-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.80-b11, mixed mode)

Step 2: Starting Managed Server bi_server1

[oracle@App1 fmw]$ cd user_projects/domains/bifoundation_domain/bin/
[oracle@App1 bin]$ pwd
/u01/app/fmw/user_projects/domains/bifoundation_domain/bin
 [oracle@App1 bin]$ ./startManagedWebLogic.sh bi_server1
Enter username to boot WebLogic server:weblogic
Enter password to boot WebLogic server:**********
You also start bi_server1 via nohup
-bash-4.1$ pwd
/u01/app/fmw/user_projects/domains/bifoundation_domain/servers/
-bash-4.1$ cp AdminServer/security/boot.properties bi_server1/security/

-bash-4.1$ pwd
/u01/app /fmw/user_projects/domains/bifoundation_domain/bin
-bash-4.1$ nohup ./startManagedWebLogic.sh bi_server1 >> bi_server1.log &

Step 3: Starting instances:

[oracle@App1 fmw]$ cd instances/instance1/bin/
[oracle@App1 bin]$ pwd
/u01/app/fmw/instances/instance1/bin
[oracle@App1 bin]$ ./opmnctl startall
[oracle@App1 bin]$ ./opmnctl status

Processes in Instance: instance1
---------------------------------+--------------------+---------+---------
ias-component                    | process-type       |     pid | status 
---------------------------------+--------------------+---------+---------
coreapplication_obiccs1          | OracleBIClusterCo~ |   29632 | Alive  
coreapplication_obisch1          | OracleBIScheduler~ |   29631 | Alive  
coreapplication_obijh1           | OracleBIJavaHostC~ |   29623 | Alive  
coreapplication_obips1           | OracleBIPresentat~ |   29625 | Alive  
coreapplication_obis1            | OracleBIServerCom~ |   29626 | Alive 

Stopping Services:

Step 1: Stopping instances:

[oracle@App1 bin]$ ./opmnctl stopall
opmnctl stopall: stopping opmn and all managed processes...
[oracle@App1 bin]$ ./opmnctl status
opmnctl status: opmn is not running.

Step 2: Stopping Managed Server bi_server1:

[oracle@App1 fmw]$ cd user_projects/domains/bifoundation_domain/bin/
[oracle@App1 bin]$ pwd
/u01/app/fmw/user_projects/domains/bifoundation_domain/bin
 [oracle@App1 bin]$ ./stopManagedWebLogic.sh bi_server1
>
[JCABindingManager] : This operation is not supported for JCA based MDB
UNREGISTERED oracle.biee.local:type=DomainConfigProxy,group=Config

Step 3: Stopping Admin Server:

[oracle@App1 fmw]$ cd user_projects/domains/bifoundation_domain/bin
[oracle@App1 bifoundation_domain]$ pwd
/u01/app/fmw/user_projects/domains/bifoundation_domain/bin
[oracle@App1 bifoundation_domain]$ ./stopWebLogic.sh
>

Tuesday, November 3, 2015

Monday, November 2, 2015

P6 EPPM R15.1 INSTALLATION AND CONFIGURATION CHECKLIST


Outline:

Table of Contents




Install and configure Single Sign-On Checklist

Pre-Installation Checklist:

Done
(Y/N)
Sequence
Topic
Documents

1
JDK installation


2
Setting an Environment Variable for Java


3
Installation a Database


4
Installation RCU


5
Installation OS packages


6
Adding hostname in /etc/hosts


7
Installation Weblogic Server

Oracle Unified Directory (OUD) Installation and Configuration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Downloading the software


2
Creating Schemas using RCU


3
Welcome Screen


4
Install Software Updates Screen


5
Prerequisite Checks Screen


6
Installation Location


7
Installation Summary


8
Installation Progress


9
Installation Complete


10
OUD Configuration

Oracle Access Manager (OAM) Installation Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Download the software


2
Creating Schemas using RCU


3
Welcome Screen


4
Install Software Updates Screen


5
Specify Installation Location


6
Installation Progress


7
Installation Complete

Oracle Access Manager (OAM) Configuration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Welcome Screen


2
Select Domain Source Screen


3
Specify Domain Name and Location Screen


4
Configure Administrator User Name and Password Screen


5
Select Optional Configuration Screen


6
Configure the Administration Server Screen


7
Configure Managed Servers Screen


8
Configure Machines Screen


9
Assign Servers to Machines Screen


10
Creating Domain Screen


11
Configuring Database Security Store Screen

 

OAM and OUD Integration Checklist

Done
(Y/N)
Sequence
Topic
Documents




1
Create IDS Profile

2
Create User Profile Services


3
Update OAM LDAP Authentication


4
Set OAM Console Authentication






Install and Configure Content Repository Checklist

Pre-Installation Checklist:

Done
(Y/N)
Sequence
Topic
Documents

1
JDK installation


2
Setting an Environment Variable for Java


3
Installation a Database


4
Installation RCU


5
Installation OS packages


6
Adding hostname in /etc/hosts


7
Installation Weblogic Server

Content Repository Installation Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Download the software


2
Create schemas using RCU


3
Welcome Screen


4
Install Software Updates Screen


5
Prerequisite Checks Screen


6
Specify Installation Location Screen


7
Application Server Screen


8
Installation Summary Screen


9
Installation Progress


10
Installation Complete

Content Repository Configuration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Welcome Screen


2
Select Domain Source Screen


3
Specify Domain Name and Location Screen


4
Configure Administrator Username and password Screen


5
Configure Server Start Mode and JDK Screen


6
Configure JDBC Component Schema Screen


7
Test JDBC Component Schema Screen


8
Select Optional Configuration Screen


9
Configuration Summary


10
Creating Domain




Install and Configure BI Publisher Checklist

Pre-Installation Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
JDK installation


2
Setting an Environment Variable for Java


3
Installation a Database


4
Installation RCU


5
Installation OS packages


6
Adding hostname in /etc/hosts

 

BI Publisher Installation and Configuration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Download Oracle Business Intelligence Applications 11g(11.1.1.9.0)


2
Creating Schemas using RCU


3
Welcome Screen


4
Install Software Updates Screen


5
Prerequisite Checks Screen


6
Create or Scale Out BI System Screen


7
Specify Installation Location Screen


8
Configure Components Screen


9
BIPLATFORM Schema Screen


10
Configure Ports Screen


11
Specify Security Updates Screen


12
Summary Screen


13
Installation Progress Screen


14
Configuration Progress Screen


15
Complete Screen




Install and Configure P6 Primavera R15.1 Checklist

Pre-Installation Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
JDK installation


2
Setting an Environment Variable for Java


3
Installation Weblogic


4
Installation a Database

Migration P6 Database Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Select Source Screen


2
Connection Information


3
Select Target


4
Connection Information


5
Configure Oracle Tablespaces


6
Migrate Database


7
Create Oracle Users


8
Migrate Options


9
Migrate Database…

 

P6 EPPM Installation and Configuration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Download the wsdl4j-1.6.2.jar


2
Grant
Privileges to
the SYSTEM
Use


3
Installing your P6 EPPM Suite


4
Using the database Configuration Screen


5
Using the Database Type & Connection Screen


6
Using the Create Users Screen


7
Using the P6 Configuration Settings Screen


8
Using the Application Server Configuration Screen


9
Using the Configuration WebLogic Screen


10
Using the Configuration Review Screen


11
Using the Configuration Progress Screen


12
Using the Configuration Complete Screen

P6 EPPM and BI Publisher Integration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Creating the JDBC Connection String for BI Publisher 11g


2
Determining the Catalog Type in BI Publisher 11g


3
Adding P6 Sample Reports to Catalog


4
Adding the JDBC Data Source to the BIConsumers Role


5
Assigning Permissions to the P6Reports Folder


6
Creating Reporting Users in BI Publisher


7
Configring the Primavera P6 Administrator for BI Publisher and Publication Services

P6 EPPM and Content Repository Integration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Establish a Trusted Connection to P6 EPPM database

2
Enable Framework folders or Folder_G


3
Create a P6 EPPM Security Group in WCCC


4
Create an P6 EPPM documents home folder on the WCCC server


5
Create users in WCCC for integrating with P6 EPPM.


6
Create a Document Type for P6 EPPM documents in WCCC


7
Create prefix in WCCC for P6 EPPM


8
Configuring the appropriate settings for the Primavera P6 Administrator


9
Restart the WCCC server

 

P6 EPPM and SSO Integration Checklist

P6 EPPM and SSO Prerequisite Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Installing WebLogic


2
Installing a database


3
Installing P6 EPPM


4
Installing the LDAP Directory Server


5
Installing Oracle HTTP Server

P6 EPPM and SSO Integration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1
Installing and Configuring OAM


2
Installing Oracle HTTP Server WebGate for OAM


3
Configuring OAM and the Oracle HTTP Server WebGate for SSO Redirection


4
Configuring P6 EPPM for Web SSO


5
Reboot P6 Server

Content Repository and SSO Integration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1


2



3



4



5



6



7


BI Publisher and SSO Integration Checklist

Done
(Y/N)
Sequence
Topic
Documents

1


2



3



4



5



6



7