usrecnik / ddlfs Goto Github PK
View Code? Open in Web Editor NEWFilesystem which represents Oracle Database objects as their DDL stored in .sql files
License: MIT License
Filesystem which represents Oracle Database objects as their DDL stored in .sql files
License: MIT License
Hi @usrecnik
This looks very promising.
Is there any chance that ddlfs would work on Windows (with cygwin or any other Unix emulator?)
If not, what would be your suggestion to use it on Windows? Virtoualbox/docker with Ubuntu & mapped drive?
add execution bit (chmod u+x
) for VALID
objects. This way, most shells will display INVALID ("non-executable") code in different color :)
For example, "/ as sysdba"
currently, all_source is joined with dba_objects to obtain last_ddl_timestamp. If cache file already exist then we should query dba_objects in using query on dba_objects and only query all_source if cached version is invalid.
Hello Urh,
I'm testing 2.0-RC3 rpm and wondering why in filesize=-1 mode you are reading data
using 4 kB blocks ? I have slow database connection over WAN and wondering if there is any OCI/fuse/ddlfs limit which forced 4 kB reads ?
regards,
Marcin
Hi,
It seems like one of the missing objects in the picture is synonyms.
Do you plan to add support for those?
With dbro
option we should never set execution bit according to object's validity.
That's because (at least) Mercurial tracks execution bit.. And if you change one object and with that change invalidate (or validate) a lot of other objects (which were not actually touched), mercurial will mark all of the invalidated (or validated) objects as changed.. We don't want that, since their source has not actually changed (just their dba_objects.status has).
.. because it's source is never available, here is a testcase:
SQL> select count(*) from dba_objects where owner='SYS' and object_type='TYPE' and object_name='BFILE';
COUNT(*)
----------
1
SQL> select count(*) from dba_source where owner='SYS' and "TYPE"='TYPE' and "NAME"='BFILE';
COUNT(*)
----------
0
SQL> select dbms_metadata.get_ddl('TYPE', 'BFILE', 'SYS') from dual;
ERROR:
ORA-31603: object "BFILE" of type TYPE not found in schema "SYS"
ORA-06512: at "SYS.DBMS_METADATA", line 4018
ORA-06512: at "SYS.DBMS_METADATA", line 5843
ORA-06512: at line 1
Hi,
With a new option dbro -it's required to use DBA user to compare schemes otherwise you will get this error
2018-09-02 09:04:16 INFO DDL Filesystem v2.1 for Oracle Database, FUSE v2.9
2018-09-02 09:04:16 INFO .. connected to database server.
2018-09-02 09:04:16 INFO Cache validation started beacuase temppath_reused=[1] and dbro=[1]
2018-09-02 09:04:16 ERROR errcode=942||ORA-00942: table or view does not exist
It can be fixed by changing dba_objects view to all_objects view
diff --git a/src/dbro_refresh.c b/src/dbro_refresh.c
index 0c3972b..1c8ea05 100644
--- a/src/dbro_refresh.c
+++ b/src/dbro_refresh.c
@@ -109,7 +109,7 @@ int dbr_refresh_cache() {
const char *query =
"select o.owner, o.object_type, o.object_name, \
to_char(o.last_ddl_time, 'yyyy-mm-dd hh24:mi:ss') as last_ddl_time\
- from dba_objects o\
+ from all_objects o\
where generated='N'\
and (o.object_type != 'TYPE' or o.subobject_name IS NULL)\
and object_type IN (\
regards,
Marcin
Currently, keyword editionable
is lost (ignored).
It would probably be a good idea to introduce edition
mount option, which would (if specified) set default edition for this session to whatever is specified.
This only affects performance. Triggers are already supported in latest source, but not in 1.0 release.
Currently, the source for triggers is obtained using dbms_metadata.get_ddl
.
Hi Urh,
I'm doing some test of your code as I want to include it in my DevOps Oracle presentation.
I know from your comments that git doesn't work for now due to size of files set to 0.
I compiled a latest commit and this is what I can see
ls -l on file show 0 as a size
[oracle@linuxsource test121]$ ls -l /home/oracle/test121/plsql/PIORO/PROCEDURE/TEST.SQL
-rw-r--r--. 1 oracle oinstall 0 Jan 10 06:58 /home/oracle/test121/plsql/PIORO/PROCEDURE/TEST.SQL
ls -l on directory above show actual size 88
[oracle@linuxsource test121]$ ls -l /home/oracle/test121/plsql/PIORO/PROCEDURE/
total 0
-rw-r--r--. 1 oracle oinstall 88 Jan 10 06:58 TEST.SQL
Are you working on code to make it consistent now ?
If you need help, let me know and I will take a look on it. I didn't code in C for while
but maybe I will be able to help you.
Great Job !!!!
regards,
Marcin
I'm thinking of providing .sql file which creates test schema and a set of bash scripts which mount that schema and then perform (and validate) a set of tasks on this mounted filesystem, such as:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.