Oracle database ASM migration….

Successfully migrated an oracle database from filesystem to ASM. More or less it was easy…

shutdown immediate
startup mount
alter database archivelog;
startup;

[oracle@scada ~]$ rman target=/

Recovery Manager: Release 11.2.0.3.0 – Production on Mon Jun 3 19:35:59 2013

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

connected to target database: DB (DBID=1578985198)

RMAN> backup as copy incremental level 0 database format ‘+DATA’ tag ‘ORA_ASM_MIGRATION’;

RMAN> restore spfile to ‘+DATA/DB/spfiledb.ora’;
RMAN> shutdown immediate

mv $ORACLE_HOME/dbs/spfileDB.ora $ORACLE_HOME/dbs/spfileDB.ora.bak
echo “SPFILE=’+DATA/DB/spfiledb.ora’ > $ORACLE_HOME/dbs/initDB.ora

SQL> STARTUP FORCE NOMOUNT;
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST=’+DATA’ SID=’*’;

if ( FRA is used ) {
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=100G SID=’*’;
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST=’+FRA’ SID=’*’;
}

SQL> ALTER SYSTEM SET CONTROL_FILES=’+DATA’,’+DATA’ SCOPE=SPFILE SID=’*’;
SQL> SHUTDOWN IMMEDIATE

RMAN> STARTUP FORCE NOMOUNT;
RMAN> RESTORE CONTROLFILE FROM ‘/data/oradata/DB/control01.ctl’;
RMAN> SWITCH DATABASE TO COPY;
RMAN> RECOVER DATABASE;

SQL> alter database add logfile thread 1 size 100M;
SQL> alter database add logfile thread 1 size 100M;
SQL> alter database add logfile thread 1 size 100M;
SQL> select * from v$log;
SQL> select * from v$logfile;
SQL> alter database drop logfile group <nr>
SQL> alter database drop logfile member ‘/u01/oradata/DB/onlinelog/o1_mf_2_8tssrbd8_.log’;
SQL> ..
SQL> alter system switch logfile;
SQL> alter system checkpoint global;
SQL> alter tablespace temp add tempfile size 2G;
SQL> alter tablespace temp drop tempfile ‘/u00/oradata/DB/temp01.dbf’;

WinCC OA APEX jQuery mobile smartphone demo…

Apex-Mobile-Demo

Simple mobile smartphone demo build with Oracle APEX connected to WinCC OA (www.etm.at).

It tooks me about 3h… and i had NO experience with APEX!

The map does not work on (my) android smartphone… maybe a known bug: http://www.oracle.com/technetwork/developer-tools/apex/application-express/apex-42-known-issues-1863578.html

Connectivity WinCC OA <=> Oracle:

Oracle-DB => PL/SQL => XMLRPC-Calls => WinCC OA (Control)

Currently the connectivity library is very basic, but if i will find some time i will extend it… and you will find it on sourceforge…

if you have a valid Oracle database license APEX is for free! if you don’t have one, you can use Oracle-XE, which you can get for free…. 🙂

Oracle and APEX meets WinCC OA…

With a “few lines” of code Oracle is able to fetch WinCC OA values over XMLRPC webservice – current and history values (WinCC OA RDB-Manager is not needed).

WinCC OA values can be queried with “natural” Oracle SQL Statements

select t.dp, wccoa.dpGet(t.dp||'.int'), wccoa.dpGet(t.dp||'.int:_online.._stime')
from dpnames t where dp like 'Example%'

So, it is also easy to create “WinCC OA” (Web)APEX Applications!

Update C# WinCC Open Architecture Connector

New “C# WinCC Open Architecture Connector” version.

2013.01.01: Added Proxy-Server with client/server TCP/IP connection for dp(Query)Connects and unsolicited data multicasting.

2012.12.23: Added a very simple C# WinForms application which displays two datapoints, waits
for value changes and values can also be set by a button out of the WinForms application.

2012.12.23: Added WaitDataMulti function which performs a dpWaitForValue. Can be used to wait
for a change of value of data points of a taglist.

 

C# WinCC OA Connector…

C# WinCC OA Connector

http://sourceforge.net/projects/roc-winccoa-lib/?source=directory

CommDiagram

Communication can be done directly with XMLRPC or with the included proxy:

  • .net remoting is used for “commands” from the client to the proxy (dpConnect, dpQueryConnect).
  • tcp (xml over tcp) for sending unsolicited data/events from the proxy to the client.

The proxy also acts as a distributor – if clients have the same dp(Query)Connects,
the connects in the control are done once, and the proxy will forward it to the clients.

Added functions for dpConnects without using “Tag” Objects (the Tag objects where created for
mobile clients). Now it is easy to create for example a dpQueryConnect. The callback function
is just a C# delegate:

// create server and client objects
client = new WCCOAClient (ProxyHost, ProxyRemotePort, ProxyClientPort);

// start and connect
client.Start ();
client.Connect ();
client.DpQueryConnectSingle((object s, ArrayList a) => {
WCCOABase.PrintArrayList(a);
}, “SELECT ‘_online.._value’, ‘_online.._stime’ FROM ‘*.**'”);

The proxy (WCCOANetServer.exe) must be started on a server (can, but must not be, the WCCOA Server).

Works fine with MonoTouch and Mono for Android!

WinCC Open Architecture must run the included Ctrl-Script xmlnet_server.ctl

GPLv3 License is used for the public domain.
If you plan to use it in a CLOSED SOURCE project,
please get in touch with me – andres.vogler@gmail.com !