Trei probleme gasite pregatind migrarea unui client de pe Oracle XE 11 pe XE 21c. 1. sys-grants.sql nu era rulat de niciun script PowerShell. Era referit doar din run-all-sys.sql, care se lanseaza manual. Pe orice instalare facuta cu RunAll.cmd lipseau sinonimele SYS (SYN_NEWSCHEMA, SYN_NEWSCHEMAJOB, EXECUTESCRIPTOS, SYN_PINFO), DMPDIR si granturile pe DBMS_SCHEDULER / UTL_* / DBMS_CRYPTO catre CONTAFIN_ORACLE. Legat ca STEP 3 in 04-create-synonyms-grants, dupa import - unde propriul header al fisierului spune ca trebuie rulat. 2. Granturile de dictionar cerute de PACK_DIAG_SPATIU lipseau complet. Consolidez sys_2026_08_03_05, sys_2026_08_03_07 si sys_2026_08_06_07 in sectiunea [5/5] din sys-grants.sql: SELECT direct pe 18 vederi dba_*/v$*, idempotent, cu ORA-00942 tratat pentru vederile absente pe alte editii/versiuni. Grantul prin rolul DBA nu ajunge - rolurile nu se aplica in pachetele cu drepturi de definitor, iar PACK_DIAG_SPATIU e exact asa; fara ele ramane INVALID si DIAGSPATIU_ZILNIC nu ruleaza. 3. Capcana la migrari: tabela de versiuni a lui PACK_MIGRARE traieste in CONTAFIN_ORACLE si vine cu DMP-ul, deci baza noua raporteaza scripturile sys_* drept aplicate si ROAACTUALIZARI le sare, desi in SYS nu exista nimic. De aceea obiectele si granturile SYS se pun la instalare, nu prin actualizator. Documentat in sys-updates/README.md si in ghidul nou. 07-verify-installation raporteaza nominal care dintre cele 18 granturi lipsesc. Documentatie: docs/instalare-si-migrare-oracle.md - arbore de decizie intre roa-windows-setup/ (client pe Windows), migration/ (Oracle in Docker pe LXC 108) si new-roa-oracle-server/ (arhiva). Include de ce migration/ nu se foloseste la un client Windows: creeaza PDB ROA cu OraclePass123, sinonime minimale, fara SERVER_INFO / ROAUPDATE / ACL / sqlnet.ora, iar sys_objects.sql de acolo creeaza INFO in SYSTEM - cauza cunoscuta a ORA-01653 la actualizare. Plus comenzile de export din XE 11 / 10g si plafonul XE de 12 GB. Corectat pe drum: dual-edition-test-plan si issues-se-prod indicau clonarea VM 302 -> 303 pentru testul SE, dar 303 e ocupat de Win11-Adina. Mutat pe 304. NETESTAT pe baza reala - VM 302 e oprit. Scripturile trec doar parse-check PowerShell. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SzF1hf4aFS1tmJWpPMiwGp
130 lines
5.4 KiB
Markdown
130 lines
5.4 KiB
Markdown
# CLAUDE.md
|
|
|
|
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
|
|
## Project Overview
|
|
|
|
ROMFASTSQL is an infrastructure and database management project for ROMFAST, featuring:
|
|
- Proxmox virtualization cluster (3 nodes: pve1, pvemini, pveelite)
|
|
- Oracle Database XE 21c with migration support from Oracle 10g
|
|
- AI chatbot system (Flowise + Claude)
|
|
- Disaster recovery infrastructure
|
|
|
|
## Repository Structure
|
|
|
|
```
|
|
proxmox/ # Main infrastructure documentation
|
|
├── README.md # Master index - START HERE
|
|
├── cluster/ # Proxmox cluster, UPS, storage management
|
|
├── lxc102-docker/ # Docker + Portainer + Docker Sandboxes (sbx)
|
|
├── lxc104-flowise/ # AI Chatbot (Flowise on port 3000)
|
|
├── lxc108-oracle/ # Oracle XE 21c/18c Database (port 1521/1522)
|
|
├── lxc110-moltbot/ # MoltBot AI Telegram Bot
|
|
├── lxc171-claude-agent/ # Claude Code development environment
|
|
├── vm109-windows-dr/ # Windows Disaster Recovery VM
|
|
├── vm201-windows/ # Windows 11 (IIS reverse proxy)
|
|
└── vm302-oracle-test/ # Windows 11 + Oracle 21c test VM (ROA setup validation)
|
|
|
|
system_instructions/ # SQL migration guidelines and knowledge base
|
|
├── system_prompt.md # SQL migration rules - READ BEFORE WRITING SQL
|
|
└── knowledge_base/ # Example scripts and PACK_MIGRARE.pck
|
|
|
|
scripts/ # Python utilities
|
|
├── generare_proces_verbal.py # Generate assembly minutes (DOCX)
|
|
└── verificare_voturi_AG.py # Verify assembly votes
|
|
|
|
input/ # Oracle DMP files for import
|
|
```
|
|
|
|
## Key Documentation Entry Points
|
|
|
|
- **Infrastructure overview**: `proxmox/README.md`
|
|
- **SQL migration guidelines**: `system_instructions/system_prompt.md` (always read before generating migration SQL)
|
|
- **Oracle database setup**: `proxmox/lxc108-oracle/README.md`
|
|
- **Migration orchestration**: `proxmox/lxc108-oracle/migration/00-MASTER-MIGRATION.sh`
|
|
- **Chatbot architecture**: `proxmox/lxc104-flowise/docs/prd.md`
|
|
- **Docker Sandboxes (sbx) — agenți AI izolați**: `proxmox/lxc102-docker/README.md`
|
|
- **Disaster recovery**: `proxmox/vm109-windows-dr/README.md`
|
|
- **Instalare/migrare Oracle — care director se folosește**: `proxmox/lxc108-oracle/docs/instalare-si-migrare-oracle.md`
|
|
- **ROA Windows setup scripts (XE/SE 21c)**: `proxmox/lxc108-oracle/roa-windows-setup/README.md`
|
|
- **VM 302 test environment for ROA setup**: `proxmox/vm302-oracle-test/README.md`
|
|
- **Diagnostic spațiu Oracle la clienți (job zilnic + emailuri)**: `docs/diagnostic-spatiu-clienti.md`
|
|
- **Acces SSH la clienți cu chei publice (angajați noi)**: `docs/acces-ssh-chei-angajati.md`
|
|
- **Cazuri clienți (depanare DB)**: `proxmox/lxc108-oracle/clienti/README.md`
|
|
- **ROMPETROL ENERGY — recreare PDB Oracle XE 21c după ORA-12954**: `proxmox/lxc108-oracle/clienti/oracle-xe-21c/README.md`
|
|
|
|
## Infrastructure Commands
|
|
|
|
### Proxmox Cluster
|
|
```bash
|
|
ssh root@10.0.20.201 "pvecm status" # Cluster status
|
|
ssh root@10.0.20.201 "pct list" # List LXC containers
|
|
ssh root@10.0.20.201 "qm list" # List VMs
|
|
```
|
|
|
|
### Oracle Database (LXC 108)
|
|
```bash
|
|
pct exec 108 -- docker exec -it oracle-xe sqlplus / as sysdba
|
|
pct exec 108 -- docker restart oracle-xe
|
|
```
|
|
|
|
### Flowise Chatbot (LXC 104)
|
|
```bash
|
|
pct exec 104 -- systemctl status flowise
|
|
pct exec 104 -- systemctl restart flowise
|
|
pct exec 104 -- journalctl -u flowise -f
|
|
```
|
|
|
|
### Validation Scripts
|
|
```bash
|
|
# UPS monthly test
|
|
proxmox/cluster/ups/scripts/ups-monthly-test.sh
|
|
|
|
# SSL certificate monitoring
|
|
proxmox/vm201-windows/scripts/monitor-ssl-certificates.sh
|
|
|
|
# Oracle backup monitoring
|
|
proxmox/vm109-windows-dr/scripts/oracle-backup-monitor-proxmox.sh
|
|
```
|
|
|
|
## Network Layout
|
|
|
|
| Service | IP Address | Port | Purpose |
|
|
|---------|-----------|------|---------|
|
|
| pvemini (main host) | 10.0.20.201 | 8006 | Proxmox GUI |
|
|
| Oracle XE 21c | 10.0.20.121 | 1521 | Production database |
|
|
| Oracle XE 18c | 10.0.20.121 | 1522 | Export compatibility (TSTZ 31) |
|
|
| Flowise | 10.0.20.161 | 3000 | Chatbot UI |
|
|
| Gitea | 10.0.20.165 | 3000 | Git server |
|
|
| Docker + Portainer + sbx | 10.0.20.113 | 9000/9443 | Docker host, sandbox-uri agenți AI |
|
|
| Claude Agent | 10.0.20.171 | 22 | Development (also via Tailscale: 100.95.55.51) |
|
|
| MoltBot | 10.0.20.173 | 22 | AI Telegram Bot (also via Tailscale: 100.120.119.70) |
|
|
| Primary Oracle | 10.0.20.36 | 1521 | Windows production |
|
|
| DR Oracle | 10.0.20.37 | 1521 | Disaster recovery |
|
|
|
|
## SQL Migration Conventions
|
|
|
|
When writing Oracle migration scripts, follow the naming convention:
|
|
```
|
|
ff_YYYY_MM_DD_##_TYPE.sql
|
|
```
|
|
Where TYPE is: DDL, DML, VIEW, PACK, TRIG, etc.
|
|
|
|
Always reference `system_instructions/system_prompt.md` for:
|
|
- Oracle 10g compatibility requirements
|
|
- PACK_MIGRARE package usage
|
|
- Migration script patterns and examples
|
|
|
|
## Custom Claude Code Commands
|
|
|
|
- `/ultimate_validate_command` - Generate comprehensive validation commands
|
|
- `/plan-handover` - Save implementation plan for session handover
|
|
- `/branch-plan-handover` - Create branch and save plan
|
|
- `/context-handover` - Save context for next session
|
|
|
|
## Git Workflow
|
|
|
|
- Remote: `http://gitea:3000/romfast/ROMFASTSQL.git`
|
|
- Main branch: `master`
|
|
- Feature branches merged directly to master
|