崖山数据库使用教程

1.1yasboot查状态

yasboot cluster status -c yashandb -d

e2d5cbabf1d452c3b0afbc5cdd05c2d5

 1.2创建ycp用户

# su - yashan
# yasql / as sysdba
> create user ycp identified by yasdb_123;
> grant dba to ycp;

ff408dfea419eb63391301dab73d9f3a

1.3 ycp登入

# yasql ycp/yasdb_123

8

 1.4创建ycp表空间

> create tablespace ycp datafile 'ycp_data' size 100M autoextend on next 5M maxsize 1000M;

数据库备份:level 0 增备;Level 1累积增备

mkdir -p /data/yasdb_data/backup

Level 0 增备

>backup database incremental level 0 format '/data/yasdb_data/backup/incr_0_20251119';

Level 1 累积增备
> backup database incremental level 1 cumulative format '/data/yasdb_data/incr_1_2_20251119';

可以查询到备份记录

> select * from dba_backup_set;

调整redo

> alter database add logfile('redo5' size 200M, 'redo6' size 200M, 'redo7' size 200M, 'redo8' size 200M, 'redo9' size 200M);

> alter system switch logfile;
> alter system checkpoint;
>alter database drop logfile 'redo1';
>alter database drop logfile 'redo2';
>alter database drop logfile 'redo3';
>alter database drop logfile 'redo4';
> select * from v$logfile;

实例参数优化

> EXEC DBMS_PARAM.OPTIMIZE(NULL,NULL,7,10);
> SELECT DBMS_PARAM.SHOW_RECOMMEND() FROM DUAL;
> EXEC DBMS_PARAM.APPLY_RECOMMEND();

重启生效
# yasboot cluster restart -c yashandb

记录一次脚本优化

image

set timing on;
SELECT day_num,
prod2,
AVG(prod2) OVER (
ORDER BY day_num
ROWS BETWEEN 4 PRECEDING AND CURRENT ROW
) AS avg_prod2_last5
FROM sales_amount_by_days
ORDER BY day_num;

 

崖山数据库启动
yasboot process yasom start -c yashandb
yasboot process yasagent start -c yashandb
yasboot cluster restart -c yashandb

 

 

 

 

YMP安装

YCP第五-18
上传: instantclient-basic-linux.x64-19.19.0.0.0dbru.el9.zip、yashandb-personal-23.2.1.100-linux-x86_64.tar.gz、yashan-migrate-platform-v23.2.1.3-linux-x86-64.zip
# useradd ymp
# su - ymp
# cd /home/ymp/
解压OCI
# unzip instantclient-basic-linux.x64-19.19.0.0.0dbru.el9.zip
安装ymp
# unzip yashan-migrate-platform-v23.2.1.3-linux-x86-64.zip
# cd /home/ ymp/ yashan-migrate-platform/
# sh bin/ ymp. sh ins tal l - -db /home/ ymp/ yashandb-per sonal -23.2.3.100- l inux - x86_64.tar.gz - -path
/home/ ymp/ ins tantc l ient _19_19

 

改ymp配置
# /home/ymp/yashan-migrate-platform/conf
# vim application.properties
重启
# sh bin/ymp.sh restartnodb

 

查ymp状态

c440ded2923fef7d3e28878e5668d038

 

posted @ 2025-12-12 17:01  徐创业  阅读(0)  评论(0)    收藏  举报