Friday, December 30, 2016

RMAN-20020: database incarnation not set

I have one PT env using storage sync for database sync.

Thought need to re-register DB after DB refresh, so unregister and register again.

RMAN> register database;
starting full resync of recovery catalog
full resync complete
database registered in recovery catalog
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03008: error while performing automatic resync of recovery catalog
RMAN-20020: database incarnation not set


However, this is the error.

Disconnected RMAN connection, and attempted to re- register , and finally succeed.

RMAN>   unregister database;



Do you really want to unregister the database (enter YES or NO)? yes
database unregistered from the recovery catalog

RMAN> register database;

database registered in recovery catalog
starting full resync of recovery catalog
 full resync complete


Another way to overcome this , is to issue RESET DATABASE command, e.g in http://www.dbaref.com/home/rman/rman-20020databaseincarnationnotset

But I don't want to change DBID explicitly.




One more thought, in fact I don't need to unregister  & register again, as there is no change to DBID.



As such, what I need to do is just configure RMAN setting directly.


CONFIGURE DEFAULT DEVICE TYPE TO disk;
starting full resync of recovery catalog
full resync complete
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> #parallelism 2 for EE only
2> #CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO compressed backupset;
3>
4> #parallelism 1 for SE only
5> CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO compressed backupset;
old RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters:
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN> show all;
RMAN configuration parameters for database with db_unique_name PSCRMP are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
CONFIGURE CONTROLFILE AUTOBACKUP ON;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/software/oraps/product/11.2.0/dbs/snapcf_PSCRMP.f'; # default

RMAN>
RMAN> #To ensure the control file is backed up by default, type the following at the RMAN prompt:
2> CONFIGURE CONTROLFILE AUTOBACKUP ON;
old RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters:
CONFIGURE CONTROLFILE AUTOBACKUP ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>
RMAN> CONFIGURE BACKUP OPTIMIZATION ON;
old RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters:
CONFIGURE BACKUP OPTIMIZATION ON;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>
RMAN> #To change how many backup sets you would like to retain, type the following at the RMAN prompt:
2> CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
old RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
new RMAN configuration parameters:
CONFIGURE RETENTION POLICY TO REDUNDANCY 3;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete

RMAN>
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO disk;
old RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters:
CONFIGURE DEFAULT DEVICE TYPE TO DISK;
new RMAN configuration parameters are successfully stored
starting full resync of recovery catalog
full resync complete



In the end, I even get back backupsets before refresh listed in catalog DB in few seconds.


RMAN> list backup summary;


List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
10519659 B     U SBT_TAPE    2016-JUL-13 18:31:25 1       1       NO         DLPX2015052818345511D6F7437298
10519660 B     U SBT_TAPE    2016-JUL-13 18:32:35 1       1       NO         DLPX2015052818345511D6F7437298
10519661 B     U SBT_TAPE    2016-JUL-13 18:34:04 1       1       NO         DLPX2015052818345511D6F7437298
...
10520973 B  F  A DISK        2016-DEC-21 16:38:15 1       1       YES        TAG20161221T163047
10520974 B  F  A DISK        2016-DEC-21 16:47:00 1       1       YES        TAG20161221T163047
10520975 B  F  A DISK        2016-DEC-21 16:53:40 1       1       YES        TAG20161221T163047
10520976 B  F  A DISK        2016-DEC-21 16:58:26 1       1       YES        TAG20161221T163047
10520977 B  F  A DISK        2016-DEC-21 17:00:34 1       1       YES        TAG20161221T163047
10520978 B  F  A DISK        2016-DEC-21 17:03:35 1       1       YES        TAG20161221T163047
10520979 B  F  A DISK        2016-DEC-21 17:04:23 1       1       YES        TAG20161221T163047
10520980 B  F  A DISK        2016-DEC-21 17:05:07 1       1       YES        TAG20161221T163047
10520981 B  F  A DISK        2016-DEC-21 17:07:17 1       1       YES        TAG20161221T163047
10520982 B  F  A DISK        2016-DEC-21 17:09:28 1       1       YES        TAG20161221T163047
10520983 B  F  A DISK        2016-DEC-21 17:12:34 1       1       YES        TAG20161221T163047
10520984 B  F  A DISK        2016-DEC-21 17:13:47 1       1       YES        TAG20161221T163047
10520985 B  F  A DISK        2016-DEC-21 17:14:44 1       1       YES        TAG20161221T163047
10520986 B  F  A DISK        2016-DEC-21 17:15:01 1       1       YES        TAG20161221T163047
10520987 B  F  A DISK        2016-DEC-21 17:15:33 1       1       YES        TAG20161221T163047
10520988 B  F  A DISK        2016-DEC-21 17:15:50 1       1       YES        TAG20161221T163047
10520989 B  F  A DISK        2016-DEC-21 17:16:47 1       1       YES        TAG20161221T163047
10520990 B  F  A DISK        2016-DEC-21 17:18:01 1       1       YES        TAG20161221T163047
10520991 B  F  A DISK        2016-DEC-21 17:18:26 1       1       YES        TAG20161221T163047
10520992 B  F  A DISK        2016-DEC-21 17:20:53 1       1       YES        TAG20161221T163047
10520993 B  F  A DISK        2016-DEC-21 17:22:16 1       1       YES        TAG20161221T163047
10520994 B  F  A DISK        2016-DEC-21 17:23:05 1       1       YES        TAG20161221T163047
10520995 B  F  A DISK        2016-DEC-21 17:24:21 1       1       YES        TAG20161221T163047
10520996 B  F  A DISK        2016-DEC-21 17:25:24 1       1       YES        TAG20161221T163047
10520997 B  F  A DISK        2016-DEC-21 17:26:13 1       1       YES        TAG20161221T163047
10520998 B  F  A DISK        2016-DEC-21 17:27:57 1       1       YES        TAG20161221T163047
10520999 B  F  A DISK        2016-DEC-21 17:28:30 1       1       YES        TAG20161221T163047
10521000 B  F  A DISK        2016-DEC-21 17:29:31 1       1       YES        TAG20161221T163047
10521092 B  F  A DISK        2016-DEC-21 17:29:34 1       1       NO         TAG20161221T172934
10568384 B  F  A DISK        2016-DEC-22 12:41:04 1       1       NO         TAG20161222T124104
10568391 B  F  A DISK        2016-DEC-22 11:42:06 1       1       YES        TAG20161222T114206
10568401 B  F  A DISK        2016-DEC-22 11:49:41 1       1       YES        TAG20161222T114206
10568413 B  F  A DISK        2016-DEC-22 11:58:26 1       1       YES        TAG20161222T114206
10568426 B  F  A DISK        2016-DEC-22 12:05:12 1       1       YES        TAG20161222T114206
10568440 B  F  A DISK        2016-DEC-22 12:09:57 1       1       YES        TAG20161222T114206
10568455 B  F  A DISK        2016-DEC-22 12:12:02 1       1       YES        TAG20161222T114206
10568471 B  F  A DISK        2016-DEC-22 12:14:57 1       1       YES        TAG20161222T114206
10568488 B  F  A DISK        2016-DEC-22 12:15:43 1       1       YES        TAG20161222T114206
10568506 B  F  A DISK        2016-DEC-22 12:16:28 1       1       YES        TAG20161222T114206
10568525 B  F  A DISK        2016-DEC-22 12:18:43 1       1       YES        TAG20161222T114206
10568545 B  F  A DISK        2016-DEC-22 12:20:48 1       1       YES        TAG20161222T114206
10568566 B  F  A DISK        2016-DEC-22 12:23:54 1       1       YES        TAG20161222T114206
10568588 B  F  A DISK        2016-DEC-22 12:25:09 1       1       YES        TAG20161222T114206
10568611 B  F  A DISK        2016-DEC-22 12:26:14 1       1       YES        TAG20161222T114206
10568635 B  F  A DISK        2016-DEC-22 12:26:39 1       1       YES        TAG20161222T114206
10568660 B  F  A DISK        2016-DEC-22 12:27:04 1       1       YES        TAG20161222T114206
10568686 B  F  A DISK        2016-DEC-22 12:27:20 1       1       YES        TAG20161222T114206
10568713 B  F  A DISK        2016-DEC-22 12:28:25 1       1       YES        TAG20161222T114206
10568741 B  F  A DISK        2016-DEC-22 12:29:40 1       1       YES        TAG20161222T114206
10568770 B  F  A DISK        2016-DEC-22 12:30:05 1       1       YES        TAG20161222T114206
10568800 B  F  A DISK        2016-DEC-22 12:32:30 1       1       YES        TAG20161222T114206
10568831 B  F  A DISK        2016-DEC-22 12:33:56 1       1       YES        TAG20161222T114206
10568863 B  F  A DISK        2016-DEC-22 12:34:41 1       1       YES        TAG20161222T114206
10568896 B  F  A DISK        2016-DEC-22 12:35:56 1       1       YES        TAG20161222T114206
10568930 B  F  A DISK        2016-DEC-22 12:37:01 1       1       YES        TAG20161222T114206
10568965 B  F  A DISK        2016-DEC-22 12:37:47 1       1       YES        TAG20161222T114206
10569001 B  F  A DISK        2016-DEC-22 12:39:32 1       1       YES        TAG20161222T114206
10569038 B  F  A DISK        2016-DEC-22 12:40:07 1       1       YES        TAG20161222T114206



Wednesday, November 30, 2016

database link between Vertica/non-Vertica database

Summarize some research about database link  between Vertica/non-Vertica database


As of now, DB links feature in not present in Vertica. We can not create Vertica database links like those that exist in Oracle and SQL Server. Moreover, we cannot run two databases simultaneously at one time in Vertica cluster.

But we can easily connect to another Vertica database if we need to to copy data between two Vertica databases. See the SQL Reference Manual:
CONNECT TO VERTICA database USER username PASSWORD 'password' ON 'host',port

For copy ORACLE data to Vertica, once can uses a unix shell script. Use COPY command in Vertica. In a shell script, pipe the output from oracle to Vertica in COPY command ( using input as STDIN) and then run the script. This shell script can also be used as STORED PROC in Vertica and running this Stored Proc from Vertica will pull the data from Oracle to Vertica.

For table join, if it requires join two tables in two Vertica databases, why not use two different schemas in same cluster/database  which can act as two different database.

Create Linkserver from SQL Server to Vertica via ODBC is possible, however there can have  performance concern.

Thursday, November 24, 2016

install 32bit instantclient ODBC for 64bit windows 2008 R2

One of my developer encountered similar issue in this nice article .

His creates Visual Basic form in MS Office Excel to pull data from Oracle database, while the Excel is 32 bits installed in his 64 bits windows 7 , hence requires 32 bits ODBC for this to work.















Launch 32bit ODBC configuration program (ODBC Data Source ) C:\Windows\SysWOW64, we can see there is "Microsoft ODBC for Oracle".  This is the same finding for his target depLoying server (windows 2008R2).  I was thinking no more 32bits  "Microsoft ODBC for Oracle" in windows 2008, which is wrong.


The server has 64 bits oracle client already installed for other application,

Luckily  I notice there is 32bit ODBC for 11g instantclient.  This is help to minimize the impact.


Follow the instantclient ODBC installation guide :
1. run odbc_install.exe as administrator in command prompt.
2. Append path of instantclient (e:\instantclient11203) to system environment variable PATH
3. create tnsnames.ora in e:\instantclient11203\netwoork\admin\

Missing part of the guide is : Launch 32bit ODBC configuration program (ODBC Data Source ) C:\Windows\SysWOW64\odbcad32.exe,

After this, my developer told me that his program can run suddenly.






Reference:

MS ODBC for Oracle

Oracle ODBC Centre

Friday, September 30, 2016

SQL Server 2000 audit

There might be a requirement to audit failure logins.

sp_readerrorlog works in charm for version 2005 and above, however it is not in sql server 2000.

As it has different format for parameters. After spent some time, I finally find out how to use it correctly.
eg.

 Exec sp_readerrorlog 1,'D:\test.txt' ,  'world'   # grep all lines having the word

 Exec sp_readerrorlog 1,'D:\test.txt' , 3  # read 3rd line

 Exec sp_readerrorlog 1,'D:\mediator_dev\MSSQL$MED\LOG\ERRORLOG','Backup'



from
http://www.databasejournal.com/features/mssql/article.php/3399241/SQL-Server-2000-Security---Part-10---Auditing.htm

Login auditing - four option buttons - None, Success, Failure and All - under the "Audit level" heading on the Security tab of the SQL Server Properties dialog box in SQL Server Enterprise Manager control level of SQL Server login audits. These choices correspond to values of 0, 1, 2 and 3 in the AuditLevel entry in the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQLServer\ registry key AuditLevel of DWORD data type. This value determines whether login attempts with specified outcome (or any at all) will be recorded in the Windows Application Event Log and SQL Server error log.

It seems by default audit level is 0.



References:

http://vyaskn.tripod.com/sp_readerrorlog_undocumented.htm


Wednesday, September 14, 2016

install nerdtree with vbundle for vim

1. preparation

    touch ~/.vimrc
    mkdir~/.vim/bundle

2. install vbundle

git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
 

3. add the following to .vimrc

set nocompatible               " be iMproved
filetype off                   " required!

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" let Vundle manage Vundle
" required! 
Bundle 'gmarik/vundle'

" My Bundles here:

filetype plugin indent on     " required!
"
" Brief help
" :BundleList          - list configured bundles
" :BundleInstall(!)    - install(update) bundles
" :BundleSearch(!) foo - search(or refresh cache first) for foo
" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
"
" see :h vundle for more details or wiki for FAQ
" NOTE: comments after Bundle command are not allowed.. 
 
 

4. install NERDTree, add the bundle name to .vimrc


call vundle#begin()

     
Bundle 'scrooloose/nerdtree'

call vundle#end()  



 5. re-launch vi, and type the :BundleInstall command to install the nerdtree.


6.  verify able to launch nerdtree, by typing ":NERDTree" . Note that the command is sensitive.

7. create hotkey  F2 for NERDTRee:  add below line to .vimrc.

 
 

 
some commands I learned easilly:
 
ctr+w+h  光标移到左侧树形目录,
ctrl+w+l 光标移到右侧文件显示窗口
ctrl + w + w    光标自动在左右侧窗口切换
 
   o 打开关闭文件或者目录

   t 在标签页中打开

  T 在后台标签页中打开

  ! 执行此文件

  p 到上层目录

  P 到根目录

  K 到第一个节点

  J 到最后一个节点
 k  previous
j  next 
  

tabs commands are what I am thinking to google,but already there.

:tabnew [++opt选项] [+cmd] 文件      建立对指定文件新的tab
:tabc   关闭当前的 tab
:tabo   关闭所有其他的 tab
:tabs   查看所有打开的 tab
:tabp   前一个 tab
:tabn   后一个 tab
 
 
 
and more to practice noted below.


ctrl + w + r    移动当前窗口的布局位置
go      在已有窗口 中打开文件、目录或书签,但不跳到该窗口
i       split 一个新窗口打开选中文件,并跳到该窗口
gi      split 一个新窗口打开选中文件,但不跳到该窗口
s       vsplit 一个新窗口打开选中文件,并跳到该窗口
gs      vsplit 一个新 窗口打开选中文件,但不跳到该窗口
!       执行当前文件
O       递归打开选中 结点下的所有目录
x       合拢选中结点的父目录
X       递归 合拢选中结点下的所有目录
e       Edit the current dif
双击    相当于 NERDTree-o
中键    对文件相当于 NERDTree-i,对目录相当于 NERDTree-e
D       删除当前书签
C       将选中目录或选中文件的父目录设为根结点
u       将当前根结点的父目录设为根目录,并变成合拢原根结点
U       将当前根结点的父目录设为根目录,但保持展开原根结点
r       递归刷新选中目录
R       递归刷新根结点
m       显示文件系统菜单
cd      将 CWD 设为选中目录
I       切换是否显示隐藏文件
f       切换是否使用文件过滤器
F       切换是否显示文件
B       切换是否显示书签
 

also reviewed commands to execute external commands.

:shell or just :sh  or Ctrl-z  and fg


:r textfile
:r ! ls -1 /home/user/directory


Installation on cygwin

Followed this article, I easily installed NERDTree  to the vim.

https://my.oschina.net/VASKS/blog/388907


Installed more bundle from  http://www.zlovezl.cn/articles/vim-plugins-cannot-live-without/


In short time, I built up my own .vimrc as shown below.

hmc@hmc-P55A-UD3:~$ cat .vimrc
syntax enable
syntax on
set nocompatible              " be iMproved, required
filetype off                  " required

set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()

   
Bundle 'scrooloose/nerdtree'
Bundle 'jistr/vim-nerdtree-tabs'
Bundle 'scrooloose/syntastic'
Bundle 'Valloric/YouCompleteMe'
Bundle 'vim-airline/vim-airline'
Bundle 'chriskempson/base16-vim'
Bundle 'majutsushi/tagbar'

call vundle#end()            " required
filetype plugin indent on    " required

nmap :NERDTreeToggle
let g:nerdtree_tabs_open_on_console_startup=1
map n NERDTreeTabsToggle


" for YCM

" 设置跳转到方法/函数定义的快捷键
 nnoremap j :YcmCompleter GoToDefinitionElseDeclaration
 " 触发补全快捷键
let g:ycm_key_list_select_completion = ['', '', '']
let g:ycm_key_list_previous_completion = ['', '', '']
let g:ycm_auto_trigger = 1
" 最小自动触发补全的字符大小设置为 3
let g:ycm_min_num_of_chars_for_completion = 3
" YCM的previw窗口比较恼人,还是关闭比较好
set completeopt-=preview




References:



http://williamherry.com/blog/2012/07/16/master-vim-01-vundle/
http://williamherry.com/blog/2012/07/19/master-vim-02-nerdtree/

https://my.oschina.net/VASKS/blog/388907
https://www.linux.com/learn/vim-tips-working-external-commands
http://os.51cto.com/art/201507/484174.htm

http://blog.csdn.net/namecyf/article/details/7787479

Wednesday, September 07, 2016

cut and paste for vi

--For Solaris, AIX , HP-UX platform

shift + v    # for copy to clipboard
dd             # delete the line
p               # paste



--For Linux platform

shift + v
d            # delete the line, slightly different with Solaris
p


Ref: http://stackoverflow.com/questions/8773299/how-to-cut-an-entire-line-in-vim-and-paste-it

Monday, August 29, 2016

laztoapk demo compliation error: cannot find crtbegin_so.o

with the help of laztoapk v0.9.0.35, which speeds up the setup in windows platform.

However, I hit below error when complile the example project.

D:\laztoapk\downloads\laz4android\fpc\3.0.0\bin\i386-win32\arm-linux-androideabi-ld.bfd.exe: cannot find crtbegin_so.o


after reading http://wiki.freepascal.org/Android_tutorial#Compile_the_demo_.22androidlcl.22  

I notice the library path in default value of "project option/compilation option/path / library " is not correct, where it is
D:\android-ndk-r10e\platforms\android-8\arch-arm\usr\lib\;D:\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\lib\gcc\arm-linux-androideabi\4.9\

they are not my actual path,  Missing the "prefix" path  -   "D:\laztoapk\downloads"  for my environment.

Corrected them as shown below, and recompilation succeed!


D:\laztoapk\downloads\android-ndk-r10e\platforms\android-8\arch-arm\usr\lib\;D:\laztoapk\downloads\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\lib\gcc\arm-linux-androideabi\4.9\


 and I contributed the answer to http://forum.lazarus.freepascal.org/index.php/topic,22414.30.html


Hope this help the author if this is a bug.

Wednesday, August 17, 2016

Integration of Oracle Client and Lazarus

In Linux64/Windows64, when launch Lazarus 1.6, it reports can't find oci.dll. And even worse in Windows64, the TOracleConnection icon is not found in sqldb component tab. (While in windows32, at least I can see component tab).

From these symptoms, I conclude something wrong with the integration between Lazarus and Oracle client.

Googled one article says, 11g client is buggy, while 12c works better.  As such, I upgraded my oracle client from 11.2.0.1 to 11.2.0.4 to prevent this issue.  (No time to verify his finding)

From some more articles related to install Oracle InstantClient, I realize the environment variable LD_LIBRARY_PATH is the key to tell Lazarus where to find the relevant library file like oci.dll.

I compared and found oci.dll is under $ORACLE_HOME/bin, (surprisingly not $ORACLE_HOME/lib ), thus I set LD_LIBRARY_PATH to the bin directory.  with this setting I see no more missing oci.dll message.

Next, I follow the same article to continue fixing the missing TOracleConnection component.  step1, 2, 3, compiling ... ,  restart IDE, Finally I see the icon there.


Big Thanks  to


Here, add some more info related to his step 3.

Step 3: Enabling the TOracleConnection in your Lazarus installation again. You have to go to the "Package" menu entry. Select "Open loaded Package". In the dialog you select the package "sqldblaz". Now click "add" and go to the tab "Add files". Then browse to the file "oracleconnection.pp" under "[Lazarus directory]\fpc\2.6.2\source\packages\fcl-db\src\sqldb\oracle" and add it to the package. The next step is, to change the file "registersqldb". Search for the first occurence of 
{$DEFINE HASORACLECONNECTION}
It's in an {$IFNDEF WIN64} section. You need to move it out there. I moved it under the line 
{$DEFINE HASSYBASECONNECTION}
. Then save the file, compile the package via "compile" button. If it compiled successfully, click the button "use" and then "install". Now your Lazarus should be build new. After strating the IDE again, 

The registersqldb is  D:\lazarus64\components\sqldb\registersqldb.pas, and my modification to file as shown in the screenshot.






 




Tuesday, June 14, 2016

RMAN-06214: Archivelog , controlfile copy

1. for archived log file

RMAN-06207: WARNING: 677 objects could not be deleted for DISK channel(s) due
RMAN-06208:          to mismatched status.  Use CROSSCHECK command to fix status
RMAN-06210: List of Mismatched objects
RMAN-06211: ==========================
RMAN-06212:   Object Type   Filename/Handle
RMAN-06213: --------------- ---------------------------------------------------
RMAN-06214: Archivelog      /archive/testdb01/arch_822080339_219_1.arc
RMAN-06214: Archivelog      /archive/testdb01/arch_822080339_220_1.arc
RMAN-06214: Archivelog      /archive/testdb01/arch_822080339_221_1.arc
RMAN-06214: Archivelog      /archive/testdb01/arch_822080339_222_1.arc
RMAN-06214: Archivelog      /archive/testdb01/arch_822080339_223_1.arc
RMAN-06214: Archivelog      /archive/testdb01/arch_822080339_224_1.arc



This is simple to clear with one command: crosscheck archivelog all;

After which, just issue :  DELETE NOPROMPT OBSOLETE device type disk;



2. for controlfile copy, I have to crosscheck for each file copy name. i.e.

run {
allocate channel c1 ;
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_DAL_testdb01.2015516.210';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_AL_testdb01.2015517.30';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_DAL_testdb01.2015517.90';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_AL_testdb01.2015517.150';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_DAL_testdb01.2015517.210';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_AL_testdb01.2015518.30';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_DAL_testdb01.2015518.90';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_AL_testdb01.2015518.150';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_DAL_testdb01.2015518.210';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_AL_testdb01.2015519.30';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_DAL_testdb01.2015519.90';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_AL_testdb01.2015519.151';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_DAL_testdb01.2015519.210';
crosscheck controlfilecopy '/oracle/node1/admin/testdb01/cntrl/ctrlf.BILLDB21_AL_testdb01.2015520.30';

DELETE NOPROMPT OBSOLETE device type disk;

release channel c1;
}






Thursday, June 02, 2016

Ah, 11g OEM can't support my 12c PDB acting as Recovery Catalog


See the SID being used ?  In 12c, I don't see there is SID for 12c portable database. That is the problem.

NMO not setuid-root (Unix-only)

come across with above error when using Enterprise Manager, dealing with backup & recovery.

Referred to below two pages, to confirm they are same problem & solution.

https://community.oracle.com/thread/383358?start=0&tstart=0
https://dba010.wordpress.com/2011/07/18/error-connection-to-host-as-user-oracle-failed-error-nmo-not-setuid-root-unix-only/



My problem solved after ask system administrator to help run the root.sh too.


Monday, May 30, 2016

ORA-17628: Oracle error 17629 returned by remote Oracle server

when resync catalog

rman target / catalog rman/@RCAT

RMAN> RESYNC CATALOG FROM DB_UNIQUE_NAME DGs;


RMAN>
user interrupt received
RESYNC CATALOG FROM DB_UNIQUE_NAME DG;

resyncing from database with DB_UNIQUE_NAME DG
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of resync from db_unique_name command on default channel at 05/26/2016 16:19:54
ORA-17629: Cannot connect to the remote database server


changed to use password connection

orarac2poc:DGS:/home/oracle/ops/logs> rman target sys/ catalog rman/@RCAT

Recovery Manager: Release 11.2.0.4.0 - Production on Thu May 26 16:20:01 2016

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

connected to target database: DG (DBID=1716975309)
connected to recovery catalog database

RMAN> RESYNC CATALOG FROM DB_UNIQUE_NAME DG;

resyncing from database with DB_UNIQUE_NAME DG
starting full resync of recovery catalog
full resync complete

RMAN> RESYNC CATALOG FROM DB_UNIQUE_NAME all;


resyncing from database with DB_UNIQUE_NAME DG
starting full resync o

Friday, May 27, 2016

data guard SwitchOver using cloud control

When encounter this message in cloud control "You must reconnect to the current standby apply instance to perform the operation".

This means I have to connect to standby database as target, before the switch over can be performed. As currently I am connecting to primary database as target, which is not correct. 

wrong agent token when start cloud control agent

[symptoms]

orarac2poc:ORCL2:/home/oracle> . ./oms_agent_env
orarac2poc:ORCL2:/home/oracle> $AGENT_HOME/bin/emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 2
Copyright (c) 1996, 2012 Oracle Corporation.  All rights reserved.
Starting agent .................................. failed.
Target Manager failed at Startup: targets.xml was rejected: loaded with a wrong agent token
Consult emctl.log and emagent.nohup in: /u01/app/oracle/agent12c/agent_inst/sysman/log


error message in emctl.log

UID        PID  PPID  C STIME TTY          TIME CMD
oracle   32708 29131  0 11:28 pts/3    00:00:00 /bin/sh -f /u01/app/oracle/agent12c/core/12.1.0.2.0/bin/emctl start agent

----
32717 :: Fri May 27 11:28:34 2016::EM_SECURE_HOSTNME: orarac2poc
32717 :: Fri May 27 11:28:34 2016::EM_SECURE_PORT: 3872
32717 :: Fri May 27 11:28:34 2016::EM_LISTEN_ON_ALL_NICS: true
32717 :: Fri May 27 11:28:36 2016::AgentLifeCycle.pm:status agent returned with retCode=1
32758 :: Fri May 27 11:28:36 2016::AgentLifeCycle.pm: Launching the watchdog process.
32758 :: Fri May 27 11:28:37 2016::TZ = Asia/Singapore, Read = Asia/Singapore. Found = 1.
32758 :: Fri May 27 11:28:37 2016::agentTZRegion successfully validated.
32758 :: Fri May 27 11:28:37 2016::AgentTuning.pm: Launching emdctl with -Xmx1024m
32758 :: Fri May 27 11:28:38 2016::AgentStatus.pm:emdctl run_autotune returned 0
32717 :: Fri May 27 11:28:36 2016::AgentLifeCycle.pm: Launched the watchdog process pid=32758
32717 :: Fri May 27 11:28:36 2016::AgentLifeCycle.pm: StartCEMD start retryCount=120
32717 :: Fri May 27 11:28:53 2016::AgentLifeCycle.pm: StartCEMD status message file detected
32717 :: Fri May 27 11:28:53 2016::Found Msg file with: {1464319733039,initializing}
32717 :: Fri May 27 11:28:53 2016::AgentLifeCycle.pm: StartCEMD Querying for the real status of the agent
32717 :: Fri May 27 11:28:57 2016::AgentLifeCycle.pm: StartCEMD status message file detected
32717 :: Fri May 27 11:28:57 2016::Found Msg file with: {1464319733039,initializing}
32717 :: Fri May 27 11:28:57 2016::AgentLifeCycle.pm: StartCEMD Querying for the real status of the agent
32717 :: Fri May 27 11:29:00 2016::AgentLifeCycle.pm:Watch dog processs id: 32758 exited with an exit code of 55
32717 :: Fri May 27 11:29:00 2016::AgentLifeCycle.pm: Exited loop retryCount=103 with retCode=1
32717 :: Fri May 27 11:29:00 2016::AgentLifeCycle.pm: StartCEMD Querying for the real status of the agent
32717 :: Fri May 27 11:29:02 2016::AgentLifeCycle.pm: Check agent status retCode=1
32717 :: Fri May 27 11:29:02 2016::TZ: EmctlLogAvailabilityMarker Operation=start Diag=failed


error message in emagent.nohup

 -----
 --- EMState agent
----- Fri May 27 11:28:37 2016::32758::Auto tuning the agent at time Fri May 27 11:28:37 2016 -----
----- Fri May 27 11:28:38 2016::32758::Finished auto tuning the agent at time Fri May 27 11:28:38 2016 -----
----- Fri May 27 11:28:38 2016::32758::Launching the JVM with following options: -Xmx140M -XX:MaxPermSize=96M -server -Djava.security.egd=file:///dev/./urandom -Dsun.lang.ClassLoader.allowArraySyntax=true -XX:+UseLinuxPosixThreadCPUClocks -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -----
----- Fri May 27 11:28:38 2016::337::Time elapsed between Launch of Watchdog process and execing EMAgent is 2 secs -----
----- Fri May 27 11:28:38 2016::32758::Agent Launched with PID 337 at time Fri May 27 11:28:38 2016 -----
2016-05-27 11:28:39,131 [1:main] WARN - Missing filename for log handler 'wsm'
2016-05-27 11:28:39,141 [1:main] WARN - Missing filename for log handler 'opss'
2016-05-27 11:28:39,142 [1:main] WARN - Missing filename for log handler 'opsscfg'
----- Fri May 27 11:28:58 2016::32758::Checking status of EMAgent : 337 -----
----- Fri May 27 11:28:58 2016::32758::EMAgent exited at Fri May 27 11:28:58 2016 with return value 55. -----
----- Fri May 27 11:28:58 2016::32758::EMAgent has exited due to initialization failure. -----
----- Fri May 27 11:28:58 2016::32758::Stopping other components. -----
----- Fri May 27 11:28:58 2016::32758::Commiting Process death. -----
----- Fri May 27 11:28:58 2016::32758::Generating additional diagnostics for 337 -----
----- Fri May 27 11:28:58 2016::32758::Generating openfiles report in /u01/app/oracle/agent12c/agent_inst/sysman/log/lsof_337 -----
----- Fri May 27 11:28:58 2016::32758::Generating netstat report in /u01/app/oracle/agent12c/agent_inst/sysman/log/netstat_337 -----
----- Fri May 27 11:28:59 2016::32758::Generating all host processes report in /u01/app/oracle/agent12c/agent_inst/sysman/log/allprocesses_337 -----
----- Fri May 27 11:28:59 2016::32758::Exiting watchdog loop
targets.xml was rejected: loaded with a wrong agent token


when configure recovery catalog in cloud control

Validation Error
Examine and correct the following errors, then retry the operation:
Host Credentials - unable to connect to the agent at https://orarac2poc:3872/emd/main/ [Connection refused]


[solution]

found the advice in https://community.oracle.com/thread/3674803?start=0&tstart=0

--> Move your existing target.xml file
mv target.xml target.xml.old


--> Create an empty targets.xml file under /AGENT_INST/sysman/emd with the below content


--> Start the agent


$AGENT_INST/bin/emctl start agent
This starts agent but without any targets populated in targets.xml


To discover targets perform agent resynchronization operation from console



orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> cat targets.xml

       
               
               
               
               
               
               
               
               
               
               
...

       
       
               
               
               
               
               
               
               
       

orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> mv  targets.xml targets.xml.bak
orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> vi targets.xml
orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> cat targets.xml






orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> $AGENT_HOME/bin/emctl start agent
Oracle Enterprise Manager Cloud Control 12c Release 2
Copyright (c) 1996, 2012 Oracle Corporation.  All rights reserved.
Starting agent .............. started.


[VERIFICATION]

orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> netstat -an |grep 3872 |grep LIST
tcp        0      0 :::3872                     :::*                        LISTEN
unix  2      [ ACC ]     STREAM     LISTENING     397387209 /var/tmp/.oracle/sOracle_CSS_LclLstnr_clus_2
unix  2      [ ACC ]     STREAM     LISTENING     397387213 /var/tmp/.oracle/sOCSSD_LL_orarac2poc_clus



orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> cat targets.xml



AND after I add one database as managed target in cloud control, I notice the content of targets.xml got changed.


after a while ,prompt RCAT


orarac2poc:ORCL2:/u01/app/oracle/agent12c/agent_inst/sysman/emd> cat targets.xml

       
               
               
               
               
               
               
               
       









Wednesday, May 25, 2016

RMAN ORA-19606: Cannot copy or restore to snapshot control file

When RMAN needs to resynchronize the recovery catalog with a read-consistent version of the control file, it creates a temporary snapshot control file. RMAN needs a snapshot control file when resynchronizing with the recovery catalog or when making a backup of the current control file.
The default location for the snapshot control file is platform-specific and depends on the Oracle home of each target database. For example, the default filename on some Linux platforms is $ORACLE_HOME/dbs/snapcf_@.f


RMAN> delete obsolete;

starting full resync of recovery catalog
full resync complete
RMAN retention policy will be applied to the command
RMAN retention policy is set to redundancy 3
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=188 device type=DISK
Deleting the following obsolete backups and copies:
Type                 Key    Completion Time    Filename/Handle
-------------------- ------ ------------------ --------------------
Control File Copy     1123728 2016-JAN-19 14:33:21 /software/oratest/product/11.2.0/dbs/snapcf_TESTDB.f
Backup Set           1123715 2015-NOV-06 10:55:47

Do you really want to delete the above objects (enter YES or NO)? yes
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of delete command on ORA_DISK_1 channel at 05/25/2016 11:57:24
ORA-19606: Cannot copy or restore to snapshot control file


SOLUTION

Not sure why this happens, but the solution is to configure a different snapshot controlfile name so that RMAN can use that, thus allowing you to remove the “old” one. Then configure back to what you had:
configure snapshot controlfile name to '/tmp/it.f';
crosscheck controlfilecopy "/oracle/product/11.2.0.2/dbs/snapcf_P10AC.f";
delete expired controlfilecopy "/oracle/product/11.2.0.2/dbs/snapcf_P10AC.f";
delete noprompt obsolete;
configure snapshot controlfile name to '/oracle/product/11.2.0.2/dbs/snapcf_P10AC.f';