Oracle 12C引入了CDB与PDB的新特性,在ORACLE 12C数据库引入的多租用户环境(Multitenant Environment)中,允许一个数据库容器(CDB)承载多个可插拔数据库(PDB)。CDB全称为Container Database,中文翻译为数据库容器,PDB全称为Pluggable Database,即可插拔数据库。

在安装或者维护数据库的过程中,可以通过DBCA对CDB进行静默删除(别问我为什么知道:))。步骤如下:

#dbca -silent -deleteDatabase -sourceDB CDB数据库名

耐心等待至命令完成,正常情况下会出现以下提示:

 
Connecting to database
4% complete
9% complete
14% complete
19% complete
23% complete
28% complete
47% complete
Updating network configuration files
52% complete
Deleting instance and datafiles
76% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/condb0.log" for further details.

一客户升级系统,准备把数据库升级到12C,操作系统切换到Redhat 7,而他们家系统管理员不但不熟Oracle数据库,还不熟Linux。只好请客户开了个Teamview连接,远程帮他们安装系统。因为连Linux都是供应商帮忙装了,没有装X window,只能选择静默安装了。开搞。

[heading]安装依赖包[/heading]

要说安装包最方便的方式,莫过于利用Oracle官方的源了。

# cd /etc/yum.repos.d

# wget http://yum.oracle.com/public-yum-ol7.repo

#vim public-yum-ol7.repo

把文件按如下修改:

[highlight dark=”no”][ol7_latest]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=https://yum.oracle.com/repo/OracleLinux/OL7/latest/$basearch/
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=0
enabled=1[/highlight]

然后运行oracle-database-server-12cR2-preinstall安装依赖包。

#yum install oracle-database-server-12cR2-preinstall

如果有问题可以采用以下方式。

#vim req-rpm.txt

在文件输入以下包名。

[highlight]binutils
compat-libcap1
compat-libstdc++-33
gcc
gcc-c++
glibc
glibc-devel
ksh
libgcc
libstdc++
libstdc++-devel
libaio
libaio-devel
libXext
libXtst
libX11
libXau
libxcb
libXi
make
sysstat
libXmu
libXt
libXv
libXxf86dga
libdmx
libXxf86misc
libXxf86vm
xorg-x11-utils
xorg-x11-xauth[/highlight]

保存退出后,运行以下命令安装。

#yum install `awk ‘{print $1}’  req-rpm.txt`

[heading]配置系统参数[/heading]

#vim /etc/sysctl.conf

增加以下内容:

[highlight]–kernel parameters for 12C installation
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500[/highlight]

使用内核参数生效

#/sbin/sysctl -p

#vim /etc/security/limits.conf

–shell limits for users oracle 12C

[highlight]oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768[/highlight]

#cat /etc/selinux/config

确认SELINUX设置如下:

[highlight dark=”no”]SELINUX=permissive
setenforce Permissive
[/highlight]

#service iptables stop

#chkconfig iptables off

[heading]创建oracle用户和组[/heading]

#groupadd -g 54321 oinstall

#groupadd -g 54322 dba

#groupadd -g 54323 oper

#useradd –u 54321 –g oinstall –G dba,oracle,oper

#passwd oracle

#mkdir –p /u01
#chown oracle:dba /u01
#chmod 775 /u01

[heading]安装数据库[/heading]

#su oracle

#unzip linuxx64_12201_database.zip

在解压文件夹的/database/response目录下,复制db_install.rsp文件到/home/oracle/oinstall/oracle/database目录下。

#vim db_install.rsp

[highlight]oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=dba
oracle.install.db.OSBACKUPDBA_GROUP=dba
oracle.install.db.OSDGDBA_GROUP=dba
oracle.install.db.OSKMDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.OSRACDBA_GROUP=dba
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
DECLINE_SECURITY_UPDATES=true[/highlight]

#./runInstaller -silent -responseFile
/home/oracle/oinstall/database/db_install.rsp

完成数据库软件安装,切到root用户,运行以下脚本。

# /u01/app/oraInventory/orainstRoot.sh

#/u01/app/oracle/product/12.2.0.1/dbhome_1/root.sh

完成数据库软件安装。

[heading]静默创建数据库[/heading]

类似上面步骤,复制dbca.rsp到当前目录。

#vim dbca.rsp

[highlight]gdbName=orcl
sid=orcl
databaseConfigType=SI
createAsContainerDatabase=false
templateName=General_Purpose.dbc
sysPassword=oracle12C
systemPassword=oracle12C
emConfiguration=NONE
datafileDestination=/u01/oradata
recoveryAreaDestination=/u01/recovery_area
storageType=FS
characterSet=AL32UTF8
sampleSchema=TRUE[/highlight]

#export ORACLE_HOME=/u01/app/oracle/product/12.2.0.1/dbhome_1

#export PATH=$ORACLE_HOME/bin:$PATH.

#dbca -silent -createDatabase -responseFile dbca.rsp

完成数据库创建。

[heading]创建监听器[/heading]

类似上面步骤,复制netca.rsp到当前目录。

#netca -silent  -responseFile netca.rsp

完成安装后,验证监听器状态正常。

#lsnrctl status

对于度娘百度云的鸡贼限速实在无话可说,对于合作伙伴把ISO文件放在度盘让俺去下载的丧心病狂行径更加是深恶痛绝。哥忍着病疼周末加班处理问题居然要花大量时间去等工具下载完成。叔可忍婶不可忍,只能想办法把东西下载回来。

开搞。

 

[heading]1.先安装Chrome百度网盘助手插件[/heading]

在https://github.com/acgotaku/BaiduExporter下载BaiduExporter.crx,手动安装到Chrome。

 

 

[heading]2.安装Aria2[/heading]

[highlight dark=”no”]sudo apt-get install aria2[/highlight]

 

 

[heading]3.下载文件[/heading]

打开度盘,选中你要下载的文件,选择导出下载菜单的文本导出。把显示的文件内容复制下来,然后在粘贴到命令框即可下载。

 

如果被度娘断开连接,可以重新输入命令实现断点续传。

好久没写东西,强迫自己水一个。最近有报道说黑客利用Weblogic Server的漏洞去挖矿,获得了至少611个门罗币(XMR),总价值达到了22.6万美元。第一反应是把自家的服务器打上补丁,打了patch后想看看有没有生效,才发现以前”java -weblogic.version”的方法不好使了。

放狗搜了一把,才知道从weblogic版本12.1.2.0.0后,因为使用opatch的方式统一管理补丁,所以查看PSU的方式也改变了。

依据Doc ID 1676652.1的方法如下:

[highlight dark=”no”]cd $MW_HOME/OPatch
./opatch lsinventory[/highlight]

从Weblogic控制台可以看到当前的Weblogic版本:

[highlight dark=”no”]Go to the Servers link
Customize this table
Check the WebLogic Version box and add it to the right side
Click Apply[/highlight]

一直习惯用Sublime里写代码,最近为了调试几个JET程序,想装个Netbeans 8.2,结果运行安装程序时,却出现一个奇怪的错误。
[heading]问题描述[/heading]
启动Netbeans安装程序,第一个窗口出来后就闪退,在安装程序目录下生成一个名字为“hs_err_pidxxxx.log”的文件,提示有致命错误。信息如下:

[highlight]

#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# If you would like to submit a bug report, please visit:
# http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#


--------------- T H R E A D ---------------


Current thread (0x000000001921b800): JavaThread "Swing-Shell" daemon [_thread_in_native, id=6636, stack(0x000000001a1e0000,0x000000001a2e0000)]


siginfo: ExceptionCode=0xc0000005, reading address 0x0000000000000000


Registers:
RAX=0x0000000000000000, RBX=0x000000001a2df130, RCX=0x0000000000000000, RDX=0x0000000000cc8700
RSP=0x000000001a2df0d8, RBP=0x000000001a2df2c0, RSI=0x00000000000000e0, RDI=0x000000001921b9f8
R8 =0x0000000000cc8700, R9 =0x0000000000000000, R10=0x0000000000000000, R11=0x000000001a2dc2f0
R12=0x0000000000000000, R13=0x000000001a2df2e0, R14=0x000000001a2df2a8, R15=0x000000001921b800
RIP=0x0000000056926adf, EFLAGS=0x0000000000010246
......

[/highlight]

然后安装程序自动退出。

[heading]解决方法[/heading]
放狗搜了下,有人说是因为升级到最新版本的Win10所致。但经俺自己试验,其实系统上有God Folder导致,不管是God Folder是存在C盘还是桌面。把God Folder暂时挪至回收站,重新安装Netbeans,顺利完成。

把公司的内容管理系统全面迁移到Docker上重新部署,把备份的归档文件导入时发现报错没法导入,最后把自定义的元数据去掉后导入成功。但是原来利用文件类型的层级关系定义了很多子类型,都去掉的话很多查询的条件不能使用,积累的内容基本废了一半。
[heading]问题描述[/heading]
尝试在WebCenter Content里更新内容元数据信息,但是每次更新都报[highlight dark=”no”]Unable to update the content item information for ‘XXXX’. Unable to execute service method ‘validateCheckinData’. Null pointer is dereferenced.[/highlight]的错误。在Oracle Support上找原因,搜到的结果都不对。把自定义的表、视图、关系重建,把元数据删除重建,无数次的修改重启,就是不起作用。折腾了大半个月,差点发疯。
[heading]解决办法[/heading]
今天下班没事又开始看,无意识的打开Oracle Support,以[highlight dark=”no”]Unable to execute service method ‘validateCheckinData'[/highlight]为关键字搜索,没想到一下子跳出了Doc ID 2225215.1,说这是WebCenter Content 12c的一个bug,当用dDocType做为元数据层级关系的依据时,检入文件或更新时会报错。
按文档的指引下载了patch 23753742,打了补丁后在配置文件加上NoServerDependantFieldValidate=true,重启WebCenter Content服务,更新元数据,一切正常。
想起自己这个经历,心里只想骂他大爷的O记。

[heading]问题描述[/heading]
因为Google把http的网站标记为不安全网站的关系,决定把本站点改为SSL的https方式。
安装好证书,修改了站点的Site和URL配置,重启站点后发现前端页面可以正常访问,但是wp-admin页面却一直显示重定向过多的错误,

[highlight dark=”no”]ERR_TOO_MANY_REDIRECTS[/highlight]

[heading]解决方法[/heading]

放狗搜了一番,从清cookies到修改wp-config.php都试过,但是还是不能奏效。就这样拖了两个星期,今天稍微空下来,决定把这个问题彻底解决。

在wp-config.php文件下增加了以下几行。
[highlight dark=”no”]
define('FORCE_SSL_ADMIN',true);
// in some setups HTTP_X_FORWARDED_PROTO might contain
// a comma-separated list e.g. http,https
// so check for https existence
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';

[/highlight]

重启后,发现站点不再报重定向过多的错了,但是又报OAuth的错(因为俺是用Google的OAuth验证登录)。登上Google的API Manager Console,把站点链接地址指向从http改到https,问题解决。

[heading]1.问题描述[/heading]

把WebCenter Content从11g升级到12c,用归档程序把原有的文件迁移到新版本,文件ID使用与原来相同的自动编号规则,当签入新文件时,系统总是报 “Content Server Request Failed Content item ‘TF_XXX’ was not successfully checked in. The content ID ‘TF_48509’ is not unique.”。

查看Content Server日志,错误信息如下:

An error has occurred. The stack trace below shows more information.

!csUserEventMessage,jeetqiu,139.159.32.66!$!csUnableToCheckIn,TF_007207!csCheckinIDNotUnique2,TF_007207
intradoc.common.ServiceException: !csUnableToCheckIn,TF_007207!csCheckinIDNotUnique2,TF_007207
*ScriptStack CHECKIN_NEW_SUB
3:doScriptableAction,dDocName=3:doSubService,dDocName=CHECKIN_NEW_SUB,dDocName=3:makeNewRevClass,dDocName=
at intradoc.server.ServiceRequestImplementor.buildServiceException(ServiceRequestImplementor.java:2259)…

[heading]2.解决方法[/heading]

第一时间上Oracle Support找相关的答案,Doc ID 446390.1Doc ID 1320842.1都有相关的描述,不过都是修改counters表的RevClassID来达到目的。照着文章修改了RevClassID,但不知道是WebCenter Coneent 12C的机制更新还是什么原因,修改后并没有起作用。

后来无意中在一个链接看到Doc ID 1395583.1 How WebCenter Content 11g Uses Sequences to Uniquely Identify Content,从中知道IdcSeqRevClassID是管自动生成序号的,于是找到当前最大序号。
Select MAX(dDocName) from revisions
再修改IdcSeqRevClassID的起始值至最大序号+1,重新回到content系统,签入新文件,一切正常。

[heading]1.问题描述[/heading]

Ubuntu 16.04 Server LTS升级内核时,每次都跑出来“W: mdadm: /etc/mdadm/mdadm.conf defines no arrays”的提示。明明没有用RAID,查了mdadm.conf也有没有任何相关的配置。虽然不影响使用,但是强迫症患者还是觉得很不爽。

[heading]2.解决办法[/heading]

先删除mdadm.conf文件

[highlight dark=”no”]# rm /etc/mdadm/mdadm.conf[/highlight]

再用update-initramfs命令,自动生成新的mdadm.conf文件。

[highlight dark=”no”]# update-initramfs -u[/highlight]

天下太平。

[heading]1.问题描述[/heading]

对于俺这种升级强迫症患者,Ubuntu的/boot分区接近100%是常见的事。日前发现公司一台测试服务器又提示/boot空间快满。习惯性的想删除内核文件释放空间,运行命令,结果与自己期望相悖,系统报空间不,没法删除旧内核文件。
[highlight dark="no"]# sudo apt-get remove linux-image-4.4.0-28-generic[/highlight]
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
linux-headers-4.4.0-24 linux-headers-4.4.0-24-generic linux-headers-4.4.0-28 linux-headers-4.4.0-28-generic linux-headers-4.4.0-31 linux-headers-4.4.0-31-generic
linux-image-4.4.0-31-generic linux-image-extra-4.4.0-31-generic
Use 'sudo apt autoremove' to remove them.
The following packages will be REMOVED:
linux-image-4.4.0-28-generic linux-image-extra-4.4.0-28-generic
0 upgraded, 0 newly installed, 2 to remove and 89 not upgraded.
3 not fully installed or removed.
After this operation, 218 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 217969 files and directories currently installed.)
Removing linux-image-extra-4.4.0-28-generic (4.4.0-28.47) ...
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-28-generic

gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-4.4.0-28-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-28-generic (–remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-28-generic (4.4.0-28.47) …
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-28-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
Generating grub configuration file …
Found linux image: /boot/vmlinuz-4.4.0-63-generic
Found initrd image: /boot/initrd.img-4.4.0-63-generic
Found linux image: /boot/vmlinuz-4.4.0-59-generic
Found initrd image: /boot/initrd.img-4.4.0-59-generic
Found linux image: /boot/vmlinuz-4.4.0-38-generic
Found initrd image: /boot/initrd.img-4.4.0-38-generic
Found linux image: /boot/vmlinuz-4.4.0-31-generic
Found initrd image: /boot/initrd.img-4.4.0-31-generic
Found memtest86+ image: /memtest86+.elf
Found memtest86+ image: /memtest86+.bin
done
Errors were encountered while processing:
linux-image-extra-4.4.0-28-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

[heading]2.解决方法[/heading]

运行以下命令先清除空间,确认/boot分区已有足够空余。
[highlight dark="no"]# sudo apt-get clean
# df -h[/highlight]

再用以下命令确定现在所用内核及已安装内核文件,清除不需要的内核文件。


[highlight dark="no"]# uname -a
# dpkg --get-selections|grep linux-image
# sudo apt-get remove linux-image-4.4.0-28-generic[/highlight]