2021-07-01から1ヶ月間の記事一覧
MySQL (8.0.22)https://dev.mysql.com/doc/refman/8.0/ja/innodb-create-table-external.html file-per-table テーブルスペースまたは一般テーブルスペースが DATA DIRECTORY = 句を使用して作成された場合、.ibd ファイルは通常のデータディレクトリ外の指…
Aurora MySQL -- データベースログファイルの表示とリスト化aws rds describe-db-log-files --db-instance-identifier cluster01-instance-1 -- データベースログファイルのダウンロードaws rds download-db-log-file-portion \--db-instance-identifier clu…
-- SNSトピック作成 aws sns list-topicsaws sns list-subscriptions aws sns create-topic --name topic01 aws sns subscribe --topic-arn arn:aws:sns:ap-northeast-1:999999999999:topic01 --protocol email --notification-endpoint admin@example.com -…
Aurora MySQL では、db.t2 インスタンスクラス または db.t3 インスタンスクラスではストリームを使用できません。Aurora PostgreSQL の場合、ストリームは db.r4 または db.r5 インスタンスクラスでのみ使用します。 アクティビティのストリームは、収集後…
Performance Insights を使用するには、DB インスタンスで有効にします。 Aurora MySQL Aurora MySQL の Performance Schema を有効にすると、Performance Insights が提供する情報がより詳細になります。Aurora MySQL の場合、db.t2 または db.t3 DB インス…
-- 復元可能な直近の時間の確認aws rds describe-db-clusters | jq -c '.DBClusters[] | [.DBClusterIdentifier , .LatestRestorableTime]' -- クラスタの復元aws rds restore-db-cluster-to-point-in-time \--source-db-cluster-identifier cluster01 \--db…
サーバー側の暗号化用のKMSカスタマキー(CMK)が必要データは Apache Parquet 形式で一貫して圧縮され、保存されます。デフォルトでは、スナップショット内のすべてのデータがエクスポートされます。ただし、特定のデータベース、スキーマ、またはテーブルの…
Amazon RDS は DB クラスタのストレージボリュームのスナップショットを作成し、個々のデータベースだけではなく、その DB クラスタ全体をバックアップします。 -- スナップショットの作成 aws rds create-db-cluster-snapshot \--db-cluster-identifier clu…
MySQL (8.0.22)https://dev.mysql.com/doc/refman/8.0/ja/innodb-persistent-stats.html#innodb-persistent-stats-auto-recalc ①アナライズ実行時②閾値以上のデータ更新時(バックグラウンド非同期)③インデックス追加時 (確認)インデックス追加時に統計情報取…
MySQL なし Oracle (19c) select * from v$diag_info; PostgreSQL なし SQL Server (2019) select * from sys.traces; select * from sys.fn_trace_gettable('C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Log\log_34.trc',default); s…
Aurora DB クラスタで Aurora Auto Scaling を使用する前に、まず、プライマリインスタンスと少なくとも 1 つの Aurora レプリカで Aurora DB クラスタを作成する必要があります。 Aurora MySQL -- スケーリングポリシーの追加 ---- ターゲットクラスタの登…
Aurora MySQL aws rds restore-db-cluster-to-point-in-time \--source-db-cluster-identifier cluster01 \--db-cluster-identifier cluster01-clone \--restore-type copy-on-write \--use-latest-restorable-time aws rds describe-db-clusters \--db-clus…
MySQLは複数テーブル同時削除の構文があるPostgreSQLは他テーブルを参照する拡張構文があるSQL Serverはサブクエリでの挙動が微妙のため、拡張構文を使用したほうがよい。 MySQL (8.0.22)https://qiita.com/toshiro3/items/b2e57a9867139bbdd439 drop table …
https://qiita.com/ttkn9a/items/2d325fc5e170721102d2 RDS Proxy は MySQL エンジンファミリーおよび PostgreSQL エンジンファミリーで使用できます。 特定のユーザーとしてプロキシを介して接続するには、シークレットに関連付けられているパスワードが、…
サブクエリ構文は4DBで使用可能MySQLは複数テーブル構文を使用可能。しかし複数行該当のエラーを検知できないPostgreSQLはupdate from構文を使用可能。しかし複数行該当のエラーを検知できないSQL Serverはupdate from構文を使用可能。しかし複数行該当のエ…
使用できるのは、db.r4かdb.r5のDBインスタンスクラスのみです。 -- Auroraクラスタの一覧aws rds describe-global-clustersaws rds describe-db-clustersaws rds describe-db-instances Aurora MySQL -- 1.Amazon Aurora グローバルデータベースの作成 aws …
AuroraServerlessv1DBクラスターにパブリックIPアドレスを割り当てることはできません。VPC内からのみ、AuroraServerlessv1DBクラスターへのアクセスが可能です。 -- Auroraクラスタの一覧aws rds describe-db-clusters Aurora MySQL -- Aurora Serverlessク…
MySQL (8.0.22) LAST_INSERT_ID()→最後に実行されたINSERTステートメントの結果としてAUTO_INCREMENTカラムに正常に挿入された最初の自動生成値を返します。 drop table tab1;create table tab1(col1 int not null auto_increment primary key,col2 int); in…
MySQL (8.0.22)https://www.wakuwakubank.com/posts/203-mysql-transaction-nest/ トランザクションのネストをサポートしていない2つ目のstart transactionでコミットされる drop table tab1;create table tab1(col1 int); select * from tab1; start transa…
MySQL (8.0.22)https://dev.mysql.com/doc/refman/8.0/ja/innodb-error-handling.html エラー内容によって、文レベルのロールバックとなったり、トランザクションレベルのロールバックとなったりする デッドロックエラーはトランザクションレベルのロールバ…
MySQL (8.0.22)drop table tab1;create table tab1(col1 int); start transaction; insert into tab1 values(1); savepoint sp1; insert into tab1 values(2); rollback to sp1; commit; select * from tab1; Oracle (19c) drop table tab1 purge;create tab…
MySQL (8.0.24) show variables like 'innodb_page_size';show variables like '%char%'; drop table tab1; create table tab1(col1 varchar(100),col2 varchar(100),col3 varchar(100),col4 varchar(100),col5 varchar(100),col6 varchar(100),col7 varchar…
MySQL (8.0.22) CPUコア数=2 drop table tab1;create table tab1 ( col1 int); alter table tab1 add constraint tab1pk primary key(col1); drop procedure proc1; delimiter //create procedure proc1(in x int)begin declare i int; set i = 0; start tra…
MySQL (8.0.22) drop table tab2;drop table tab1; create table tab1(col1 int,col2 int);create table tab2(col1 int,col2 int); alter table tab1 add constraint tab1pk primary key(col1);alter table tab2 add constraint tab2pk primary key(col1); a…
MySQL (8.0.22) https://dev.mysql.com/doc/refman/8.0/ja/alter-table-partition-operations.html drop table tab1; create table tab1( col1 int, col2 int, col3 int); alter table tab1 add constraint tab1pk primary key(col1); create index ind12 on…
MySQL (8.0.22) 中断[Ctrl + Z] 確認jobs 再開fg %1 mysqldump -uroot -p test > test.dmp Oracle (19c) expdp test/test@pdb1 directory=ORA_DIR dumpfile=test.dmp logfile=test.log schemas=test reuse_dumpfiles=yes select * from dba_datapump_jobs; e…
MySQL (8.0.22) 確認結果:データファイルサイズは変化なし -- データ準備drop tablespace tbs1;create tablespace tbs1 add datafile 'tbs1.ibd' engine=innodb; drop table tab1;drop table tab2;drop table tab3; create table tab1(col1 int primary key…