-
Hi Guys: we have script that creates database. I mean the create DB statement with mentioning of log files and system files etc., One of the user accidentally ran the same on the existing database. But to prevent the same the script has to be smart enogh to check the existance of the db and if so, comeout successfully, if not go ahead and create one..
What is the best way to check this? Any ideas??
-
move your createdb script to a secure location so anybody can not run it...
Jeff Hunter
-
1. prompt the sid
2. add checking logic based on sid, verify any *sid* file exist under $OH/dbs, if yes, reconfirm before continue....
-
Thanks TamilS:
We create the Environment of all dbadmin files (entire directory from bdump, cdump, udump, pfile, log, create etrc.,) and establish/have a link under OH/dbs/init<sid>.ora ..
This link will exist even before we run createdb.sh and so how to check still remains.. How does the script know if the db is still there.. or not? Do I make sense?
And Jeff:
There is now way of hiding the file since the QA has to test every possibility and they want to run this intentionally to avoid any outcomes.. Are you kind of suggesting that once the script is run and db is successfully created change the permissions so it cannot be executed and be moved to a different folder?
Thanks.
-
Check for oratab entry for dbname string or get it from 'ps -ef|grep pmon' (which gives all instances currently running)and take dbname/instance name string.
Iam assuming your instance name=database name too.
-
Yes, once the createdb script has successfully run, either change the permissions on the file or move it to another directory so somebody doesn't "accidently" run it.
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|