Simples Assim

How to Estimate HCC Ratio in Oracle Database

leave a comment »

1) Start SQL*Plus.

2) Create a temporary tablespace:

CREATE TEMPORARY TABLESPACE SAMPLETBS;

3) Run the following script:

SET SERVEROUTPUT ON;

DECLARE
  blkcnt_cmp PLS_INTEGER;
  blkcnt_uncmp PLS_INTEGER;
  row_cmp PLS_INTEGER;
  row_uncmp PLS_INTEGER;
  cmp_ratio NUMBER;
  comptype_str VARCHAR2(32767);

BEGIN
  DBMS_COMPRESSION.GET_COMPRESSION_RATIO('SAMPLETBS', 'SAMPLEUSER', 'SAMPLETB', NULL, DBMS_COMPRESSION.COMP_FOR_QUERY_HIGH, blkcnt_cmp, blkcnt_uncmp, row_cmp, row_uncmp, cmp_ratio, comptype_str);

  DBMS_OUTPUT.PUT_LINE('Estimated HCC ratio = ' || cmp_ratio);

END;
/

4) Exit SQL*Plus.

Refer to section 36 of the Oracle Database PL/SQL Packages and Types Reference manual for more information.

Written by Fernando Ribeiro

August 16, 2015 at 8:53 am

Posted in Technology

Tagged with

How to Rename a Database in Oracle Database

leave a comment »

1) Start SQL*Plus.

2) Close the database:

ALTER DATABASE CLOSE

3) Change the database name:

host nid TARGET=SYS DBNAME=SAMPLE SETNAME=YES

4) Re-create the PFILE from the SPFILE:

CREATE PFILE FROM SPFILE

5) Change the DB_NAME parameter in the PFILE.

6) Create a new SPFILE from the PFILE:

CREATE SPFILE FROM PFILE

7) Create a new password file:

host orapwd FILE=$ORACLE_HOME/dbs/orapwSAMPLE

8) Open the database:

ALTER DATABASE SAMPLE OPEN READ WRITE

9) Exit SQL*Plus.

Refer to section 19 of the Oracle Database Utilities manual for more information.

Written by Fernando Ribeiro

August 10, 2015 at 8:25 am

Posted in Technology

Tagged with

Using a SID as a Service Name in Oracle Multitenant

leave a comment »

A quick fix for applications that can’t pass service names.

https://docs.oracle.com/database/121/NETRF/listener.htm#CHDHECBA

Written by Fernando Ribeiro

July 30, 2015 at 5:06 pm

How to Take a Snapshot of a Guest VM in Oracle VM

leave a comment »

Oracle VM Manager CLI

1) Find the server pool and guest VM IDs:

show ServerPool name=<Server Pool Name>

2) Find the virtual disk IDs:

show Vm id=<Guest VM ID>

Oracle VM Server Host

1) Create a reflink to the vm.cfg file of the guest VM:

reflink /OVS/Repositories/<Server Pool ID>/VirtualMachines/<Guest VM ID>/vm.cfg <Reflink Name>

2) Create a reflink to each of the virtual disks:

reflink /OVS/Repositories/<Server Pool ID>/VirtualDisks/<Virtual Disk ID>.img <Reflink Name>

Written by Fernando Ribeiro

July 23, 2015 at 2:34 am

Migrating Oracle VM Manager to a Guest VM in Oracle VM

leave a comment »

Written by Fernando Ribeiro

July 13, 2015 at 11:23 pm

Booting from an ISO Image with the Oracle ILOM Remote Console

leave a comment »

Very useful for re-installing from scratch.

https://support.oracle.com/epmos/faces/DocumentDisplay?id=1589715.1

Written by Fernando Ribeiro

July 12, 2015 at 3:06 am

Issue with Oracle VM 3.x

leave a comment »

The BIOS RTC in the Oracle VM Server hosts should be set to UTC.

https://support.oracle.com/epmos/faces/DocumentDisplay?id=1600823.1

Written by Fernando Ribeiro

July 12, 2015 at 2:36 am

Posted in Technology

Tagged with ,

Follow

Get every new post delivered to your Inbox.

Join 1,287 other followers