Skip to content

Instantly share code, notes, and snippets.

@ecormaksin
ecormaksin / create_vm.cmd
Created January 12, 2020 09:54
VirtualBoxの仮想マシンを作成するWindowsバッチ
@echo off
setlocal enabledelayedexpansion
setlocal
set CURRENT_FOLDER=%~dp0
cd %CURRENT_FOLDER%
set VM_NAME=CentOS7-01
set MEDIUM_FILE_PATH=%HOME%\Downloads\CentOS-7-x86_64-Minimal-1908.iso
# 以下を`/etc/bashrc_customize_ps`などで保存し、各ユーザーの`~/.bashrc`に`. /etc/bashrc_customize_ps`を追加後、`source ~/.bashrc`で反映
function ps1_ls() {
[[ $_PWD == $PWD ]] || { _PWD=$PWD; ls; }
}
function ps1_newline() {
if [[ -z "${PS1_NEWLINE_LOGIN}" ]]; then
PS1_NEWLINE_LOGIN=true
else
sudo ln -s /etc/xrdp/km-00000409.ini /etc/xrdp/km-e0010411.ini
# サイズは 24 32 48 64 から指定可能
# https://wiki.archlinux.jp/index.php/%E3%82%AB%E3%83%BC%E3%82%BD%E3%83%AB%E3%83%86%E3%83%BC%E3%83%9E
gsettings set org.mate.peripherals-mouse cursor-size 32
# 以下を`/etc/bashrc_add_jdk`などで保存し、各ユーザーの`~/.bashrc`に`. /etc/bashrc_add_jdk`を追加後、`source ~/.bashrc`で反映
export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")
export JAVA_BIN_PATH=${JAVA_HOME}/bin
echo $PATH | grep "${JAVA_BIN_PATH}" >/dev/null
if [ $? -ne 0 ]; then
export PATH=${JAVA_BIN_PATH}:$PATH
fi
select index_name, column_position, table_name, column_name
from user_ind_columns
order by index_name, column_position
;
select index_name, table_owner, table_name, status from user_indexes order by table_name, index_name;
SELECT SEQUENCE_NAME
FROM USER_SEQUENCES
ORDER BY SEQUENCE_NAME;
SELECT
*
--SEQUENCE_NAME
--SEQUENCE_NAME,LAST_NUMBER
FROM
USER_SEQUENCES
WHERE SEQUENCE_NAME = '<シーケンス名>'
;
SELECT
*
--'CREATE OR REPLACE SYNONYM ' || OWNER || '.' || SYNONYM_NAME || ' FOR ' || TABLE_OWNER || '.' || TABLE_NAME || ';' as create_or_replace_synonym
FROM ALL_SYNONYMS
WHERE
OWNER = '<スキーマ名>'
ORDER BY
SYNONYM_NAME
;