Friday, December 25, 2015

Backup Full Database 12c Script

Task 1: Preparing to Use the Oracle Suggested Backup Strategy

To use the Oracle suggested backup strategy, ensure that:

  The database is ARCHIVELOG mode
 The fast recovery area size is configured, or a default device for storing backups is configured.
 You have added a database host user to the OSBACKUPUPDBA operating system group, for operating system authentication.

Task 2: Create the Backup full Script-UNIX and Linux

[oracle@SERVER_DATABASE rman]$ pwd
/u01/app/oracle/rman_backup
[oracle@SERVER_DATABASE rman]$ more backup_script_full.sh
#!/bin/bash
ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/db_1;export ORACLE_HOME
ORACLE_SID=orcl; export ORACLE_SID
PATH=$PATH:$ORACLE_HOME/bin; export PATH

chk_date=`date +%d`
chk_parity=`expr $chk_date % 2`

export bkdir=/backup11
BACKUP_DIR=$bkdir; export BACKUP_DIR
export DATA_DIR=$BACKUP_DIR/backup_full
export ARC_DIR=$BACKUP_DIR/backup_full
export BACKUP_DATA=$DATA_DIR/$ORACLE_SID"_data_f%t_s%s_s%p"
export BACKUP_ARC=$ARC_DIR/$ORACLE_SID"_arc_f%t_s%s_s%p"
export ORACLE_OWNER=oracle
export DATE=`date +%Y%m%d`
export IP=168_133

########### SCRIPT CHECK BACKUP FAILED############
backup_log_err='/u01/app/monitoring/log/backup_log.err';
backup_log_finish='/u01/app/monitoring/log/backup_log.finish';

/usr/bin/ls -lt /u01/app/rman_backup/log_full > $list_file;
i=1
while read line
do
 let i=$i+1;
 if [ $i -gt 2 ]
 then
  backup_log='/u01/app/rman_backup/log_full/'`echo $line | awk '{print $9}'`;
   break;
  fi
done < "$list_file"

  grep -i error $backup_log > $backup_log_err

  grep "Recovery Manager complete" $backup_log > $backup_log_finish
       
  if [ `cat $backup_log_err|wc -l` -gt 0 ]
    then
        echo 'Backup have error';
        exit;
  fi

  if [ !`cat $backup_log_finish|wc -l` -gt 0 ]
    then
        echo 'Backup have not finished yet';
        exit;
  fi
#######################################

cd $BACKUP_DIR
rm -rf backup_full_*
mv backup_full backup_full_$DATE
mkdir -p $DATA_DIR
mkdir -p $ARC_DIR


$ORACLE_HOME/bin/rman target / log /u01/app/rman_backup/log_full/rman_backup_full_$IP"_"$DATE.log <<EOF
RUN {
CROSSCHECK BACKUP OF DATABASE;
CROSSCHECK ARCHIVELOG ALL;
BACKUP AS COMPRESSED BACKUPSET FORMAT '$BACKUP_ARC' ARCHIVELOG ALL DELETE INPUT;
BACKUP AS COMPRESSED BACKUPSET FORMAT '$BACKUP_DATA' DATABASE SKIP READONLY;
SQL 'ALTER SYSTEM ARCHIVE LOG CURRENT';
BACKUP AS COMPRESSED BACKUPSET FORMAT '$BACKUP_ARC' ARCHIVELOG ALL DELETE INPUT;
BACKUP CURRENT CONTROLFILE;
}

exit;
EOF

Task 3: Testing the Backup Script

[oracle@SERVER_DATABASE rman]$ chmod 775 backup_script_full.sh
[oracle@SERVER_DATABASE rman]$ nohup ./ backup_script_full.sh &
[oracle@SERVER_DATABASE rman]$ tailf nohup.log
RMAN-00557: could not open MSGLOG "/u01/app/rman_backup/log_full/rman_backup_full_165_145_20151225.log"

Recovery Manager: Release 11.2.0.4.0 - Production on Fri Dec 25 17:05:50 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database:ORCL (DBID=1723703927)

RMAN> 2> 3> 4> 5> 6> 7> 8> 9>
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4018 instance=ptud11 device type=DISK
specification does not match any backup in the repository

released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=4018 instance=ptud11 device type=DISK
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_17/thread_1_seq_3.256.898708303 RECID=4 STAMP=898708305
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_1_seq_4.261.898767075 RECID=9 STAMP=898767075
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_21/thread_1_seq_5.262.899028659 RECID=10 STAMP=899028662
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_17/thread_2_seq_2.258.898708305 RECID=5 STAMP=898708307
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_2_seq_3.257.898767069 RECID=6 STAMP=898767069
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_2_seq_4.259.898767073 RECID=7 STAMP=898767072
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_2_seq_5.260.898767073 RECID=8 STAMP=898767072
validation succeeded for archived log
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_2_seq_6.263.899384879 RECID=11 STAMP=899384883
Crosschecked 8 objects
Starting backup at 25-DEC-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=2 RECID=5 STAMP=898708307
input archived log thread=1 sequence=3 RECID=4 STAMP=898708305
input archived log thread=2 sequence=3 RECID=6 STAMP=898767069
input archived log thread=1 sequence=4 RECID=9 STAMP=898767075
input archived log thread=2 sequence=4 RECID=7 STAMP=898767072
input archived log thread=2 sequence=5 RECID=8 STAMP=898767072
input archived log thread=1 sequence=5 RECID=10 STAMP=899028662
input archived log thread=2 sequence=6 RECID=11 STAMP=899384883
input archived log thread=1 sequence=6 RECID=13 STAMP=899399158
input archived log thread=2 sequence=7 RECID=12 STAMP=899399156
channel ORA_DISK_1: starting piece 1 at 25-DEC-15
channel ORA_DISK_1: finished piece 1 at 25-DEC-15
piece handle=/backup11/backup_full/ptud11_arc_f899399162_s1_s1 tag=TAG20151225T170602 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:25
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+ARC/ptud1/archivelog/2015_12_17/thread_2_seq_2.258.898708305 RECID=5 STAMP=898708307
archived log file name=+ARC/ptud1/archivelog/2015_12_17/thread_1_seq_3.256.898708303 RECID=4 STAMP=898708305
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_2_seq_3.257.898767069 RECID=6 STAMP=898767069
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_1_seq_4.261.898767075 RECID=9 STAMP=898767075
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_2_seq_4.259.898767073 RECID=7 STAMP=898767072
archived log file name=+ARC/ptud1/archivelog/2015_12_18/thread_2_seq_5.260.898767073 RECID=8 STAMP=898767072
archived log file name=+ARC/ptud1/archivelog/2015_12_21/thread_1_seq_5.262.899028659 RECID=10 STAMP=899028662
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_2_seq_6.263.899384879 RECID=11 STAMP=899384883
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_1_seq_6.264.899399153 RECID=13 STAMP=899399158
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_2_seq_7.265.899399155 RECID=12 STAMP=899399156
Finished backup at 25-DEC-15

Starting backup at 25-DEC-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA/ptud1/datafile/users.259.898072689
input datafile file number=00002 name=+DATA/ptud1/datafile/sysaux.257.898072689
input datafile file number=00001 name=+DATA/ptud1/datafile/system.256.898072689
input datafile file number=00003 name=+DATA/ptud1/datafile/undotbs1.258.898072689
input datafile file number=00006 name=+DATA/ptud1/datafile/data.dbf
input datafile file number=00008 name=+DATA/ptud1/datafile/vsa.dbf
input datafile file number=00007 name=+DATA/ptud1/datafile/mdata.dbf
input datafile file number=00005 name=+DATA/ptud1/datafile/undotbs2.261.898072819
channel ORA_DISK_1: starting piece 1 at 25-DEC-15
channel ORA_DISK_1: finished piece 1 at 25-DEC-15
piece handle=/backup11/backup_full/ptud11_data_f899399248_s2_s1 tag=TAG20151225T170727 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:35
channel ORA_DISK_1: starting compressed full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_DISK_1: starting piece 1 at 25-DEC-15
channel ORA_DISK_1: finished piece 1 at 25-DEC-15
piece handle=/backup11/backup_full/ptud11_data_f899399343_s3_s1 tag=TAG20151225T170727 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 25-DEC-15

sql statement: ALTER SYSTEM ARCHIVE LOG CURRENT

Starting backup at 25-DEC-15
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting compressed archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=7 RECID=14 STAMP=899399351
input archived log thread=2 sequence=8 RECID=15 STAMP=899399353
input archived log thread=1 sequence=8 RECID=17 STAMP=899399363
input archived log thread=2 sequence=9 RECID=16 STAMP=899399362
channel ORA_DISK_1: starting piece 1 at 25-DEC-15
channel ORA_DISK_1: finished piece 1 at 25-DEC-15
piece handle=/backup11/backup_full/ptud11_arc_f899399363_s4_s1 tag=TAG20151225T170923 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_1_seq_7.265.899399351 RECID=14 STAMP=899399351
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_2_seq_8.264.899399353 RECID=15 STAMP=899399353
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_1_seq_8.262.899399363 RECID=17 STAMP=899399363
archived log file name=+ARC/ptud1/archivelog/2015_12_25/thread_2_seq_9.263.899399363 RECID=16 STAMP=899399362
Finished backup at 25-DEC-15

Starting backup at 25-DEC-15
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 25-DEC-15
channel ORA_DISK_1: finished piece 1 at 25-DEC-15
piece handle=/u01/app/oracle/product/12.1.0.2/db_1/dbs/05qpnfm4_1_1 tag=TAG20151225T170924 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 25-DEC-15

Task 4: Scheduling the Daily Backup –UNIX and Linux

Firstly, configure oracle allow use crontab
[root@SERVER_DATABASE ~]# more /etc/cron.allow
root
oracle
Creating a crontab file for oracle user from the contents of .crontab.
[oracle@SERVER_DATABASE rman]$ crontab -e
MAILTO=thonh53@gmail.com
# MI HH DD MM DAY CMD
  00 19 * * * /u01/app/rman_backup/rman_backup_full.sh  > /dev/null 2>&1

Checking the contents of the crontab file for oracle user
[oracle@SERVER_DATABASE rman]$ crontab -l
MAILTO=thonh53@gmail.com
# MI HH DD MM DAY CMD
  00 19 * * * /u01/app/rman_backup/rman_backup_full.sh  > /dev/null 2>&1
(Optional) Checking crontab log.
[root@SERVER_DATABASE ~]# tailf /var/log/cron
Oct 30 18:01:01 localhost run-parts(/etc/cron.hourly)[7601]: finished 0anacron
Oct 30 18:01:01 localhost run-parts(/etc/cron.hourly)[7592]: starting mcelog.cron
Oct 30 18:01:01 localhost run-parts(/etc/cron.hourly)[7616]: finished mcelog.cron
Oct 30 18:01:44 localhost crontab[7744]: (oracle) BEGIN EDIT (oracle)
Oct 30 18:01:55 localhost crontab[7744]: (oracle) REPLACE (oracle)
Oct 30 18:01:55 localhost crontab[7744]: (oracle) END EDIT (oracle)
Oct 30 18:02:01 localhost crond[2526]: (oracle) RELOAD (/var/spool/cron/oracle)
Oct 30 18:02:12 localhost crontab[7783]: (root) BEGIN EDIT (root)
Oct 30 18:02:14 localhost crontab[7783]: (root) END EDIT (root)
Oct 30 18:02:28 localhost crontab[7805]: (root) LIST (oracle)
Oct 30 19:00:00 localhost CROND[7842]: (oracle) CMD (/u01/app/oracle/rman/backup_script_full.sh)

Friday, December 4, 2015

How to drop or truncade all partitions Oracle Database

[oracle@PTUD-VM02-2 oradata]$ more drop_partition_table.sql 

SET LINESIZE 32000;
SET PAGESIZE 40000;
SET LONG 50000;

select 'ALTER TABLE '||TABLE_OWNER||'.'||table_name||' DROP PARTITION '||partition_name||';' from dba_tab_partitions;

[oracle@PTUD-VM02-2 oradata]$ sqlplus / as sysdba @drop_partition_table.sql >> a.sql &

[oracle@PTUD-VM02-2 oradata]$ cat a.sql | grep 'DROP PARTITION' >> b.sql
[oracle@PTUD-VM02-2 oradata]$ sqlplus / as sysdba @b.sql

Thursday, December 3, 2015

Running OLAP Builds to Load Data into Analytical Workspace

Read the document firstly
https://docs.oracle.com/cd/E64694_01/CDMIG/E64550-04.pdf

This load typically completes in 30-35 minutes.
[oracle@PTUD-S07 ~]$ sqlplus ocdm_sample/*********@orcl

SQL*Plus: Release 12.1.0.1.0 Production on Thu Dec 3 14:56:25 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Last Successful login time: Thu Dec 03 2015 14:03:22 +07:00

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> begin
pkg_ocdm_olap_etl_aw_load.run;
end;
/

PL/SQL procedure successfully completed.

SQL> select cubename,load_status,error_dtl from dwc_olap_activity order by
cubename; 

ACM COMPLETED-SUCCESS
ADM COMPLETED-SUCCESS
AGRMNT COMPLETED-SUCCESS
APM COMPLETED-SUCCESS
CCM COMPLETED-SUCCESS
CHRN COMPLETED-SUCCESS
CMSN COMPLETED-SUCCESS
COM COMPLETED-SUCCESS
CSM COMPLETED-SUCCESS
IAM COMPLETED-SUCCESS
INV COMPLETED-SUCCESS
INVCM COMPLETED-SUCCESS
RVN COMPLETED-SUCCESS
SLS COMPLETED-SUCCESS

14 rows selected.



How to impdp OCDM_SAMPLE for Oracle Communications Data Model





Step 1: Create tablespace for OCDM_SAMPLE:


SQL>  create tablespace DW_OCDM_SAMPLE datafile '/u01/app/oracle/admin/orcl/datafile/DW_OCDM_SAMPLE.dbf' size 100M autoextend on next 10M;
Tablespace created.
SQL>  create temporary tablespace DW_OCDM_SAMPLE_TEMP tempfile '/u01/app/oracle/admin/orcl/datafile/DW_OCDM_SAMPLE_TEMP.dbf' size 100M autoextend on next 10M;
Tablespace created.

Step 2: Create user ocdm_sample and grant privilege for the user.


create user "OCDM_SAMPLE" identified by ********** profile "DEFAULT" account unlock default tablespace  "DW_OCDM_SAMPLE" temporary tablespace "DW_OCDM_SAMPLE_TEMP";
     
grant CREATE SESSION to "OCDM_SAMPLE";
grant CREATE TYPE to "OCDM_SAMPLE";
grant CREATE SYNONYM to "OCDM_SAMPLE";
grant CREATE MATERIALIZED VIEW to "OCDM_SAMPLE";
grant CREATE TABLE to "OCDM_SAMPLE";
grant CREATE DIMENSION to "OCDM_SAMPLE";
grant CREATE SEQUENCE to "OCDM_SAMPLE";
grant CREATE VIEW to "OCDM_SAMPLE";
grant CREATE JOB to "OCDM_SAMPLE";
grant "OLAP_USER" to "OCDM_SAMPLE";
grant CREATE PROCEDURE to "OCDM_SAMPLE";
grant CREATE TABLESPACE to "OCDM_SAMPLE";
grant CREATE MINING MODEL to "OCDM_SAMPLE";
grant UNLIMITED TABLESPACE to "OCDM_SAMPLE";

Step 3: Import ocdm_sample.dmp


impdp system/******* directory=dump_dir dumpfile=ocdm_sample.dmp logfile=ocdm_sample.log

Wednesday, December 2, 2015

Limiting User Privileges when you install sample reports

[oracle@PTUD-S07 ~]$ more a.sql 
SET LINESIZE 32000;
SET PAGESIZE 40000;
SET LONG 50000;

select 'CREATE OR REPLACE EDITIONABLE SYNONYM OCDM_REPORT.'||Table_Name||' for OCDM_SYS.'||Table_Name||';' from All_Tables where owner='OCDM_SYS';


[oracle@PTUD-S07 ~]$ sqlplus / as sysdba @a.sql >> b.sql &
[4] 141981
[oracle@PTUD-S07 ~]$ cat b.sql | grep 'CREATE OR REPLACE EDITIONABLE SYNONYM' >> c.sql

[4]+  Stopped                 sqlplus / as sysdba @a.sql >> b.sql
[oracle@PTUD-S07 ~]$ sqlplus / as sysdba @c.sql

Tuesday, December 1, 2015

Scripts start, stop BI Publisher 11G

Prerequisite:

[obiee@PTUD-S07 security]$ pwd
/u02/obiee/fmw/user_projects/domains/bifoundation_domain/servers/AdminServer/security
[obiee@PTUD-S07 security]$ more boot.properties 
#Tue Dec 01 18:38:07 ICT 2015
username=weblogic
password=********

[obiee@PTUD-S07 security]$ cd ../..
[obiee@PTUD-S07 servers]$ ls
AdminServer  AdminServerTag  bi_server1  domain_bak
[obiee@PTUD-S07 servers]$ cp AdminServer/security/boot.properties bi_server1/security/


Start BI Publisher Scripts

[obiee@PTUD-S07 bin]$ cat start.sh
export FM_HOME=/u02/obiee/fmw
export DOMAIN_HOME=$FM_HOME/user_projects/domains/bifoundation_domain
export INSTANCE_HOME=$FM_HOME/instances/instance1

cd $DOMAIN_HOME/bin
nohup ./startWebLogic.sh >> weblogic.log &
#tailf weblogic.log

nohup ./startManagedWebLogic.sh bi_server1 >> bi_server1.log &
#tailf bi_server1.log

cd $INSTANCE_HOME/bin
./opmnctl startall
./opmnctl status



Stop BI Publisher Scripts

[obiee@PTUD-S07 bin]$ cat stop.sh 

export FM_HOME=/u02/obiee/fmw
export DOMAIN_HOME=$FM_HOME/user_projects/domains/bifoundation_domain
export INSTANCE_HOME=$FM_HOME/instances/instance1
cd $DOMAIN_HOME/bin
./stopManagedWebLogic.sh bi_server1
./stopWebLogic.sh
cd $INSTANCE_HOME/bin
./opmnctl stopall
./opmnctl status

Post-step:

[obiee@PTUD-S07 bin]$ chmod 775 start.sh stop.sh 






Set JAVA_HOME for user!

[obiee@PTUD-VM01-2 ~]$ cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH

#JAVA_HOME
export JAVA_HOME=/u01/obiee/setup/jdk
export PATH=$JAVA_HOME/bin:$PATH

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