2024/11/14 14:26:29
一些特殊场景下的gsql连接方式
gsql -r "postgresql://system:oracle@127.0.0.1:26200/testdb"
gsql -r "postgresql://127.0.0.1:26200,127.0.0.2:26200/testdb?user=system&password=orac
le"
gsql -r "host=127.0.0.1,127.0.0.2 port=26200 user=system dbname=testdb password=oracle
target_session_attrs=primary"
gsql -r "host=127.0.0.1 port=26200 user=system dbname=testdb password=oracle application_name=shell"
2024/10/28 09:25:03
本站后台数据库已从h2切换成MogDB 5.2.0版本-20241028
2024/10/10 21:45:03
又被一个IP攻击了
79.124.56.186
https://otx.alienvault.com/indicator/ip/79.124.56.186
2024/09/26 13:28:43
winscp删除文件目录时,在SFTP和FTP协议的情况下,会对每个文件单独发送删除命令,如果该目录文件数特别多,删除就会很慢,此时有两种方式
一、打开终端,在终端里用命令删
二、给winscp添加自定义命令
Deleting on Background
Use the following command to delete a large directory structure in a separate process:
cmd /C start "" cmd /C ""%WINSCP_PATH%\WinSCP.com" /command "open !E" "cd !/" "rm !&" "exit" & "%WINSCP_PATH%\WinSCP.exe" "!E" /refresh "!/""
Check custom command options Local command, Apply to directories and Use remote files.
注意勾上 本地命令、应用到目录、使用远端文件
之后删除的时候,选择目录,然后鼠标右键,文件自定义命令,点刚刚加好的名称即可
2024/09/23 15:39:24
在oracle19c中,有个函数getlong,可以在查询sql中将long类型的字段返回成varchar2类型,用法如下
select getlong(1,rowid),t.* from VIEW$ t;
但是需要注意,这个函数只能查两个表里的long类型,内部实现如下
if (opcode = 1) then
tablename := 'SYS.VIEW$';
colname := 'TEXT';
elsif (opcode = 2) then
tablename := 'SYS.CDEF$';
colname := 'CONDITION';
else
return NULL;
end if;
stmt := 'SELECT ' || colname || ' FROM ' || tablename ||
' WHERE ROWID = :1';
CDBView_internal.long2varchar2_i(stmt, p_rowid, retval);
return retval;
如果需要支持查其他表的,需要再自行封装,调用CDBView_internal.long2varchar2_i
从rowid里,理论上是可以解析出来对应的表的,感觉ORACLE这里的实现其实有点草台班子了。至于字段名,也可以传个字段名的字符串进去
其实ORACLE的处理思路和aktom的一个帖子比较像 https://asktom.oracle.com/ords/f?p=100:11:0::::P11_QUESTION_ID:839298816582
成品
create or replace function long2varchar(p_colname in varchar2, p_rowid in rowid)
return varchar2 as
tablename dbms_id;
stmt varchar2(400);
retval varchar2(4000);
PROCEDURE long2varchar2_i(stmt IN VARCHAR2,
rowid IN ROWID,
rowval IN OUT VARCHAR2) IS
EXTERNAL NAME "kpdbLong2Varchar2"
LANGUAGE C
LIBRARY DBMS_PDB_LIB
PARAMETERS(stmt OCIString,
stmt indicator sb4,
rowid OCIString,
rowid indicator sb4,
rowval OCIString,
rowval indicator sb4,
rowval length sb4,
rowval maxlen sb4);
begin
select owner || '.' || object_name
into tablename
from dba_objects t
where t.data_object_id = dbms_rowid.rowid_object(p_rowid);
stmt := 'SELECT ' || p_colname || ' FROM ' || tablename ||
' WHERE ROWID = :1';
long2varchar2_i(stmt, p_rowid, retval);
return retval;
end;
select long2varchar('TEXT',rowid),t.* from VIEW$ t;
2024/09/19 09:30:59
anylink最新客户端(win/mac/linux sourcecode)
https://github.com/Dark-Athena/anylink-client/releases/tag/continuous
2024/08/15 00:05:05
git合并提交
# 先看最近的几个提交
git log --oneline
# 如果想合并最近的3个提交变成1个
git rebase -i HEAD~3
# 输入 i ,进入编辑模式,原本是三行pick,把第二行和第三行的 pick 改成 s ,按 esc键退出编辑模式,再按 :wq! 保存
# 强制推送到远程
git push -f
2024/08/07 13:09:02
ORACLE里有个OWA_OPT_LOCK.checksum函数可以输入字符串计算返回一个数值(65525以内),可以用于数据校验,该代码未加密,可仿照移植
2024/07/28 00:38:01
在win10/11上安装openssh服务器和vim
https://github.com/vim/vim-win32-installer/releases/download/v9.1.0/gvim_9.1.0_x64_signed.exe
vim默认没有加到PATH环境变量中,需要手动加
2024/07/18 15:45:38
在线安装mogdb的命令-无脑版
# for ubuntu
hostnamectl set-hostname dbnode1 ## 机器名不能为localhost
curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh
source /root/.bashrc
ptk template --local > config.yaml
rm -rf root_fix*.sh
ptk checkos -f config.yaml
source `find . -name 'root_fix*.sh'`
ptk install -f config.yaml -y
# for centos
hostnamectl set-hostname dbnode1 ## 机器名不能为localhost
curl --proto '=https' --tlsv1.2 -sSf https://cdn-mogdb.enmotech.com/ptk/install.sh | sh
source /root/.bash_profile
ptk template --local > config.yaml
rm -rf root_fix*.sh
ptk checkos -f config.yaml
source `find . -name 'root_fix*.sh'`
ptk install -f config.yaml -y