alter table myschema.mytable rename to mytable_old;Change ownership for a table:
alter table myschema.mytable owner to anotherschema;
Minimalistic Oracle contains a collection of practical examples from my encounters with Oracle technologies. When relevant, I also write about other technologies, like Linux or PostgreSQL. Many of the posts starts with "how to" since they derive directly from my own personal experience. My goal is to provide simple examples, so that they can be easily adapted to other situations.
alter table myschema.mytable rename to mytable_old;Change ownership for a table:
alter table myschema.mytable owner to anotherschema;
pg_dump mydb -n 'myschema' -a -Fp -t myschema.mytable --column-inserts > /data1/insert_statements.sql| gzip
mydb # select 'myschema.mytable'::regclass::oid; oid ---------- 19561436 (1 row)
SELECT pg_size_pretty(sum(pg_relation_size(quote_ident(schemaname) || '.' || quote_ident(tablename)))::bigint) FROM pg_tables WHERE schemaname = 'yourschema';
export HOST=${HOSTNAME%%.*}
SYS@cdb SQL> alter session set container=pdb1; ERROR: ORA-65011: Pluggable database PDB1 does not exist.Check the setting of _pdb_name_case_sensitive:
SYS@cdb SQL> show parameter pdb NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ _pdb_name_case_sensitive boolean TRUE
SYS@cdb SQL> alter session set container="pdb1"; Session altered. SYS@cdb SQL> show con_name CON_NAME ------------------------------ pdb1 SYS@cdb SQL> show con_id CON_ID ------------------------------ 3The note ORA-65011: Pluggable Database Does Not Exist (Doc ID 2642230.1) from Oracle Support confirms this finding.