728x90

출처

카메라 모듈 연결 확인

X
user@localhost:~

pi@raspberrypi:~$ vcgencmd get_camera
supported=1 detected=1, libcamera interfaces=0

사진 찍기

X
user@localhost:~

pi@raspberrypi:~$ raspistill -o picture1.jpg

Python으로 사진 찍기

Python 소스 코드 작성

X
user@localhost:~

pi@raspberrypi:~$ vi camera_capture.py

camera_capture.py

import picamera
import time

camera = picamera.PiCamera()
camera.resolution = (2592, 1944) # (64, 64) ~ (2592, 1944) px

time.sleep(3)
camera.capture('snapshot.jpg')

실행

X
user@localhost:~

pi@raspberrypi:~$ python camera_capture.py

 

 

728x90
728x90

출처

설치

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ wget https://raw.githubusercontent.com/Drewsif/PiShrink/master/pishrink.sh
bluesanta@bluesanta-desktop:~$ chmod +x pishrink.sh
bluesanta@bluesanta-desktop:~$ sudo mv pishrink.sh /usr/local/bin

이미지(img) 파일 압축

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ sudo pishrink.sh Orangepi3b_1.0.4_ubuntu_jammy_desktop_xfce_linux5.10.160_oracle19ee.img
pishrink.sh v0.1.4
pishrink.sh: Gathering data ...
Creating new /etc/rc.local
pishrink.sh: Checking filesystem ...
opi_root: 276308/3781440 files (0.3% non-contiguous), 7355461/15322107 blocks
resize2fs 1.46.5 (30-Dec-2021)
pishrink.sh: Shrinking filesystem ...
resize2fs 1.46.5 (30-Dec-2021)
Resizing the filesystem on /dev/loop15 to 7734996 (4k) blocks.
Begin pass 2 (max = 543805)
Relocating blocks             XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 3 (max = 468)
Scanning inode table          XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Begin pass 4 (max = 22279)
Updating inode references     XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
The filesystem on /dev/loop15 is now 7734996 (4k) blocks long.
 
pishrink.sh: Shrinking image ...
pishrink.sh: Shrunk Orangepi3b_1.0.4_ubuntu_jammy_desktop_xfce_linux5.10.160_oracle19ee.img from 60G to 31G ...

gzip으로 파일 압축

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ gzip Orangepi3b_1.0.4_ubuntu_jammy_desktop_xfce_linux5.10.160_oracle19ee.img

용량 확장

용량 확인

X
user@localhost:~

orangepi@orangepi3b:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           769M  8.9M  761M   2% /run
/dev/mmcblk1p2   32G   30G  1.6G  96% /
tmpfs           3.8G     0  3.8G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.8G   12K  3.8G   1% /tmp
/dev/mmcblk1p1 1022M  123M  900M  12% /boot
/dev/zram1       47M  2.5M   41M   6% /var/log
tmpfs           769M   72K  769M   1% /run/user/1000

디스크 확인

X
user@localhost:~

orangepi@orangepi3b:~$ sudo fdisk -l | grep '^Disk'
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
GPT PMBR size mismatch (8191 != 32767) will be corrected by write.
Disk /dev/zram0: 3.75 GiB, 4031479808 bytes, 984248 sectors
The backup GPT table is not on the end of the device.
Disk /dev/mtdblock0: 16 MiB, 16777216 bytes, 32768 sectors
Disklabel type: gpt
Disk identifier: 3633529D-D43A-43ED-89B5-3C77E84E30AB
GPT PMBR size mismatch (122879999 != 124735487) will be corrected by write.
Disk /dev/mmcblk1: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Disklabel type: gpt
Disk identifier: E62EC91A-B5E0-F340-9BEA-2D2DB623FE25
Disk /dev/zram1: 50 MiB, 52428800 bytes, 12800 sectors

기존 파티션을 삭제하고 새로 파티션 생성

X
user@localhost:~

orangepi@orangepi3b:~$ sudo fdisk /dev/mmcblk1
 
Welcome to fdisk (util-linux 2.37.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
GPT PMBR size mismatch (122879999 != 124735487) will be corrected by write.
This disk is currently in use - repartitioning is probably a bad idea.
It's recommended to umount all file systems, and swapoff all swap
partitions on this disk.
 
 
Command (m for help): p
 
Disk /dev/mmcblk1: 59.48 GiB, 63864569856 bytes, 124735488 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: E62EC91A-B5E0-F340-9BEA-2D2DB623FE25
 
Device           Start      End  Sectors  Size Type
/dev/mmcblk1p1   61440  2158591  2097152    1G Linux extended boot
/dev/mmcblk1p2 2158592 68800384 66641793 31.8G Linux filesystem
 
Command (m for help): d
Partition number (1,2, default 2): 2
 
Partition 2 has been deleted.
 
Command (m for help): n
Partition number (2-128, default 2): 2
First sector (2048-124735454, default 2158592): 2158592
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2158592-124735454, default 124735454): 
 
Created a new partition 2 of type 'Linux filesystem' and of size 58.4 GiB.
Partition #2 contains a ext4 signature.
 
Do you want to remove the signature? [Y]es/[N]o: Y
 
The signature will be removed by a write command.
 
Command (m for help): w
The partition table has been altered.
Syncing disks.
 
orangepi@orangepi3b:~$ sudo shutdown -r now

변경한 파티션으로 사이즈 변경

X
user@localhost:~

orangepi@orangepi3b:~$ sudo resize2fs /dev/mmcblk1p2
resize2fs 1.46.5 (30-Dec-2021)
Filesystem at /dev/mmcblk1p2 is mounted on /; on-line resizing required
old_desc_blocks = 2, new_desc_blocks = 4
The filesystem on /dev/mmcblk1p2 is now 15322107 (4k) blocks long.

용량 확인

X
user@localhost:~

orangepi@orangepi3b:~$ df -h
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           769M  8.9M  761M   2% /run
/dev/mmcblk1p2   58G   30G   28G  52% /
tmpfs           3.8G     0  3.8G   0% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.8G   12K  3.8G   1% /tmp
/dev/mmcblk1p1 1022M  123M  900M  12% /boot
/dev/zram1       47M  3.4M   41M   8% /var/log
tmpfs           769M   72K  769M   1% /run/user/1000

728x90
728x90

출처

리눅스 버전 확인

X
user@localhost:~

orangepi@orangepi3b:~$ uname -a
Linux orangepi3b 5.10.160-rockchip-rk356x #1.0.4 SMP Tue Dec 26 10:41:53 CST 2023 aarch64 aarch64 aarch64 GNU/Linux

도커 설치

X
user@localhost:~

orangepi@orangepi3b:~$ curl -sSL https://get.docker.com | sh
# Executing docker install script, commit: e5543d473431b782227f8908005543bb4389b8de
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sudo -E sh -c install -m 0755 -d /etc/apt/keyrings
+ sudo -E sh -c curl -fsSL "https://download.docker.com/linux/ubuntu/gpg" | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg
gpg: WARNING: unsafe ownership on homedir '/home/orangepi/.gnupg'
+ sudo -E sh -c chmod a+r /etc/apt/keyrings/docker.gpg
+ sudo -E sh -c echo "deb [arch=arm64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu focal stable" > /etc/apt/sources.list.d/docker.list
+ sudo -E sh -c apt-get update -qq >/dev/null
+ sudo -E sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-ce-rootless-extras docker-buildx-plugin >/dev/null
+ sudo -E sh -c docker version
Client: Docker Engine - Community
 Version:           25.0.3
 API version:       1.44
 Go version:        go1.21.6
 Git commit:        4debf41
 Built:             Tue Feb  6 21:13:09 2024
 OS/Arch:           linux/arm64
 Context:           default
 
Server: Docker Engine - Community
 Engine:
  Version:          25.0.3
  API version:      1.44 (minimum version 1.24)
  Go version:       go1.21.6
  Git commit:       f417435
  Built:            Tue Feb  6 21:13:09 2024
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.6.28
  GitCommit:        ae07eda36dd25f8a1b98dfbf587313b99c0190bb
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
 
================================================================================
 
To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:
 
    dockerd-rootless-setuptool.sh install
 
Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.
 
 
To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/
 
WARNING: Access to the remote API on a privileged Docker daemon is equivalent
         to root access on the host. Refer to the 'Docker daemon attack surface'
         documentation for details: https://docs.docker.com/go/attack-surface/
 
================================================================================

도커 버전 확인

X
user@localhost:~

orangepi@orangepi3b:~$ sudo docker version
Client: Docker Engine - Community
 Version:           25.0.3
 API version:       1.44

Oracle 데이터베이스용 컨테이너 이미지 빌드 스크립트 다운로드

X
user@localhost:~

orangepi@orangepi3b:~$ git clone https://github.com/oraclesean/cloud-native-oracle.git
orangepi@orangepi3b:~$ cd cloud-native-oracle/
orangepi@orangepi3b:~/cloud-native-oracle$ ls
bashrc19  bashrc21  buildDBImage.sh  config  database  functions.sh  manageOracle.sh  README.md  templates

Database 파일(LINUX.ARM64_1919000_db_home.zip) database 디렉토리에 복사

설치 오류 확인

X
user@localhost:~

  58 |     # Install DB software binaries
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref 050c0aad-4de3-4c6a-b3ea-13b26006aa1c::t73wcuyjin3wcc0vlsq4rux5h: "/database": not found

LINUX.ARM64_1919000_db_home.zip 파일을 다운받아서 database 디렉토리에 복사

X
user@localhost:~

orangepi@orangepi3b:~/cloud-native-oracle$ ls database/
LINUX.ARM64_1919000_db_home.zip  patches  README.md

ARM 프로세서를 지원하는 Oracle 데이터베이스용 컨테이너 이미지 빌드

X
user@localhost:~

orangepi@orangepi3b:~/cloud-native-oracle$ sudo ./buildDBImage.sh
[sudo] password for orangepi: 
[+] Building 455.7s (7/7) FINISHED                                                             docker:default
 => [internal] load build definition from Dockerfile.oraclelinux.202403020836.fy3l                       0.1s
 => => transferring dockerfile: 1.53kB                                                                   0.0s
 => [internal] load metadata for docker.io/library/oraclelinux:8-slim                                    7.5s
 => [internal] load build context                                                                        0.2s
 => => transferring context: 38B                                                                         0.0s
 => [1/3] FROM docker.io/library/oraclelinux:8-slim@sha256:97ac18066921f7939120c4c2453ec26c40fcf2d6dc8b  0.0s
 => CACHED [2/3] COPY manageOracle.sh /opt/scripts/                                                      0.0s
 => [3/3] RUN chmod ug+x /opt/scripts/manageOracle.sh &&      /opt/scripts/manageOracle.sh -e &&       436.4s
 => exporting to image                                                                                  11.1s 
 => => exporting layers                                                                                 11.1s 
 => => writing image sha256:e91736be6ce42035dd6d657b6096488b73ea91d9ee90b789c493c09052892a42             0.0s 
 => => naming to docker.io/library/oraclelinux:8-slim-19c                                                0.0s 
[+] Building 1977.7s (20/20) FINISHED                                                          docker:default 
 => [internal] load build definition from Dockerfile.db.202403020844.ie8y                                0.0s 
 => => transferring dockerfile: 5.33kB                                                                   0.0s
 => resolve image config for docker.io/docker/dockerfile:1.4                                             3.0s
 => CACHED docker-image://docker.io/docker/dockerfile:1.4@sha256:9ba7531bd80fb0a858632727cf7a112fbfd19b  0.0s
 => [internal] load .dockerignore                                                                        0.1s
 => => transferring context: 2B                                                                          0.0s
 => [internal] load metadata for docker.io/library/oraclelinux:8-slim-19c                                0.0s
 => [internal] load build context                                                                       78.5s
 => => transferring context: 2.42GB                                                                     74.0s
 => [db 1/6] FROM docker.io/library/oraclelinux:8-slim-19c                                               0.1s
 => [db 2/6] COPY --chown=oracle:oinstall manageOracle.sh      /opt/scripts/                            34.8s
 => [stage-1 2/8] COPY --chown=oracle:oinstall ./config/dbca.*        /opt/install/                     34.7s
 => [stage-1 3/8] COPY --chown=oracle:oinstall ./config/*.tmpl        /opt/install/                      0.7s
 => [db 3/6] COPY --chown=oracle:oinstall ./config/inst.*     /opt/install/                              0.4s
 => [db 4/6] COPY --chown=oracle:oinstall ./config/manifest   /opt/install/                              0.5s
 => [stage-1 4/8] COPY --chown=oracle:oinstall manageOracle.sh         /opt/scripts/                     0.6s
 => [db 5/6] COPY --chown=oracle:oinstall ./database/         /opt/install/                            161.9s
 => [db 6/6] RUN  chmod ug+x /opt/scripts/manageOracle.sh &&      /opt/scripts/manageOracle.sh -O      845.7s
 => [stage-1 5/8] COPY --chown=oracle:oinstall --from=db /u01/app/oraInventory  /u01/app/oraInventory    0.8s 
 => [stage-1 6/8] COPY --chown=oracle:oinstall --from=db /u01/app/oracle /u01/app/oracle               435.6s 
 => [stage-1 7/8] RUN  /opt/scripts/manageOracle.sh -R                                                   4.1s 
 => [stage-1 8/8] WORKDIR /home/oracle                                                                   0.4s 
 => exporting to image                                                                                 238.3s 
 => => exporting layers                                                                                238.2s 
 => => writing image sha256:3deb038e98a0f2c5174d6b9cddc155eaeb541b6c5fe4d211cfb962031f74c675             0.0s 
 => => naming to docker.io/oracle/db:19.19-EE                                                            0.0s 
REPOSITORY    TAG          IMAGE ID       CREATED          SIZE                                               
oracle/db     19.19-EE     3deb038e98a0   3 minutes ago    5.86GB
oraclelinux   8-slim-19c   e91736be6ce4   33 minutes ago   676MB

환경변수 추가

X
user@localhost:~

orangepi@orangepi3b:~$ vi ~/.profile

CONTAINER_NAME=ORCL
ORADATA=~/oracle-docker/oradata

데이터 디렉터리 및 Docker 볼륨 만들기

mkdir -p $ORADATA/scripts
for dir in audit data diag reco
do mkdir -p $ORADATA/${CONTAINER_NAME}/${dir}
    rm -fr $ORADATA/${CONTAINER_NAME}/${dir}/*
    docker volume rm ${CONTAINER_NAME}_${dir} 2>/dev/null
    docker volume create --opt type=none --opt o=bind \
        --opt device=$ORADATA/${CONTAINER_NAME}/${dir} \
        ${CONTAINER_NAME}_${dir}
done
X
user@localhost:~

orangepi@orangepi3b:~$ mkdir -p $ORADATA/scripts
orangepi@orangepi3b:~$ for dir in audit data diag reco
> do mkdir -p $ORADATA/${CONTAINER_NAME}/${dir}
>     rm -fr $ORADATA/${CONTAINER_NAME}/${dir}/*
>     docker volume rm ${CONTAINER_NAME}_${dir} 2>/dev/null
>     docker volume create --opt type=none --opt o=bind \
>         --opt device=$ORADATA/${CONTAINER_NAME}/${dir} \
>         ${CONTAINER_NAME}_${dir}
> done
ORADB_audit
ORADB_data
ORADB_diag
ORADB_reco
orangepi@orangepi3b:~$

도커 이미지에서 디렉토리 권한이 없으므로 디렉토리 권한 해제

X
user@localhost:~

orangepi@orangepi3b:~$ cd oracle-docker/oradata/
orangepi@orangepi3b:~/oracle-docker/oradata$ sudo chmod 777 -Rf ORCL
orangepi@orangepi3b:~/oracle-docker/oradata$ cd ORCL
orangepi@orangepi3b:~/oracle-docker/oradata/ORCL$ ls -al
total 24
drwxrwxrwx  6 orangepi orangepi 4096 Mar  2 13:24 .
drwxrwxr-x  4 orangepi orangepi 4096 Mar  2 13:24 ..
drwxrwxrwx  3    54321    54321 4096 Mar  2 13:26 audit
drwxrwxrwx  4 orangepi orangepi 4096 Mar  2 13:53 data
drwxrwxrwx 23    54321    54321 4096 Mar  2 13:26 diag
drwxrwxrwx  4 orangepi orangepi 4096 Mar  2 13:37 reco

Oracle Docker 이미지 실행

docker run -d \
    --name ${CONTAINER_NAME} \
    --volume ${CONTAINER_NAME}_data:/u02/app/oracle/oradata \
    --volume ${CONTAINER_NAME}_diag:/u01/app/oracle/diag \
    --volume ${CONTAINER_NAME}_audit:/u01/app/oracle/admin \
    --volume ${CONTAINER_NAME}_reco:/u03/app/oracle \
    --volume $ORADATA/scripts:/scripts \
    -e ORACLE_SID=${CONTAINER_NAME} \
    -e ORACLE_PDB=${CONTAINER_NAME}PDB1 \
    -p 8080:8080 \
    -p 1521:1521 \
    oracle/db:19.19-EE
X
user@localhost:~

orangepi@orangepi3b:~$ sudo docker run -d \
>     --name ${CONTAINER_NAME} \
>     --volume ${CONTAINER_NAME}_data:/u02/app/oracle/oradata \
>     --volume ${CONTAINER_NAME}_diag:/u01/app/oracle/diag \
>     --volume ${CONTAINER_NAME}_audit:/u01/app/oracle/admin \
>     --volume ${CONTAINER_NAME}_reco:/u03/app/oracle \
>     --volume $ORADATA/scripts:/scripts \
>     -e ORACLE_SID=${CONTAINER_NAME} \
>     -e ORACLE_PDB=${CONTAINER_NAME}PDB1 \
>     -p 8080:8080 \
>     -p 1521:1521 \
>     oracle/db:19.19-EE
6357be4fc74139beac920cc5d3577827a1ee96a8a8f607e5a55cb0dafc1235f6

도커 실행 로그 확인

X
user@localhost:~

orangepi@orangepi3b:~/oracle-docker/oradata/ORCL$ docker logs -f $CONTAINER_NAME
 
# ----------------------------------------------------------------------------------------------- #
  Oracle password for SYS, SYSTEM and PDBADMIN: LGYm6_M#5oQC_4
# ----------------------------------------------------------------------------------------------- #
 
# ----------------------------------------------------------------------------------------------- #
  runDBCA: Running DBCA for database ORCL at 2024-03-02 13:32:19
# ----------------------------------------------------------------------------------------------- #
 
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 02-MAR-2024 13:32:19
 
Copyright (c) 1991, 2023, Oracle.  All rights reserved.
 
Starting /u01/app/oracle/product/19.19/dbhome_1/bin/tnslsnr: please wait...
 
TNSLSNR for Linux: Version 19.0.0.0.0 - Production
System parameter file is /u01/app/oracle/product/19.19/dbhome_1/network/admin/listener.ora
Log messages written to /u01/app/oracle/diag/tnslsnr/6357be4fc741/listener/alert/log.xml
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 19.0.0.0.0 - Production
Start Date                02-MAR-2024 13:32:19
Uptime                    0 days 0 hr. 0 min. 0 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/19.19/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/6357be4fc741/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=0.0.0.0)(PORT=1521)))
Services Summary...
Service "ORCL" has 1 instance(s).
  Instance "ORCL", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
 
# ----------------------------------------------------------------------------------------------- #
  runDBCA: Creating container database ORCL and 1 pluggable database(s) with name ORCLPDB1 at 2024-03-02 13:32:20
# ----------------------------------------------------------------------------------------------- #
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
 /u01/app/oracle/cfgtoollogs/dbca/ORCL.
Database Information:
Global Database Name:ORCL
System Identifier(SID):ORCL
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/ORCL/ORCL.log" for further details.
 
Pluggable database altered.
 
 
Pluggable database altered.
 
 
# ----------------------------------------------------------------------------------------------- #
  runDBCA: DBCA complete at 2024-03-02 13:53:34
# ----------------------------------------------------------------------------------------------- #
 
# ----------------------------------------------------------------------------------------------- #
  Database ORCL with unique name ORCL is open and available. 
# ----------------------------------------------------------------------------------------------- #
 
# ----------------------------------------------------------------------------------------------- #
  Tailing alert_ORCL.log: 
2024-03-02T13:53:31.597088+00:00
ORCLPDB1(3):CREATE SMALLFILE TABLESPACE "USERS" LOGGING  DATAFILE  SIZE 5M AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED  EXTENT MANAGEMENT LOCAL  SEGMENT SPACE MANAGEMENT  AUTO
ORCLPDB1(3):Completed: CREATE SMALLFILE TABLESPACE "USERS" LOGGING  DATAFILE  SIZE 5M AUTOEXTEND ON NEXT  1280K MAXSIZE UNLIMITED  EXTENT MANAGEMENT LOCAL  SEGMENT SPACE MANAGEMENT  AUTO
ORCLPDB1(3):ALTER DATABASE DEFAULT TABLESPACE "USERS"
ORCLPDB1(3):Completed: ALTER DATABASE DEFAULT TABLESPACE "USERS"
2024-03-02T13:53:34.793602+00:00
alter pluggable database all open
Completed: alter pluggable database all open
alter pluggable database all save state
Completed: alter pluggable database all save state
2024-03-02T13:54:16.789709+00:00
Errors in file /u01/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_m000_3124.trc  (incident=10321) (PDBNAME=CDB$ROOT):
ORA-00600: internal error code, arguments: [ksm_mga_pseg_cbk_attach:map_null], [], [], [], [], [], [], [], [], [], [], []
ORA-27300: OS system dependent operation:mmap failed with status: 12
ORA-27301: OS failure message: Cannot allocate memory
ORA-27302: failure occurred at: sskgm_mga_at
Incident details in: /u01/app/oracle/diag/rdbms/orcl/ORCL/incident/incdir_10321/ORCL_m000_3124_i10321.trc
2024-03-02T13:54:34.950603+00:00
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
Errors in file /u01/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_m000_3124.trc  (incident=10322) (PDBNAME=CDB$ROOT):
ORA-00600: internal error code, arguments: [ksm_mga_pseg_cbk_attach:map_null], [], [], [], [], [], [], [], [], [], [], []
ORA-27300: OS system dependent operation:mmap failed with status: 12
ORA-27301: OS failure message: Cannot allocate memory
ORA-27302: failure occurred at: sskgm_mga_at
Incident details in: /u01/app/oracle/diag/rdbms/orcl/ORCL/incident/incdir_10322/ORCL_m000_3124_i10322.trc
2024-03-02T13:54:35.141427+00:00
Dumping diagnostic data in directory=[cdmp_20240302135435], requested by (instance=1, osid=3124 (M000)), summary=[incident=10321].
2024-03-02T13:54:42.606206+00:00
Use ADRCI or Support Workbench to package the incident.
See Note 411.1 at My Oracle Support for error and packaging details.
2024-03-02T13:54:42.607531+00:00
Errors in file /u01/app/oracle/diag/rdbms/orcl/ORCL/trace/ORCL_m000_3124.trc:
ORA-00600: internal error code, arguments: [ksm_mga_pseg_cbk_attach:map_null], [], [], [], [], [], [], [], [], [], [], []
ORA-27300: OS system dependent operation:mmap failed with status: 12
ORA-27301: OS failure message: Cannot allocate memory
ORA-27302: failure occurred at: sskgm_mga_at
2024-03-02T13:54:43.057745+00:00
Dumping diagnostic data in directory=[cdmp_20240302135443], requested by (instance=1, osid=3124 (M000)), summary=[incident=10322].
2024-03-02T14:02:13.059101+00:00
ORCLPDB1(3):Resize operation completed for file# 10, fname /u02/app/oracle/oradata/ORCL/12AECDF328D30D6DE063020011ACF430/datafile/o1_mf_sysaux_ly6cs3ot_.dbf, old size 286720K, new size 296960K

SQLPlus 접속

X
user@localhost:~

orangepi@orangepi3b:~$ docker exec -it 6357be4fc741 sqlplus
 
SQL*Plus: Release 19.0.0.0.0 - Production on Sat Mar 2 13:58:42 2024
Version 19.19.0.0.0
 
Copyright (c) 1982, 2023, Oracle.  All rights reserved.
 
Enter user-name: SYSTEM
Enter password: 
Last Successful login time: Sat Mar 02 2024 13:56:21 +00:00
 
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.19.0.0.0
 
SQL> select table_name from tabs;
 
TABLE_NAME
--------------------------------------------------------------------------------------------------------------------------------
LOGMNR_SESSION_EVOLVE$
LOGMNR_GLOBAL$
LOGMNR_PDB_INFO$
LOGMNR_DID$
LOGMNR_UID$
LOGMNRGGC_GTLO
LOGMNRGGC_GTCS
LOGMNRC_DBNAME_UID_MAP
LOGMNR_LOG$
LOGMNR_PROCESSED_LOG$
LOGMNR_SPILL$
LOGMNR_AGE_SPILL$
LOGMNR_RESTART_CKPT_TXINFO$
LOGMNR_ERROR$
LOGMNR_RESTART_CKPT$
LOGMNR_FILTER$
LOGMNR_SESSION_ACTIONS$
LOGMNR_PARAMETER$
LOGMNR_SESSION$
LOGMNR_PROFILE_TABLE_STATS$
LOGMNR_PROFILE_PLSQL_STATS$
REDO_DB
REDO_LOG
ROLLING$CONNECTIONS
ROLLING$DATABASES
ROLLING$DIRECTIVES
ROLLING$EVENTS
ROLLING$PARAMETERS
ROLLING$PLAN
ROLLING$STATISTICS
ROLLING$STATUS
MVIEW$_ADV_WORKLOAD
MVIEW$_ADV_BASETABLE
MVIEW$_ADV_SQLDEPEND
MVIEW$_ADV_PRETTY
MVIEW$_ADV_TEMP
MVIEW$_ADV_FILTER
MVIEW$_ADV_LOG
MVIEW$_ADV_FILTERINSTANCE
MVIEW$_ADV_LEVEL
MVIEW$_ADV_ROLLUP
MVIEW$_ADV_AJG
MVIEW$_ADV_FJG
MVIEW$_ADV_GC
MVIEW$_ADV_CLIQUE
MVIEW$_ADV_ELIGIBLE
MVIEW$_ADV_OUTPUT
MVIEW$_ADV_EXCEPTIONS
MVIEW$_ADV_PARAMETERS
MVIEW$_ADV_INFO
MVIEW$_ADV_JOURNAL
MVIEW$_ADV_PLAN
AQ$_QUEUE_TABLES
AQ$_KEY_SHARD_MAP
AQ$_QUEUES
AQ$_SCHEDULES
AQ$_INTERNET_AGENTS
AQ$_INTERNET_AGENT_PRIVS
SCHEDULER_PROGRAM_ARGS_TBL
SCHEDULER_JOB_ARGS_TBL
LOGSTDBY$PARAMETERS
LOGSTDBY$EVENTS
LOGSTDBY$APPLY_MILESTONE
LOGSTDBY$SCN
LOGSTDBY$FLASHBACK_SCN
LOGSTDBY$PLSQL
LOGSTDBY$SKIP_TRANSACTION
LOGSTDBY$SKIP
LOGSTDBY$SKIP_SUPPORT
LOGSTDBY$HISTORY
LOGSTDBY$EDS_TABLES
SQLPLUS_PRODUCT_PROFILE
HELP
LOGMNR_GT_TAB_INCLUDE$
LOGMNR_GT_USER_INCLUDE$
LOGMNR_GT_XID_INCLUDE$
LOGMNRT_MDDL$
OL$
OL$HINTS
OL$NODES
LOGMNR_DICTSTATE$
LOGMNRC_GTLO
LOGMNRC_GTCS
LOGMNRC_SEQ_GG
LOGMNRC_CON_GG
LOGMNRC_CONCOL_GG
LOGMNRC_IND_GG
LOGMNRC_INDCOL_GG
LOGMNRC_SHARD_TS
LOGMNRC_TSPART
LOGMNRC_TS
LOGMNRC_GSII
LOGMNRC_GSBA
LOGMNRC_USER
LOGMNR_SEED$
LOGMNR_DICTIONARY$
LOGMNR_OBJ$
LOGMNR_TAB$
LOGMNR_COL$
LOGMNR_ATTRCOL$
LOGMNR_TS$
LOGMNR_IND$
LOGMNR_USER$
LOGMNR_TABPART$
LOGMNR_TABSUBPART$
LOGMNR_TABCOMPART$
LOGMNR_TYPE$
LOGMNR_COLTYPE$
LOGMNR_ATTRIBUTE$
LOGMNR_LOB$
LOGMNR_CON$
LOGMNR_CONTAINER$
LOGMNR_CDEF$
LOGMNR_CCOL$
LOGMNR_ICOL$
LOGMNR_LOBFRAG$
LOGMNR_INDPART$
LOGMNR_INDSUBPART$
LOGMNR_INDCOMPART$
LOGMNR_LOGMNR_BUILDLOG
LOGMNR_NTAB$
LOGMNR_OPQTYPE$
LOGMNR_SUBCOLTYPE$
LOGMNR_KOPM$
LOGMNR_PROPS$
LOGMNR_ENC$
LOGMNR_REFCON$
LOGMNR_IDNSEQ$
LOGMNR_PARTOBJ$
LOGMNRP_CTAS_PART_MAP
LOGMNR_SHARD_TS
LOGSTDBY$APPLY_PROGRESS
 
132 rows selected.
 
SQL> 

 

 

 

도커 : 이미지 목록 조회, 삭제

X
user@localhost:~

orangepi@orangepi3b:~/cloud-native-oracle$ docker images
REPOSITORY    TAG          IMAGE ID       CREATED         SIZE
oraclelinux   8-slim-19c   c0e3a8e31386   8 minutes ago   676MB
orangepi@orangepi3b:~/cloud-native-oracle$ docker rmi c0e3a8e31386
Untagged: oraclelinux:8-slim-19c
Deleted: sha256:c0e3a8e3138639bda7c2fa55e1d5ebff39ff1706665f8b4e9da0bb966882344b
orangepi@orangepi3b:~/cloud-native-oracle$ docker images
REPOSITORY   TAG       IMAGE ID   CREATED   SIZE
orangepi@orangepi3b:~/cloud-native-oracle$

728x90
728x90

출처

jdk 설치

~/.profile 에 JAVA_HOME, PATH 추가

export JAVA_HOME=/Server/java/jdk1.8.0_131
export PATH=$PATH:$JAVA_HOME/bin

java 버전 확인

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)

Wowza 설치 파일 실행 권한 부여

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ chmod u+x WowzaStreamingEngine-4.8.23+2-linux-x64-installer.run

Wowza 설치

Wowza 설치 파일 실행

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ sudo ./WowzaStreamingEngine-4.8.23+2-linux-x64-installer.run
----------------------------------------------------------------------------
Welcome to the Wowza Streaming Engine Setup Wizard.
 
----------------------------------------------------------------------------
Please read the following License Agreement. You must accept the terms of this 
agreement before continuing with the installation.
 
Press [Enter] to continue:

Wowza 라이센스 확인

[Enter] 키를 계속 눌러서 라이센스 내용 전부 조회

X
user@localhost:~

Wowza(tm) Media Systems, LLC
END USER LICENSE AGREEMENT
for
Wowza Streaming Engine(tm) 4 Software
And Related Software Products and Services
 
       Thank you for choosing software from Wowza Media Systems, LLC.  This End 
User License Agreement (this "EULA") is a legally binding license agreement between 
you and Wowza Media Systems, LLC that describes your rights to use software and 
services provided by Wowza, including Wowza Streaming Engine software and technical 
support and maintenance for that software.  
       
       This EULA is divided into various sections, including the following License 
Overview that provides a summary of the EULA.  Please read this EULA carefully and in 
its entirety before clicking "I AGREE", installing, or using Wowza Streaming Engine 
software or other software provided to you by Wowza.   
       
       BY SELECTING "I AGREE" DURING INSTALLATION OF THE SOFTWARE, 
Press [Enter] to continue:

Wowza 라이센스 동의

X
user@localhost:~

 
   13.2 U.S. Government Licensing of Wowza Software.  You agree that when 
licensing the Software for acquisition by the U.S. Government, or any contractor 
 
therefore, you will license consistent with the policies set forth in 48 C.F.R. 
Section 
12.212 (for civilian agencies) and 48 C.F.R. Sections 227-7202-1 and 227-7202-4 
(for 
the Department of Defense). For U.S. Government End Users, Wowza agrees to 
comply 
with all applicable equal opportunity laws including, if appropriate, the 
Press [Enter] to continue:
provisions of 
Executive Order 11246, as amended, Section 402 of the Vietnam Era Veterans 
Readjustment Assistance Act of 1974 (38 USC 4212), and Section 503 of the 
Rehabilitation Act of 1973, as amended, and the regulations at 41 CFR Parts 60-1 
 
through 60-60, 60-250, and 60-741. The affirmative action clause and regulations 
 
contained in the preceding sentence shall be incorporated by reference in this Agreement. 
 
 
 
 
 
Wowza Streaming Engine 4 EULA (20201204)
 
Press [Enter] to continue:
 
Do you accept this agreement? [y/n]: y

라이센스 번호 입력

X
user@localhost:~

----------------------------------------------------------------------------
Enter License Key
 
Please enter your Wowza Streaming Engine License Key.
 
            Format: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX[-XXXXXXXXXXXX]
 
 
 
   
 
License Key: []: XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX

관리자 계정생성

X
user@localhost:~

----------------------------------------------------------------------------
Create Administrator Account
 
Enter a user name and password that will be used to manage Wowza Streaming 
Engine.
 
User Name: []: admin
 
Password: :1q@w3e4r
Confirm Password: :1q@w3e4r
Note: User Name and Password are case-sensitive.
 
----------------------------------------------------------------------------
Startup Configuration
 
  
 
 
 
Start Wowza Streaming Engine automatically [Y/n]: Y

Wowza 설치

X
user@localhost:~

----------------------------------------------------------------------------
Startup Configuration
 
  
 
 
 
Start Wowza Streaming Engine automatically [Y/n]: Y
 
 
 Clear the check box to start Wowza Streaming Engine manually.
 
 
----------------------------------------------------------------------------
Setup is now ready to begin installing Wowza Streaming Engine on your computer.
 
Do you want to continue? [Y/n]: Y
 
----------------------------------------------------------------------------
Please wait while Setup installs Wowza Streaming Engine on your computer.
 
 Installing
 0% ______________ 50% ______________ 100%
 #########################################
 
----------------------------------------------------------------------------
Setup has finished installing Wowza Streaming Engine on your computer.

Wowza 관리 페이지 접속 허용 설정

설정파일 Server.xml에 IPWhiteList에 IP를 추가하거나 모두 허용( * )으로 설정

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ sudo vi /usr/local/WowzaStreamingEngine/conf/Server.xml

                        <!--
                        <IPWhiteList>127.0.0.1</IPWhiteList>^M
                        -->
                        <IPWhiteList>*</IPWhiteList>

Wowza 서비스 재시작

X
user@localhost:~

bluesanta@bluesanta-desktop:~$ sudo systemctl restart WowzaStreamingEngine.service
bluesanta@bluesanta-desktop:~$ sudo systemctl restart WowzaStreamingEngineManager.service

728x90
728x90

출처

WiFi 상태 확인

X
user@localhost:~

pi@raspberrypi:~$ iwconfig
lo        no wireless extensions.
 
eth0      no wireless extensions.
 
wlan0     IEEE 802.11  ESSID:"bluexmas"  
          Mode:Managed  Frequency:2.452 GHz  Access Point: 88:36:6C:45:F7:B0   
          Bit Rate=58.5 Mb/s   Tx-Power=31 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on
          Link Quality=62/70  Signal level=-48 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:1  Invalid misc:0   Missed beacon:0

SSID 목록 조회

X
user@localhost:~

pi@raspberrypi:~$ sudo iwlist wlan0 scan | grep SSID
                    ESSID:"U+Net7CCC"
                    ESSID:"bluexmas"
                    ESSID:"U+Net6519_5G"
                    ESSID:"Robin"
                    ESSID:"U+Net6519"
                    ESSID:"SK_WiFiGIGA71B1"
                    ESSID:"SK_WiFiGIGA71B1_2.4G"
                    ESSID:"\x00\x00\x00\x00\x00\x00\x00"
                    ESSID:"U+Net7CCC_5G"
                    ESSID:"\x00\x00\x00\x00\x00\x00\x00"

숨겨진 SSID 연결

scan_ssid값이 1인 경우 숨겨진 SSID 연결 설정

X
user@localhost:~

pi@raspberrypi:~$ cat /etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
 
network={
       ssid="bluexmas5G"
       scan_ssid=1
       psk="test1234" 
}

Network Manager 변경

X
user@localhost:~

pi@raspberrypi:~$ sudo raspi-config

NetworkManager 실행 상태 확인

X
user@localhost:~

pi@raspberrypi:~$ sudo systemctl status NetworkManager
● NetworkManager.service - Network Manager
     Loaded: loaded (/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
    Drop-In: /usr/lib/systemd/system/NetworkManager.service.d
             └─10-dhcpcd.conf
     Active: active (running) since Sat 2024-01-27 01:57:21 GMT; 4min 3s ago
       Docs: man:NetworkManager(8)
   Main PID: 496 (NetworkManager)
      Tasks: 3 (limit: 4088)
        CPU: 681ms
     CGroup: /system.slice/NetworkManager.service
             └─496 /usr/sbin/NetworkManager --no-daemon
 
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3284] device (wlan0): state change: ip-config -> ip-check (r>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3382] device (wlan0): state change: ip-check -> secondaries >
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3390] device (wlan0): state change: secondaries -> activated>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3405] manager: NetworkManager state is now CONNECTED_LOCAL
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3541] manager: NetworkManager state is now CONNECTED_SITE
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3547] policy: set 'bluexmas' (wlan0) as default for IPv4 routing>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.3557] dns-mgr: Writing DNS information to /sbin/resolvconf
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.4547] device (wlan0): Activation: successful, device activat>
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.4568] manager: NetworkManager state is now CONNECTED_GLOBAL
Jan 27 01:57:31 raspberrypi NetworkManager[496]:   [1706320651.4589] manager: startup complete

NetworkManager 연결 정보 확인

X
user@localhost:~

pi@raspberrypi:~$ cd /etc/NetworkManager/system-connections
pi@raspberrypi:/etc/NetworkManager/system-connections$ ls
bluexmas.nmconnection
pi@raspberrypi:/etc/NetworkManager/system-connections$ sudo cat bluexmas.nmconnection
[connection]
id=bluexmas
uuid=db18715a-410e-4c57-8fc3-475a7391faec
type=wifi
interface-name=wlan0
permissions=
timestamp=1706314246
 
[wifi]
mac-address-blacklist=
mode=infrastructure
seen-bssids=88:36:6C:45:F7:B0;
ssid=bluexmas
 
[wifi-security]
auth-alg=open
key-mgmt=wpa-psk
psk=s2u2n4g6
 
[ipv4]
dns-search=
method=auto
 
[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto
 
[proxy]

728x90
728x90

출처

openssl.cnf 내용 추가

X
user@localhost:~

sudo vi /usr/lib/ssl/openssl.cnf

# openssl_conf = openssl_init
openssl_conf = default_conf

[default_conf]
ssl_conf = ssl_sect

[ssl_sect]
system_default = ssl_default_sect

[ssl_default_sect]
MinProtocol = TLSv1
CipherString = DEFAULT:@SECLEVEL=1

MySQL 환경파일 수정

X
user@localhost:~

[user@localhost]$ sudo vi /Server/MySQL/mysql57/my.cnf

[mysqld]
# tls_version=TLSv1.2
ssl_cipher=DEFAULT:@SECLEVEL=1
bind-address=0.0.0.0

MySQL 재시작

X
user@localhost:~

[user@localhost]$ sudo service mysqld57 restart

728x90
728x90

출처

리눅스 정보 조회

출처 : 리눅스 종류 확인, 리눅스 버전 확인 - 제타위키

X
user@localhost:~

[user@localhost]$ cat /etc/*-release | uniq
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

리눅스 비트 확인

출처 : 리눅스 32비트 64비트 확인 - 제타위키

X
user@localhost:~

[user@localhost]$ getconf LONG_BIT
64

관련패키지 설치

X
user@localhost:~

[user@localhost]$ sudo apt install gcc g++ libncurses5-dev libxml2-dev openssl libssl-dev curl libcurl4-openssl-dev libjpeg-dev libpng-dev libfreetype6-dev libsasl2-dev autoconf libncurses5-dev

MySQL 계정 만들기

X
user@localhost:~

[user@localhost]$ sudo groupadd mysql
[user@localhost]$ sudo useradd -g mysql -s /bin/bash -m mysql

cmake 설치

X
user@localhost:~

[user@localhost]$ sudo apt install cmake pkg-config

MySQL 소스 다운로드, 압축해제, 컴파일, 설치

X
user@localhost:~

[user@localhost]$ wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-boost-5.7.44.tar.gz
[user@localhost]$ tar xvf mysql-boost-5.7.44.tar.gz
[user@localhost]$ cd mysql-5.7.44
[user@localhost]$ cmake \
-DCMAKE_INSTALL_PREFIX=/Server/MySQL/mysql57 \
-DMYSQL_DATADIR=/Server/MySQL/mysql57/data \
-DMYSQL_UNIX_ADDR=/Server/MySQL/mysql57/mysql.sock \
-DSYSCONFDIR=/Server/MySQL/mysql57 \
-DMYSQL_TCP_PORT=3306 \
-DMYSQL_USER=mysql \
-DDEFAULT_CHARSET=utf8 \
-DDEFAULT_COLLATION=utf8_general_ci \
-DWITH_EXTRA_CHARSETS=all \
-DENABLED_LOCAL_INFILE=1 \
-DWITH_INNOBASE_STORAGE_ENGINE=1 \
-DWITH_ARCHIVE_STORAGE_ENGINE=1 \
-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \
-DDOWNLOAD_BOOST=0 -DWITH_BOOST=./boost
[user@localhost]$ make
[user@localhost]$ make install

환경설정

X
user@localhost:~

[user@localhost]$ vi /Server/MySQL/mysql57/my.cnf

my.cnf

[mysqld]
port=3306
event_scheduler = ON
basedir=/Server/MySQL/mysql57
datadir=/Server/MySQL/mysql57/data
# pid-file=/Server/MySQL/mysql57/mysqld.pid
# log_error=/Server/MySQL/mysql57/mysql_error.log
# lc-messages-dir=/Server/MySQL/mysql57/share

init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
character-set-server=utf8
collation-server=utf8_general_ci
# table_cache=1024
max_connections=2048
max_user_connections=500
max_connect_errors=10000
wait_timeout=300
query_cache_type = 1
query_cache_size = 128M
query_cache_limit = 5M
slow_query_log
long_query_time=3
max_allowed_packet=16M
sort_buffer_size = 2M
# skip-innodb
skip-name-resolve
sql_mode = STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
lower_case_table_names = 1

[mysql]
default-character-set=utf8

[client]
default-character-set=utf8

MySQL 설치 디렉토리 mysql 계정으로 권한 수정

X
user@localhost:~

[user@localhost]$ sudo chown -R mysql:mysql /Server/MySQL/mysql57

MySQL 데이터베이스 초기화 (mysql 계정으로 실행)

X
user@localhost:~

[user@localhost]$ su mysql
mysql@bluexmas:~$ cd /Server/MySQL/mysql57
mysql@bluexmas:/Server/MySQL/mysql57$ bin/mysql_install_db --no-defaults --user=mysql --datadir=/Server/MySQL/mysql57/data --basedir=/Server/MySQL/mysql57 -v
2023-12-23 19:54:33 [WARNING] mysql_install_db is deprecated. Please consider switching to mysqld --initialize
2023-12-23 19:54:33 [NOTE]    Creating data directory /Server/MySQL/mysql57/data
2023-12-23 19:54:33 [NOTE]    Generating random password to /home/mysql/.mysql_secret...done.
2023-12-23 19:54:33 [NOTE]    Executing /Server/MySQL/mysql57/bin/mysqld --no-defaults --bootstrap --datadir=/Server/MySQL/mysql57/data --lc-messages-dir=/Server/MySQL/mysql57/share --lc-messages=en_US --basedir=/Server/MySQL/mysql57
2023-12-23 19:54:37 [NOTE]    Creating system tables...done.
2023-12-23 19:54:37 [NOTE]    Filling system tables with data...done.
2023-12-23 19:54:37 [NOTE]    Filling help table with data...done.
2023-12-23 19:54:37 [NOTE]    Creating user for internal session service...done.
2023-12-23 19:54:37 [NOTE]    Creating default user root@localhost
2023-12-23 19:54:37 [NOTE]    Creating default proxy root@localhost
2023-12-23 19:54:37 [NOTE]    Creating sys schema
2023-12-23 19:54:38 [NOTE]    done.
2023-12-23 19:54:39 [WARNING] The bootstrap log isn't empty:
2023-12-23 19:54:39 [WARNING] 2023-12-23T10:54:33.906900Z 0 [Warning] --bootstrap is deprecated. Please consider using --initialize instead

MySQL 서비스 등록

서비스 mysqld 파일 복사

X
user@localhost:~

[user@localhost]$ sudo cp /Server/MySQL/mysql57/support-files/mysql.server /etc/init.d/mysqld57

mysqld 수정

X
user@localhost:~

[user@localhost]$ sudo vi /etc/init.d/mysqld57

mysqld파일을 열어서 basedir에 mysql이 설치된 디렉토리와 데이터 디렉토리(datadir)를 설정한다.

basedir=/Server/MySQL/mysql57
datadir=/Server/MySQL/mysql57/data

mysqld 서비스 등록

X
user@localhost:~

[user@localhost]$ sudo update-rc.d mysqld57 defaults

mysqld 서비스 실행

X
user@localhost:~

[user@localhost]$ sudo service mysqld57 start
[user@localhost]$ sudo service mysqld57 status
● mysqld57.service - LSB: start and stop MySQL
     Loaded: loaded (/etc/init.d/mysqld57; generated)
     Active: active (running) since Sat 2023-12-23 19:57:54 KST; 15s ago
       Docs: man:systemd-sysv-generator(8)
    Process: 61861 ExecStart=/etc/init.d/mysqld57 start (code=exited, status=0/SUCCESS)
      Tasks: 29 (limit: 18671)
     Memory: 175.0M
        CPU: 772ms
     CGroup: /system.slice/mysqld57.service
             ├─61881 /bin/sh /Server/MySQL/mysql57/bin/mysqld_safe --datadir=/Server/MySQL/mysql57/data --pid-file=/Ser>
             └─62295 /Server/MySQL/mysql57/bin/mysqld --basedir=/Server/MySQL/mysql57 --datadir=/Server/MySQL/mysql57/d>
 
12월 23 19:57:53 bluesanta-desktop systemd[1]: Starting LSB: start and stop MySQL...
12월 23 19:57:53 bluesanta-desktop mysqld57[61861]: Starting MySQL
12월 23 19:57:53 bluesanta-desktop mysqld57[61861]: .
12월 23 19:57:53 bluesanta-desktop mysqld57[61881]: Logging to '/Server/MySQL/mysql57/data/bluesanta-desktop.err'.
12월 23 19:57:54 bluesanta-desktop mysqld57[61861]:  *
12월 23 19:57:54 bluesanta-desktop systemd[1]: Started LSB: start and stop MySQL.

root 암호 초기화

권한을 무시하고 mysql 서버 실행

X
user@localhost:~

mysql@bluexmas:/Server/MySQL/mysql57$ bin/mysqld_safe --skip-grant-tables &
[1] 62790
mysql@bluesanta-desktop:/Server/MySQL/mysql57$ 2023-12-23T11:06:36.242790Z mysqld_safe Logging to '/Server/MySQL/mysql57/data/bluesanta-desktop.err'.
2023-12-23T11:06:36.272476Z mysqld_safe Starting mysqld daemon with databases from /Server/MySQL/mysql57/data

root 암호 설정

X
user@localhost:~

mysql@bluexmas:/Server/MySQL/mysql57$ bin/mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.7.44-log Source distribution
 
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
mysql> update user set authentication_string = password('sqldba') where user = 'root';
Query OK, 1 row affected, 1 warning (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 1
 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
 
mysql> quit
Bye

ERROR 1820 (HY000) 오류 해결

X
user@localhost:~

mysql@bluexmas:/Server/MySQL/mysql57$ bin/mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.44-log
 
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
 
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
mysql> use mysql
ERROR 1820 (HY000): You must reset your password using ALTER USER statement before executing this statement.
mysql> SET PASSWORD = PASSWORD('sqldba');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> use mysql
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
 
Database changed
mysql>

사용자 추가

X
user@localhost:~

mysql> create user 'user1'@'%' identified by 'userpw';
mysql> grant all privileges on *.* to 'user1'@'%' with grant option;
mysql> flush privileges;

사용자 추가

X
user@localhost:~

mysql> create user 'terecal'@'%' identified by '****';
mysql> GRANT ALL privileges ON terecal_db.* TO 'terecal'@'%';
mysql> flush privileges;

728x90
728x90

출처

xrdp 설치

X
user@localhost:~

[user@localhost]$ sudo apt-get -y install xrdp

서비스 등록

X
user@localhost:~

[user@localhost]$ sudo systemctl enable xrdp
Synchronizing state of xrdp.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable xrdp

서비스 다시 시작

X
user@localhost:~

[user@localhost]$ sudo service xrdp restart

728x90

+ Recent posts