I am totally new to Oracle SQL and PL/SQL. So I purchased the above mentioned e-book to learn. I seem to have some difficulty in getting somethings up and running, really hope someone can help.
As per the instruction given I downloaded and installed the necessary files. I ran the 'setup_database.bat'which was supposed to install all the tables and users. When I checked the log file, there are lines and lines of 'table created' and '1 row created' messages. I am curious as to what exactly did the 'setup_database.bat' file create? All I see when I open the file in notepad is this:
:: Murach's Oracle SQL and PL/SQL
:: Mike Murach & Associates, Inc.
:: Jan 1, 2008
:: Uses SQL*Plus utility to run the SQL scripts that create
:: and populate the tables in the AP, OM, and EX schemas.
:: If necessary, edit the username/password
sqlplus system/system @setup_database
:: Display a message about the log file
ECHO For details, check the setup_database.log file in the current directory.
:: Display 'press any key to continue' message
The BAT file does not contain actual SQL statements, it merely runs statements stored in an SQL script file. There should be a file named setup_database (or perhaps setup_database.sql), according to the contents of the BAT file you've posted. Try to find and have a look into that file.
Joined: Mar 12, 2012
Hi Martin Vajsar
Yes, there is a setup_database.sql file and it's contents are as follow:
prompt>Creating AP tables
prompt>Creating OM tables
prompt>Creating EX tables
Infact in the same folder there are another three sql files: create_ap_tables, create_ex_tables, create_om_tables. The excerises in the book refer to these tables and it seems all these tables should be created when the batch file is invoked, but nothing seems to happen. How and where do I check to see if the tables have actually been created?
The START command executes the given SQL script and then returns. It is similar to calling a subroutine. Inspect the files referenced by the START command (recursively if need be), you'll reach the real SQL statements eventually.
Edit: you mentioned the log file contains lines like table created; this indicates some tables were indeed created by the script. If there was an error, you'd most probably see ORA-XXXXX (XXXXX being a number) in the log file. Try to search for "ORA-" text in the log file, if you don't find such text, most probably the script has run without any error.
Managed to solve the problem. I was logging in with the default password when in sqlplus, as opposed to the password already determined by the scripts, hence all these problems of not being able to see the database. When in SQL developer, I was also using the default password to make the 'Connections' as opposed to one provided by the scripts. I am now using the correct passwords, I am able to see the databases and their tables. Thanks guys.