Nexus3-运维随记:修订间差异

来自三线的随记
(创建页面,内容为“sonatype nexus3 === 按照repository 统计空间占用 === java -jar ./lib/support/nexus-orient-console.jar CONNECT PLOCAL:/nexus-data/db/component admin admin select bucket.repository_name as repository,sum(size) as bytes from asset group by bucket.repository_name order by bytes desc limit 10;”)
 
无编辑摘要
 
(未显示同一用户的6个中间版本)
第1行: 第1行:
sonatype nexus3
sonatype nexus3


=== 按照repository 统计空间占用 ===
一些orientdb SQL操作记录
 
=== 基础登陆 ===
  java -jar ./lib/support/nexus-orient-console.jar
  java -jar ./lib/support/nexus-orient-console.jar
   
   
  CONNECT PLOCAL:/nexus-data/db/component admin admin
  CONNECT PLOCAL:/nexus-data/db/component admin admin
 
=== 按照repository 统计空间占用 ===
  select bucket.repository_name as repository,sum(size) as bytes from asset group by bucket.repository_name order by bytes desc limit 10;
  select bucket.repository_name as repository,sum(size) as bytes from asset group by bucket.repository_name order by bytes desc limit 10;
=== Maven 仓库:按 <code>groupId</code> 汇总 (AI生成) ===
在仓库级别统计
SELECT gid, SUM(size) AS bytes, COUNT(*) AS files FROM ( SELECT attributes.maven2.groupId AS gid, size FROM asset WHERE bucket IN (SELECT @rid FROM bucket WHERE repository_name = 'upload-snapshot') AND attributes.maven2.groupId IS NOT NULL ) GROUP BY gid ORDER BY bytes DESC LIMIT 200;
=== Maven 仓库:按 <code>Name</code>(artifactId) 汇总 (AI生成) ===
在全局下按名字统计并过滤仓库:
SELECT repo, gid, aid, SUM(size) AS bytes, COUNT(*) AS files FROM ( SELECT bucket.repository_name AS repo, attributes.maven2.groupId AS gid, attributes.maven2.artifactId AS aid, size FROM asset WHERE bucket.repository_name = ''''upload-snapshot'''<nowiki/>' AND attributes.maven2.groupId IS NOT NULL AND attributes.maven2.artifactId IS NOT NULL ) GROUP BY repo, gid, aid ORDER BY bytes DESC LIMIT 200;
在全局下按名字统计并且不过滤仓库:
SELECT repo, gid, aid, SUM(size) AS bytes, COUNT(*) AS files FROM ( SELECT bucket.repository_name AS repo, attributes.maven2.groupId AS gid, attributes.maven2.artifactId AS aid, size FROM asset WHERE attributes.maven2.groupId IS NOT NULL AND attributes.maven2.artifactId IS NOT NULL ) GROUP BY repo, gid, aid ORDER BY bytes DESC LIMIT 200;

2025年9月29日 (一) 17:15的最新版本

sonatype nexus3

一些orientdb SQL操作记录

基础登陆

java -jar ./lib/support/nexus-orient-console.jar

CONNECT PLOCAL:/nexus-data/db/component admin admin

按照repository 统计空间占用

select bucket.repository_name as repository,sum(size) as bytes from asset group by bucket.repository_name order by bytes desc limit 10;

Maven 仓库:按 groupId 汇总 (AI生成)

在仓库级别统计

SELECT gid, SUM(size) AS bytes, COUNT(*) AS files FROM ( SELECT attributes.maven2.groupId AS gid, size FROM asset WHERE bucket IN (SELECT @rid FROM bucket WHERE repository_name = 'upload-snapshot') AND attributes.maven2.groupId IS NOT NULL ) GROUP BY gid ORDER BY bytes DESC LIMIT 200;

Maven 仓库:按 Name(artifactId) 汇总 (AI生成)

在全局下按名字统计并过滤仓库:

SELECT repo, gid, aid, SUM(size) AS bytes, COUNT(*) AS files FROM ( SELECT bucket.repository_name AS repo, attributes.maven2.groupId AS gid, attributes.maven2.artifactId AS aid, size FROM asset WHERE bucket.repository_name = 'upload-snapshot' AND attributes.maven2.groupId IS NOT NULL AND attributes.maven2.artifactId IS NOT NULL ) GROUP BY repo, gid, aid ORDER BY bytes DESC LIMIT 200;

在全局下按名字统计并且不过滤仓库:

SELECT repo, gid, aid, SUM(size) AS bytes, COUNT(*) AS files FROM ( SELECT bucket.repository_name AS repo, attributes.maven2.groupId AS gid, attributes.maven2.artifactId AS aid, size FROM asset WHERE attributes.maven2.groupId IS NOT NULL AND attributes.maven2.artifactId IS NOT NULL ) GROUP BY repo, gid, aid ORDER BY bytes DESC LIMIT 200;