Amazon books

Wednesday, June 26, 2013

Top 10 New Features for Database 12c

My top 10 for Database 12c by now:

1-Data Guard Active Far Sync
2-Tuning network with SDU up to 2MB
3-DRCP can now be used with Oracle JDBC drivers
4-Heat Map stats in also new ADO
5-New security feature Data Redaction (kind of database firewall)
6-GDS with Active Data Guard and Golden Gate(Global Services, GDS Pool, GDS Region)
7-Recover tables in RMAN
9-Recover standby databases using incremental backups with one command (recover from service)
10-Move datafiles ONLINE!!

There are too many!! ;)

Best Regards,
Paulo Portugal

Download Oracle Database 12c NOW

http://www.oracle.com/technetwork/indexes/downloads/index.html

Oracle just released 12c Database.

Enjoy it!

BEst Regards,
Paulo Portugal

Wednesday, June 19, 2013

DGMGRL> switchover to db11gstb Performing switchover NOW, please wait... Error: ORA-16775: target standby database in broker operation has potential data loss Failed. Unable to switchover, primary database is still "db11g" DGMGRL>


If you got this error below while switching database using Data Guard Broker,

############################
DGMGRL> switchover to db11gstb
Performing switchover NOW, please wait...
Error: ORA-16775: target standby database in broker operation has potential data loss

Failed.
Unable to switchover, primary database is still "db11g"
DGMGRL>
############################

Stop the MRP process at standby database and restart it using current log file:

recover managed standby database cancel;
recover managed standby database using current logfile disconnect from session;


Do the switchover again.

Best Regards,
Paulo Portugal

Monday, June 17, 2013

If you got error below trying to initialize a NFS mount in your VM Server ;

#################################################
[root@f2cvmsrv ~]# /opt/ovs-agent-2.3/utils/repos.py -i
Mount point:
Error: errcode=00000, errmsg=Unexpected error: errcode=00000, errmsg=Unexpected error: failed:
StackTrace:
  File "/opt/ovs-agent-2.3/OVSSiteHA.py", line 248, in ha_check_cpu_compatibility
    raise Exception("CPU not compatible! %s" % repr(d))
>
StackTrace:
  File "/opt/ovs-agent-2.3/OVSSiteCluster.py", line 612, in cluster_check_prerequisite
    raise Exception(msg)
StackTrace:
  File "/opt/ovs-agent-2.3/OVSSiteCluster.py", line 649, in _cluster_setup
    _check(ret)
  File "/opt/ovs-agent-2.3/OVSXCluster.py", line 342, in _check
    raise OVSException(error=ret["error"])
#################################################
Edit this file below:
vi  /opt/ovs-agent-2.3/OVSSiteCluster.py
--comment this line below
# rs.append(("ha_check_cpu_compatibility", ha_check_cpu_compatibility(hosts)))
Restart ovs agent:
service ovs-agent restart --disable-nowayout

Best Regards,
Paulo Portugal

Monday, June 10, 2013

RE-Create database link another schema in Oracle


There is a way to simple do that using dbms_sys_sql package.

--Change your username here MYUSER
DECLARE
  lv_stmt VARCHAR2(2000);

  PROCEDURE run_sql_as(p_user IN VARCHAR2, p_statement IN VARCHAR2) IS
    lv_userid NUMBER;
lv_cursor NUMBER;
lv_result NUMBER;
  BEGIN
-- Get USER_ID for specified user
SELECT user_id INTO lv_userid FROM dba_users WHERE username = p_user;

-- Open, parse, execute and close
lv_cursor := sys.dbms_sys_sql.open_cursor;
sys.dbms_sys_sql.parse_as_user(lv_cursor, p_statement, dbms_sql.native, lv_userid, TRUE);
lv_result := sys.dbms_sys_sql.execute(lv_cursor);
sys.dbms_sys_sql.close_cursor(lv_cursor);
  EXCEPTION
WHEN OTHERS THEN
 DBMS_OUTPUT.PUT_LINE('Failed to execute the specified statement for user: '||p_user);
 DBMS_OUTPUT.PUT_LINE(SUBSTR(SQLERRM, 1, 100));
  END;

BEGIN
  run_sql_as('MYUSER','DROP DATABASE LINK DBL_ZZZ');
  lv_stmt := 'CREATE DATABASE LINK "DBL_ZZZ"
   CONNECT TO "XXXUSER" IDENTIFIED BY VALUES ''0581EB2B81E82590B67687F1E6852E21C6BB0FFF991398A158''
   USING ''(DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = host1.b2w)(PORT = 1522))
  (ADDRESS = (PROTOCOL = TCP)(HOST = host2.b2w)(PORT = 1522))
  (ADDRESS = (PROTOCOL = TCP)(HOST = host3.b2w)(PORT = 1522))
  (ADDRESS = (PROTOCOL = TCP)(HOST = host4.b2w)(PORT = 1522))
  (LOAD_BALANCE = yes)
  (CONNECT_DATA =
   (SERVER = DEDICATED)
   (SERVICE_NAME = MYDB)
   (FAILOVER_MODE =
    (TYPE = SELECT)
    (METHOD = BASIC)
    (RETRIES = 180)
    (DELAY = 5)
   )
  )
 )''';
  run_sql_as('MYUSER',lv_stmt);
END;
/



Best Regards,
Paulo Portugal

Thursday, June 6, 2013

Find and Compress OSW files quickly

I want to find and compress OSW files from time that my instance crashed:

INSTANCE_NAME     STATUS       TO_CHAR(STARTUP_TIM
---------------- ------------ -------------------
INST3     OPEN          06-06-2013 01:42:43
INST2     OPEN          03-05-2013 15:16:42
INST1     OPEN          03-05-2013 15:16:20
INST4     OPEN          06-06-2013 01:47:37


So you need to generate OSW analyze report using files from 00am to 2am.

Find and zip files:
find . -name "*13.06.06.0[0-2]00*" -exec zip /tmp/osw_`hostname`_06_Jun.zip {} \;

Use oswbb.jar to generate analyze report. Start osw Tool with command similar below:

export JAVA_HOME=/usr/java/jre1.7.0_21
/usr/java/jre1.7.0_21/bin/java -jar oswbba.jar -i /tmp/tmp/archive_new


Best Regards,
Paulo Portugal

Tuesday, June 4, 2013

Root.sh second rac node DG_GRID creation failed with the following message: ORA-15018: diskgroup cannot be created ORA-15031: disk specification '/dev/rhdisk37' matches no disks ORA-15025: could not open disk "/dev/rhdisk37" ORA-27041: unable to open file

If you run root.sh on second node while installing grid infrastructure 11g and got this error below:



Disk Group DG_GRID creation failed with the following message:
ORA-15018: diskgroup cannot be created
ORA-15031: disk specification '/dev/rhdisk37' matches no disks
ORA-15025: could not open disk "/dev/rhdisk37"
ORA-27041: unable to open file


Check if you can see all the same disks on both nodes using this command below:

--Run on both nodes
kfod asm_diskstring='/dev/rhdisk37*' disks=all

--To check all disks on run on both nodes
kfod asm_diskstring='/dev/rhdisk*' disks=all

If you cannot see, ask Storage Administrator to see why disk is not there and they must fix it before you run root.sh on second node again.

Best Regards,
Paulo Portugal

ORA-16057 DGID from server not in Data Guard configuration

If you got his error below in v$archive_dest_status:

ORA-16057 DGID from server not in Data Guard configuration

Check your log_archive_config parameter on both primary and standby database and make sure that all db_unique_name from both primary and standby are on this parameter in both primary and standby database.


After changing this parameter, defer and enable your log_archive_dest_state_x parameter and make a new "alter system log switch or alter system archive log current"  and finally check v$archive_dest_status view again.

Best Regards,
Paulo Portugal

Monday, June 3, 2013

Creating Listener using NETCA with RAC : TNS-04605 Invalid Syntax Error Literal "(" before or at ( PORT

If you got error below when trying to create a listener using netca:

TNS-04605 Invalid Syntax Error Literal "(" before or at ( PORT

Check your tnsnames.ora file. Something is wrong there. Move it to OLD and try to create listener again.

Best Regards,
Paulo Portugal