sql - Oracle - copying stored procedures to remote database -


an assignment have part of pl/sql studies requires me create remote database connection , copy down tables local, , copy other objects reference data, views , triggers etc.

the idea @ remote end, views etc should reference local tables provided local database online, , if not, should reference tables stored on remote database.

so i've created connection, , script creates tables @ remote end.

i've made pl/sql block create views , triggers @ remote end, whereby simple select query run against local database check if online, if online series of execute immediate statements creates views etc reference table_name@local, , if isn't online block skips exception section, similar series of execute immediate statements creates same views referencing remote tables.

ok become unsure. have package contains few procedures , function, , i'm not sure what's best way create @ remote end behaves in similar way in terms of picks reference tables from.

is case of enclosing whole package-creating block within 'execute immediate', in same way did views, or should create 2 different packages , call them pack1 , pack1_remote?

or there suspect more efficient method of achieving goal?

cheers!

this absolutely not how reasonable person in real world design system. suggesting suggest here in real world will, in best case, laughed out of room.

the least insane approach envision have 2 different schemas. schema 1 own tables. schema 2 own code. @ install time, create synonyms every object schema 2 needs reference. if remote database available when code installed, create synonyms refer objects in remote database. otherwise, create synonyms refer objects in local database. lets create single set of objects without using dynamic sql creating layer of indirection between code , tables.


Comments

Popular posts from this blog

database - VFP Grid + SQL server 2008 - grid not showing correctly -

jquery - Set jPicker field to empty value -

.htaccess - htaccess convert request to clean url and add slash at the end of the url -